George Kennedy
adcecd50da
scsi: scsi_debug: Sanity check block descriptor length in resp_mode_select()
...
commit e0a2c28da11e2c2b963fc01d50acbf03045ac732 upstream.
In resp_mode_select() sanity check the block descriptor len to avoid UAF.
BUG: KASAN: use-after-free in resp_mode_select+0xa4c/0xb40 drivers/scsi/scsi_debug.c:2509
Read of size 1 at addr ffff888026670f50 by task scsicmd/15032
CPU: 1 PID: 15032 Comm: scsicmd Not tainted 5.15.0-01d0625 #15
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS
Call Trace:
<TASK>
dump_stack_lvl+0x89/0xb5 lib/dump_stack.c:107
print_address_description.constprop.9+0x28/0x160 mm/kasan/report.c:257
kasan_report.cold.14+0x7d/0x117 mm/kasan/report.c:443
__asan_report_load1_noabort+0x14/0x20 mm/kasan/report_generic.c:306
resp_mode_select+0xa4c/0xb40 drivers/scsi/scsi_debug.c:2509
schedule_resp+0x4af/0x1a10 drivers/scsi/scsi_debug.c:5483
scsi_debug_queuecommand+0x8c9/0x1e70 drivers/scsi/scsi_debug.c:7537
scsi_queue_rq+0x16b4/0x2d10 drivers/scsi/scsi_lib.c:1521
blk_mq_dispatch_rq_list+0xb9b/0x2700 block/blk-mq.c:1640
__blk_mq_sched_dispatch_requests+0x28f/0x590 block/blk-mq-sched.c:325
blk_mq_sched_dispatch_requests+0x105/0x190 block/blk-mq-sched.c:358
__blk_mq_run_hw_queue+0xe5/0x150 block/blk-mq.c:1762
__blk_mq_delay_run_hw_queue+0x4f8/0x5c0 block/blk-mq.c:1839
blk_mq_run_hw_queue+0x18d/0x350 block/blk-mq.c:1891
blk_mq_sched_insert_request+0x3db/0x4e0 block/blk-mq-sched.c:474
blk_execute_rq_nowait+0x16b/0x1c0 block/blk-exec.c:63
sg_common_write.isra.18+0xeb3/0x2000 drivers/scsi/sg.c:837
sg_new_write.isra.19+0x570/0x8c0 drivers/scsi/sg.c:775
sg_ioctl_common+0x14d6/0x2710 drivers/scsi/sg.c:941
sg_ioctl+0xa2/0x180 drivers/scsi/sg.c:1166
__x64_sys_ioctl+0x19d/0x220 fs/ioctl.c:52
do_syscall_64+0x3a/0x80 arch/x86/entry/common.c:50
entry_SYSCALL_64_after_hwframe+0x44/0xae arch/x86/entry/entry_64.S:113
Link: https://lore.kernel.org/r/1637262208-28850-1-git-send-email-george.kennedy@oracle.com
Reported-by: syzkaller <syzkaller@googlegroups.com>
Acked-by: Douglas Gilbert <dgilbert@interlog.com>
Signed-off-by: George Kennedy <george.kennedy@oracle.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-12-22 09:05:15 +01:00
..
2020-10-01 20:40:01 +02:00
2021-07-28 09:14:25 +02:00
2019-02-20 10:18:35 +01:00
2016-10-26 22:17:43 -04:00
2020-08-21 11:02:01 +02:00
2021-07-20 16:21:15 +02:00
2020-01-14 20:04:31 +01:00
2021-03-03 17:44:40 +01:00
2020-12-29 13:44:50 +01:00
2021-11-26 11:48:37 +01:00
2020-01-23 08:19:37 +01:00
2016-09-14 12:47:42 -04:00
2021-08-26 08:37:26 -04:00
2020-01-23 08:19:42 +01:00
2020-09-03 11:21:18 +02:00
2020-12-29 13:44:59 +01:00
2019-04-05 22:29:06 +02:00
2021-02-10 09:09:24 +01:00
2018-10-20 09:51:30 +02:00
2019-11-28 18:28:24 +01:00
2021-05-22 10:40:18 +02:00
2021-06-03 08:23:32 +02:00
2021-11-26 11:48:40 +01:00
2021-08-26 08:37:26 -04:00
2021-12-08 08:45:03 +01:00
2018-05-25 16:13:08 +02:00
2016-07-20 17:38:35 -06:00
2015-05-31 18:06:28 -07:00
2020-12-29 13:44:59 +01:00
2021-11-26 11:48:38 +01:00
2020-10-29 09:05:34 +01:00
2019-06-22 08:17:24 +02:00
2017-08-06 18:59:49 -07:00
2019-11-25 09:52:13 +01:00
2021-01-30 13:27:14 +01:00
2018-09-19 22:47:14 +02:00
2015-04-27 10:10:19 -07:00
2018-09-19 22:47:14 +02:00
2015-04-27 10:04:39 -07:00
2018-09-19 22:47:14 +02:00
2015-04-27 10:05:55 -07:00
2016-07-13 22:33:23 -04:00
2016-07-13 22:33:23 -04:00
2015-08-07 15:03:42 +02:00
2021-11-26 11:48:40 +01:00
2015-05-31 18:06:28 -07:00
2016-02-23 21:27:02 -05:00
2015-04-09 18:08:31 -07:00
2015-05-31 18:06:28 -07:00
2015-05-31 18:06:28 -07:00
2015-04-17 10:13:56 -07:00
2020-01-04 13:40:54 +01:00
2015-11-25 22:08:55 -05:00
2015-11-25 22:08:52 -05:00
2021-09-22 11:43:08 +02:00
2021-06-03 08:23:31 +02:00
2015-04-14 09:50:27 -07:00
2016-08-16 00:49:32 -04:00
2021-11-26 11:48:36 +01:00
2016-04-11 16:57:09 -04:00
2016-02-23 21:27:02 -05:00
2016-05-10 22:01:07 -04:00
2018-11-13 11:16:51 -08:00
2018-11-13 11:16:51 -08:00
2016-02-23 21:27:02 -05:00
2021-07-20 16:21:04 +02:00
2017-01-12 11:39:29 +01:00
2016-09-29 21:52:43 -04:00
2016-02-25 21:16:49 -05:00
2016-02-25 21:16:49 -05:00
2020-09-12 11:47:36 +02:00
2021-07-20 16:21:10 +02:00
2019-07-10 09:55:43 +02:00
2020-11-18 18:26:26 +01:00
2017-12-20 10:07:22 +01:00
2015-08-12 13:14:57 -07:00
2015-08-12 13:14:57 -07:00
2016-02-25 21:10:53 -05:00
2015-11-20 11:39:03 -05:00
2020-04-02 17:20:32 +02:00
2020-04-02 17:20:32 +02:00
2019-11-28 18:28:23 +01:00
2020-06-30 15:38:28 -04:00
2020-02-28 15:42:34 +01:00
2016-01-27 20:36:10 +08:00
2021-05-22 10:40:25 +02:00
2019-11-10 11:23:15 +01:00
2016-01-27 20:36:10 +08:00
2021-07-20 16:21:11 +02:00
2016-02-05 16:29:28 -06:00
2018-11-13 11:16:51 -08:00
2020-01-04 13:40:54 +01:00
2016-09-26 20:49:25 -04:00
2019-10-29 09:14:57 +01:00
2020-08-21 11:02:02 +02:00
2020-10-29 09:05:43 +01:00
2015-05-31 18:06:28 -07:00
2019-11-25 09:53:05 +01:00
2016-09-14 14:11:12 -04:00
2015-05-31 18:06:28 -07:00
2016-09-04 01:28:07 -04:00
2016-02-23 21:27:02 -05:00
2015-05-31 18:06:28 -07:00
2016-04-30 09:25:26 -07:00
2015-05-31 18:06:28 -07:00
2016-03-01 20:06:49 -05:00
2016-11-28 15:51:31 -05:00
2016-04-04 12:07:42 -04:00
2021-12-22 09:05:15 +01:00
2020-06-30 15:38:37 -04:00
2019-05-08 07:19:10 +02:00
2016-06-18 11:59:01 -07:00
2021-07-20 16:21:06 +02:00
2019-10-07 18:53:15 +02:00
2019-01-23 08:10:54 +01:00
2016-10-07 09:28:53 -07:00
2016-04-11 16:57:09 -04:00
2016-03-14 21:05:04 -04:00
2021-08-26 08:37:26 -04:00
2021-11-12 13:18:01 +01:00
2020-01-23 08:19:43 +01:00
2016-04-11 16:57:09 -04:00
2021-12-08 08:45:05 +01:00
2016-08-18 22:23:20 -04:00
2020-07-31 16:44:01 +02:00
2018-06-06 16:44:38 +02:00
2021-11-12 13:18:01 +01:00
2016-09-15 09:51:14 -04:00
2021-10-09 13:25:59 +02:00
2016-09-15 09:51:14 -04:00
2016-04-11 16:57:09 -04:00
2021-10-17 10:05:40 +02:00
2020-05-20 08:15:34 +02:00
2016-02-23 21:27:02 -05:00
2021-05-22 10:40:26 +02:00
2018-12-13 09:20:29 +01:00
2021-08-15 13:01:01 +02:00
2021-04-07 12:05:39 +02:00
2015-11-18 11:59:09 -05:00
2016-02-23 21:27:02 -05:00
2019-05-08 07:19:10 +02:00
2020-01-04 13:40:54 +01:00
2021-05-22 10:40:26 +02:00
2015-05-31 18:06:28 -07:00
2021-10-17 10:05:40 +02:00
2021-06-16 11:36:33 +02:00
2016-11-01 13:31:23 -04:00
2015-02-02 09:57:46 -08:00
2016-09-01 17:52:01 -07:00
2015-05-31 18:06:28 -07:00
2018-08-24 13:12:29 +02:00