Jeremy Cline
c1ef3feca6
fs/quota: Fix spectre gadget in do_quotactl
...
commit 7b6924d94a60c6b8c1279ca003e8744e6cd9e8b1 upstream.
'type' is user-controlled, so sanitize it after the bounds check to
avoid using it in speculative execution. This covers the following
potential gadgets detected with the help of smatch:
* fs/ext4/super.c:5741 ext4_quota_read() warn: potential spectre issue
'sb_dqopt(sb)->files' [r]
* fs/ext4/super.c:5778 ext4_quota_write() warn: potential spectre issue
'sb_dqopt(sb)->files' [r]
* fs/f2fs/super.c:1552 f2fs_quota_read() warn: potential spectre issue
'sb_dqopt(sb)->files' [r]
* fs/f2fs/super.c:1608 f2fs_quota_write() warn: potential spectre issue
'sb_dqopt(sb)->files' [r]
* fs/quota/dquot.c:412 mark_info_dirty() warn: potential spectre issue
'sb_dqopt(sb)->info' [w]
* fs/quota/dquot.c:933 dqinit_needed() warn: potential spectre issue
'dquots' [r]
* fs/quota/dquot.c:2112 dquot_commit_info() warn: potential spectre
issue 'dqopt->ops' [r]
* fs/quota/dquot.c:2362 vfs_load_quota_inode() warn: potential spectre
issue 'dqopt->files' [w] (local cap)
* fs/quota/dquot.c:2369 vfs_load_quota_inode() warn: potential spectre
issue 'dqopt->ops' [w] (local cap)
* fs/quota/dquot.c:2370 vfs_load_quota_inode() warn: potential spectre
issue 'dqopt->info' [w] (local cap)
* fs/quota/quota.c:110 quota_getfmt() warn: potential spectre issue
'sb_dqopt(sb)->info' [r]
* fs/quota/quota_v2.c:84 v2_check_quota_file() warn: potential spectre
issue 'quota_magics' [w]
* fs/quota/quota_v2.c:85 v2_check_quota_file() warn: potential spectre
issue 'quota_versions' [w]
* fs/quota/quota_v2.c:96 v2_read_file_info() warn: potential spectre
issue 'dqopt->info' [r]
* fs/quota/quota_v2.c:172 v2_write_file_info() warn: potential spectre
issue 'dqopt->info' [r]
Additionally, a quick inspection indicates there are array accesses with
'type' in quota_on() and quota_off() functions which are also addressed
by this.
Cc: Josh Poimboeuf <jpoimboe@redhat.com>
Cc: stable@vger.kernel.org
Signed-off-by: Jeremy Cline <jcline@redhat.com>
Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-09-09 10:32:42 +02:00
..
2018-09-09 10:32:33 +02:00
2018-06-15 07:31:07 +09:00
2018-05-28 12:36:41 +02:00
2018-06-16 16:32:04 +09:00
2018-07-14 11:11:09 -07:00
2018-06-15 18:10:01 -03:00
2018-05-22 14:27:50 -04:00
2018-09-05 09:29:42 +02:00
2018-07-25 14:49:00 +01:00
2018-06-26 18:42:44 +02:00
2018-09-05 09:29:41 +02:00
2018-06-05 16:57:31 -07:00
2018-06-05 16:57:31 -07:00
2018-06-15 07:31:07 +09:00
2018-06-11 10:16:13 -07:00
2018-06-12 20:52:16 -07:00
2018-06-12 16:19:22 -07:00
2018-05-26 09:16:25 +02:00
2018-06-15 07:55:24 +09:00
2018-04-12 12:04:49 +02:00
2018-06-20 11:04:26 +02:00
2018-09-05 09:29:46 +02:00
2018-06-15 07:31:07 +09:00
2018-07-21 12:50:46 -07:00
2018-05-22 14:27:51 -04:00
2018-07-25 14:49:00 +01:00
2018-09-05 09:29:49 +02:00
2018-06-15 07:31:07 +09:00
2018-06-15 07:31:07 +09:00
2018-06-15 07:31:07 +09:00
2018-06-05 16:57:31 -07:00
2018-06-12 16:19:22 -07:00
2018-07-26 19:38:03 -07:00
2018-04-16 09:47:41 +02:00
2018-07-08 11:10:30 -07:00
2018-06-15 07:31:07 +09:00
2018-08-04 07:53:46 -07:00
2018-06-15 07:31:07 +09:00
2018-09-09 10:32:38 +02:00
2018-05-22 14:27:52 -04:00
2018-09-09 10:32:38 +02:00
2018-09-09 10:32:38 +02:00
2018-05-11 15:36:37 -04:00
2018-05-18 14:58:22 +02:00
2018-06-15 07:31:07 +09:00
2018-06-15 07:31:07 +09:00
2018-05-22 14:27:58 -04:00
2018-05-22 14:27:57 -04:00
2018-06-17 05:25:18 +09:00
2018-09-09 10:32:36 +02:00
2018-07-14 11:11:09 -07:00
2018-06-14 14:57:24 +02:00
2018-05-22 14:27:52 -04:00
2018-05-22 14:27:54 -04:00
2018-09-09 10:32:42 +02:00
2018-08-24 13:04:51 +02:00
2018-05-22 14:27:55 -04:00
2018-08-02 09:34:02 -07:00
2018-09-05 09:29:54 +02:00
2018-05-22 14:27:53 -04:00
2018-09-09 10:32:40 +02:00
2018-06-20 11:05:49 +02:00
2018-06-12 16:19:22 -07:00
2018-07-24 11:34:52 -07:00
2018-07-22 12:04:51 -07:00
2018-06-15 07:31:07 +09:00
2018-06-05 16:57:31 -07:00
2018-04-11 10:28:37 -07:00
2018-06-12 16:19:22 -07:00
2018-07-14 11:11:10 -07:00
2018-04-11 10:28:37 -07:00
2018-06-15 18:11:26 -03:00
2018-07-27 12:51:00 -07:00
2018-06-01 18:37:33 -07:00
2018-06-07 17:34:40 -07:00
2018-06-05 19:23:26 +02:00
2018-06-08 17:21:52 -07:00
2018-08-09 18:07:15 -04:00
2018-05-14 08:55:18 -06:00
2018-06-28 10:40:47 -07:00
2018-06-28 10:40:47 -07:00
2018-07-26 19:38:03 -07:00
2018-06-07 17:34:35 -07:00
2018-05-16 07:23:35 +02:00
2018-05-03 16:11:37 -06:00
2018-07-05 12:36:36 -07:00
2018-07-10 23:29:03 -04:00
2018-05-24 12:04:28 -05:00
2018-08-02 13:09:27 -07:00
2018-06-11 08:22:34 -07:00
2018-06-15 18:11:26 -03:00
2018-06-15 07:31:07 +09:00
2018-06-11 08:22:34 -07:00
2018-06-12 16:19:22 -07:00
2018-06-16 16:32:04 +09:00
2018-08-09 17:51:32 -04:00
2018-06-03 10:58:23 -07:00
2018-06-28 10:40:47 -07:00
2018-06-12 16:19:22 -07:00
2018-06-28 10:40:47 -07:00
2018-05-25 18:12:11 -07:00
2018-06-16 16:21:50 +09:00
2018-06-16 16:21:50 +09:00
2018-06-04 10:14:28 -07:00
2018-04-04 12:44:02 -07:00
2018-06-28 10:40:47 -07:00
2018-08-02 16:03:40 -07:00
2018-09-09 10:32:41 +02:00