================================================================== BUG: KASAN: stack-out-of-bounds in ipmr_ioctl+0x886/0xaf0 Read of size 4 at addr ffff888035217b24 by task syz-executor.5/23220 CPU: 0 PID: 23220 Comm: syz-executor.5 Not tainted 6.4.0-rc7-next-20230621 #1 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.12.0-1 04/01/2014 Call Trace: dump_stack_lvl+0x91/0xf0 print_report+0xcc/0x620 kasan_report+0xbe/0xf0 ipmr_ioctl+0x886/0xaf0 raw_ioctl+0x4e/0x1e0 sk_ioctl+0x14b/0x320 inet_ioctl+0x18c/0x390 sock_do_ioctl+0xd2/0x240 sock_ioctl+0x424/0x670 __x64_sys_ioctl+0x1a4/0x210 do_syscall_64+0x3f/0x90 entry_SYSCALL_64_after_hwframe+0x6e/0xd8 RIP: 0033:0x7f5976a76b19 Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 bc ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f5973fec188 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 RAX: ffffffffffffffda RBX: 00007f5976b89f60 RCX: 00007f5976a76b19 RDX: 0000000000000000 RSI: 00000000000089e1 RDI: 0000000000000003 RBP: 00007f5976ad0f6d R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007ffd5e84b9bf R14: 00007f5973fec300 R15: 0000000000022000 The buggy address belongs to stack of task syz-executor.5/23220 and is located at offset 36 in frame: sk_ioctl+0x0/0x320 This frame has 1 object: [32, 36) 'karg' The buggy address belongs to the physical page: page:0000000039f99e52 refcount:0 mapcount:0 mapping:0000000000000000 index:0x2 pfn:0x35217 flags: 0x100000000000000(node=0|zone=1) page_type: 0xffffffff() raw: 0100000000000000 0000000000000000 ffffffff00000101 0000000000000000 raw: 0000000000000002 0000000000000000 00000000ffffffff 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff888035217a00: 00 00 00 00 00 00 00 f1 f1 f1 f1 00 f3 f3 f3 00 ffff888035217a80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff888035217b00: f1 f1 f1 f1 04 f3 f3 f3 00 00 00 00 00 00 00 00 ^ ffff888035217b80: 00 00 00 f1 f1 f1 f1 f1 f1 00 00 00 00 00 f2 f2 ffff888035217c00: f2 f2 f2 00 00 00 00 00 00 00 00 00 00 00 00 00 ================================================================== loop5: detected capacity change from 0 to 40 syz-executor.5: attempt to access beyond end of device loop5: rw=2049, sector=40, nr_sectors = 4 limit=40 buffer_io_error: 78 callbacks suppressed Buffer I/O error on dev loop5, logical block 10, lost async page write loop5: detected capacity change from 0 to 40 loop6: detected capacity change from 0 to 40 loop0: detected capacity change from 0 to 40 syz-executor.6: attempt to access beyond end of device loop6: rw=2049, sector=40, nr_sectors = 4 limit=40 Buffer I/O error on dev loop6, logical block 10, lost async page write syz-executor.5: attempt to access beyond end of device loop5: rw=2049, sector=40, nr_sectors = 4 limit=40 Buffer I/O error on dev loop5, logical block 10, lost async page write syz-executor.0: attempt to access beyond end of device loop0: rw=2049, sector=40, nr_sectors = 4 limit=40 Buffer I/O error on dev loop0, logical block 10, lost async page write loop6: detected capacity change from 0 to 40 loop5: detected capacity change from 0 to 40 loop0: detected capacity change from 0 to 40 loop7: detected capacity change from 0 to 40 syz-executor.6: attempt to access beyond end of device loop6: rw=2049, sector=40, nr_sectors = 4 limit=40 Buffer I/O error on dev loop6, logical block 10, lost async page write loop3: detected capacity change from 0 to 40 syz-executor.5: attempt to access beyond end of device loop5: rw=2049, sector=40, nr_sectors = 4 limit=40 Buffer I/O error on dev loop5, logical block 10, lost async page write syz-executor.3: attempt to access beyond end of device loop3: rw=2049, sector=40, nr_sectors = 4 limit=40 Buffer I/O error on dev loop3, logical block 10, lost async page write syz-executor.7: attempt to access beyond end of device loop7: rw=2049, sector=40, nr_sectors = 4 limit=40 Buffer I/O error on dev loop7, logical block 10, lost async page write loop5: detected capacity change from 0 to 40 syz-executor.5: attempt to access beyond end of device loop5: rw=2049, sector=40, nr_sectors = 4 limit=40 Buffer I/O error on dev loop5, logical block 10, lost async page write loop7: detected capacity change from 0 to 40 syz-executor.7: attempt to access beyond end of device loop7: rw=2049, sector=40, nr_sectors = 4 limit=40 Buffer I/O error on dev loop7, logical block 10, lost async page write loop6: detected capacity change from 0 to 40 loop3: detected capacity change from 0 to 40 loop7: detected capacity change from 0 to 40 loop0: detected capacity change from 0 to 40 loop3: detected capacity change from 0 to 40