Jeremy Cline
59825a7ef3
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 20:04:36 +02:00
..
2018-09-09 20:04:33 +02:00
2018-05-30 07:48:51 +02:00
2017-12-20 10:04:56 +01:00
2018-04-24 09:32:11 +02:00
2018-09-05 09:18:37 +02:00
2018-09-05 09:18:35 +02:00
2017-12-20 10:04:52 +01:00
2018-09-05 09:18:37 +02:00
2017-11-24 08:32:25 +01:00
2017-06-26 07:13:08 +02:00
2017-08-06 19:19:42 -07:00
2016-08-16 09:30:49 +02:00
2017-09-13 14:09:45 -07:00
2018-05-30 07:48:52 +02:00
2016-03-03 15:07:09 -08:00
2015-12-12 10:15:34 -08:00
2018-05-30 07:48:52 +02:00
2018-09-05 09:18:38 +02:00
2018-08-06 16:24:31 +02:00
2018-07-25 10:18:15 +02:00
2015-08-07 13:59:24 +02:00
2018-09-05 09:18:35 +02:00
2018-09-05 09:18:39 +02:00
2018-05-30 07:49:13 +02:00
2015-09-10 13:29:01 -07:00
2018-05-26 08:49:01 +02:00
2016-09-30 10:18:39 +02:00
2016-06-01 12:15:54 -07:00
2017-06-26 07:13:11 +02:00
2017-11-30 08:37:20 +00:00
2018-07-11 16:03:48 +02:00
2018-05-30 07:48:54 +02:00
2018-08-09 12:19:28 +02:00
2018-02-16 20:09:42 +01:00
2018-05-26 08:48:50 +02:00
2015-11-06 17:50:42 -08:00
2018-03-28 18:40:15 +02:00
2018-09-09 20:04:34 +02:00
2018-02-03 17:04:28 +01:00
2018-08-06 16:24:30 +02:00
2018-05-30 07:48:52 +02:00
2018-04-24 09:32:11 +02:00
2015-11-06 17:50:42 -08:00
2018-07-22 14:25:52 +02:00
2018-08-28 07:23:43 +02:00
2018-07-25 10:18:28 +02:00
2017-08-06 19:19:43 -07:00
2018-09-09 20:04:36 +02:00
2015-10-16 11:42:28 -07:00
2018-08-24 13:27:01 +02:00
2017-06-17 06:39:38 +02:00
2018-08-06 16:24:42 +02:00
2018-09-05 09:18:40 +02:00
2015-11-23 21:11:08 -05:00
2015-11-04 22:13:45 -05:00
2018-09-09 20:04:35 +02:00
2018-07-03 11:21:34 +02:00
2018-05-30 07:48:52 +02:00
2018-06-13 16:15:27 +02:00
2018-06-06 16:46:23 +02:00
2016-10-22 12:26:56 +02:00
2015-11-10 12:07:22 -08:00
2017-07-21 07:44:57 +02:00
2018-07-03 11:21:26 +02:00
2017-05-20 14:27:01 +02:00
2017-06-14 13:16:24 +02:00
2015-08-05 13:49:35 -07:00
2018-02-25 11:03:51 +01:00
2018-04-08 11:51:57 +02:00
2017-07-05 14:37:20 +02:00
2015-11-16 23:54:45 -08:00
2018-08-15 17:42:05 +02:00
2017-10-18 09:20:42 +02:00
2015-08-17 18:39:46 -04:00
2017-09-07 08:34:10 +02:00
2017-07-21 07:44:57 +02:00
2018-01-31 12:06:11 +01:00
2016-04-12 09:08:58 -07:00
2015-08-07 04:39:40 +03:00
2015-11-05 23:05:32 -08:00
2018-05-16 10:06:51 +02:00
2018-07-17 11:31:43 +02:00
2015-08-17 23:38:10 -04:00
2015-11-16 23:54:45 -08:00
2015-08-12 15:28:45 -05:00
2018-01-17 09:35:27 +01:00
2015-10-15 10:33:21 -04:00
2017-07-21 07:44:57 +02:00
2017-06-14 13:16:24 +02:00
2018-04-24 09:32:04 +02:00
2018-08-15 17:42:05 +02:00
2018-02-16 20:09:43 +01:00
2017-07-15 11:57:44 +02:00
2018-05-26 08:48:51 +02:00
2017-07-21 07:44:58 +02:00
2017-04-30 05:49:28 +02:00
2017-01-26 08:23:47 +01:00
2016-04-12 09:08:55 -07:00
2017-10-05 09:41:45 +02:00
2018-01-31 12:06:09 +01:00
2017-08-06 19:19:42 -07:00
2015-08-07 04:39:40 +03:00
2017-02-23 17:43:09 +01:00
2017-06-14 13:16:24 +02:00
2018-03-03 10:19:41 +01:00
2015-11-06 17:50:42 -08:00
2017-05-08 07:46:01 +02:00
2017-12-20 10:04:53 +01:00
2016-10-22 12:26:56 +02:00
2018-09-09 20:04:36 +02:00