syzbot


KASAN: use-after-free Read in rdma_listen

Status: upstream: reported C repro on 2019/06/10 00:44
Reported-by: syzbot+e57ae567bab1748839c5@syzkaller.appspotmail.com
First crash: 1208d, last: 1d11h
similar bugs (6):
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream BUG: corrupted list in rdma_listen (2) C inconclusive 5 234d 300d 23/24 upstream: reported C repro on 2021/12/04 09:54
upstream KASAN: use-after-free Read in rdma_listen (3) 1 525d 517d 0/24 auto-closed as invalid on 2021/08/21 07:04
upstream KASAN: use-after-free Read in rdma_listen (2) C done 354 911d 1280d 17/24 fixed on 2020/05/10 10:42
upstream KASAN: use-after-free Read in rdma_listen C 1548 1283d 1642d 12/24 fixed on 2019/03/28 12:00
linux-4.19 KASAN: use-after-free Read in rdma_listen syz done 143 900d 1213d 1/1 fixed on 2020/05/13 09:53
linux-4.14 BUG: corrupted list in rdma_listen (2) C 21 31d 792d 0/1 upstream: reported C repro on 2020/07/30 18:22

Sample crash report:
==================================================================
BUG: KASAN: use-after-free in __list_add_valid+0x93/0xa0 lib/list_debug.c:26
Read of size 8 at addr ffff88809ca0b858 by task syz-executor272/8474

CPU: 0 PID: 8474 Comm: syz-executor272 Not tainted 4.14.294-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/26/2022
Call Trace:
 __dump_stack lib/dump_stack.c:17 [inline]
 dump_stack+0x1b2/0x281 lib/dump_stack.c:58
 print_address_description.cold+0x54/0x1d3 mm/kasan/report.c:252
 kasan_report_error.cold+0x8a/0x191 mm/kasan/report.c:351
 kasan_report mm/kasan/report.c:409 [inline]
 __asan_report_load8_noabort+0x68/0x70 mm/kasan/report.c:430
 __list_add_valid+0x93/0xa0 lib/list_debug.c:26
 __list_add include/linux/list.h:60 [inline]
 list_add_tail include/linux/list.h:93 [inline]
 cma_listen_on_all drivers/infiniband/core/cma.c:2327 [inline]
 rdma_listen+0x656/0x9b0 drivers/infiniband/core/cma.c:3339
 ucma_listen+0x10b/0x170 drivers/infiniband/core/ucma.c:1078
 ucma_write+0x206/0x2c0 drivers/infiniband/core/ucma.c:1672
 __vfs_write+0xe4/0x630 fs/read_write.c:480
 vfs_write+0x17f/0x4d0 fs/read_write.c:544
 SYSC_write fs/read_write.c:590 [inline]
 SyS_write+0xf2/0x210 fs/read_write.c:582
 do_syscall_64+0x1d5/0x640 arch/x86/entry/common.c:292
 entry_SYSCALL_64_after_hwframe+0x46/0xbb
RIP: 0033:0x7f2fb883aa79
RSP: 002b:00007f2fb87cb318 EFLAGS: 00000246 ORIG_RAX: 0000000000000001
RAX: ffffffffffffffda RBX: 00007f2fb88c2418 RCX: 00007f2fb883aa79
RDX: 0000000000000010 RSI: 0000000020000000 RDI: 0000000000000003
RBP: 00007f2fb88c2410 R08: 00007f2fb87cb700 R09: 0000000000000000
R10: 00007f2fb87cb700 R11: 0000000000000246 R12: 006d635f616d6472
R13: 00007ffd13dc321f R14: 00007f2fb87cb400 R15: 0000000000022000

Allocated by task 8468:
 save_stack mm/kasan/kasan.c:447 [inline]
 set_track mm/kasan/kasan.c:459 [inline]
 kasan_kmalloc+0xeb/0x160 mm/kasan/kasan.c:551
 kmem_cache_alloc_trace+0x131/0x3d0 mm/slab.c:3618
 kmalloc include/linux/slab.h:488 [inline]
 kzalloc include/linux/slab.h:661 [inline]
 rdma_create_id+0x57/0x4c0 drivers/infiniband/core/cma.c:790
 ucma_create_id+0x18b/0x500 drivers/infiniband/core/ucma.c:484
 ucma_write+0x206/0x2c0 drivers/infiniband/core/ucma.c:1672
 __vfs_write+0xe4/0x630 fs/read_write.c:480
 vfs_write+0x17f/0x4d0 fs/read_write.c:544
 SYSC_write fs/read_write.c:590 [inline]
 SyS_write+0xf2/0x210 fs/read_write.c:582
 do_syscall_64+0x1d5/0x640 arch/x86/entry/common.c:292
 entry_SYSCALL_64_after_hwframe+0x46/0xbb

Freed by task 8470:
 save_stack mm/kasan/kasan.c:447 [inline]
 set_track mm/kasan/kasan.c:459 [inline]
 kasan_slab_free+0xc3/0x1a0 mm/kasan/kasan.c:524
 __cache_free mm/slab.c:3496 [inline]
 kfree+0xc9/0x250 mm/slab.c:3815
 ucma_close+0x11a/0x340 drivers/infiniband/core/ucma.c:1753
 __fput+0x25f/0x7a0 fs/file_table.c:210
 task_work_run+0x11f/0x190 kernel/task_work.c:113
 exit_task_work include/linux/task_work.h:22 [inline]
 do_exit+0xa44/0x2850 kernel/exit.c:868
 do_group_exit+0x100/0x2e0 kernel/exit.c:965
 get_signal+0x38d/0x1ca0 kernel/signal.c:2412
 do_signal+0x7c/0x1550 arch/x86/kernel/signal.c:792
 exit_to_usermode_loop+0x160/0x200 arch/x86/entry/common.c:160
 prepare_exit_to_usermode arch/x86/entry/common.c:199 [inline]
 syscall_return_slowpath arch/x86/entry/common.c:270 [inline]
 do_syscall_64+0x4a3/0x640 arch/x86/entry/common.c:297
 entry_SYSCALL_64_after_hwframe+0x46/0xbb

The buggy address belongs to the object at ffff88809ca0b680
 which belongs to the cache kmalloc-1024 of size 1024
The buggy address is located 472 bytes inside of
 1024-byte region [ffff88809ca0b680, ffff88809ca0ba80)
The buggy address belongs to the page:
page:ffffea0002728280 count:1 mapcount:0 mapping:ffff88809ca0a000 index:0x0 compound_mapcount: 0
flags: 0xfff00000008100(slab|head)
raw: 00fff00000008100 ffff88809ca0a000 0000000000000000 0000000100000007
raw: ffffea000270ad20 ffffea0002707ba0 ffff88813fe74ac0 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
 ffff88809ca0b700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff88809ca0b780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff88809ca0b800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
                                                    ^
 ffff88809ca0b880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff88809ca0b900: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================

Fix bisection attempts:
Manager Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Title
ci2-linux-4-14 2021/10/28 20:42 linux-4.14.y cd5296934610 8cac236e .config log report syz C
ci2-linux-4-14 2021/08/27 09:17 linux-4.14.y 35c4ba160ab6 a52ee10a .config log report syz C
ci2-linux-4-14 2021/07/28 08:00 linux-4.14.y 964f3712e6a7 a52ee10a .config log report syz C
ci2-linux-4-14 2021/06/28 07:33 linux-4.14.y cfb41ef9deb1 a52ee10a .config log report syz C
* Struck through repros no longer work on HEAD.
Crashes (1266):
Manager Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Title
ci2-linux-4-14 2022/09/23 12:50 linux-4.14.y 4edbf74132a4 0042f2b4 .config log report syz C KASAN: use-after-free Read in rdma_listen
ci2-linux-4-14 2022/09/17 18:33 linux-4.14.y 5df8b4735177 dd9a85ff .config log report syz C KASAN: use-after-free Read in rdma_listen
ci2-linux-4-14 2022/09/08 21:15 linux-4.14.y 65640c873dcf f3027468 .config log report syz C KASAN: use-after-free Read in rdma_listen
ci2-linux-4-14 2022/09/06 21:09 linux-4.14.y 65640c873dcf 65aea2b9 .config log report syz C KASAN: use-after-free Read in rdma_listen
ci2-linux-4-14 2022/08/15 02:49 linux-4.14.y b641242202ed 8dfcaa3d .config log report syz C KASAN: use-after-free Read in rdma_listen
ci2-linux-4-14 2022/08/05 02:47 linux-4.14.y b641242202ed 1c9013ac .config log report syz C KASAN: use-after-free Read in rdma_listen
ci2-linux-4-14 2022/08/03 21:14 linux-4.14.y b641242202ed 1c9013ac .config log report syz C KASAN: use-after-free Read in rdma_listen
ci2-linux-4-14 2022/08/03 16:41 linux-4.14.y b641242202ed 1c9013ac .config log report syz C KASAN: use-after-free Read in rdma_listen
ci2-linux-4-14 2022/07/04 05:55 linux-4.14.y ed2e96e11936 1434eec0 .config log report syz C KASAN: use-after-free Read in rdma_listen
ci2-linux-4-14 2022/07/04 00:53 linux-4.14.y ed2e96e11936 1434eec0 .config log report syz C KASAN: use-after-free Read in rdma_listen
ci2-linux-4-14 2022/07/02 04:25 linux-4.14.y f051383ef03b 1434eec0 .config log report syz C KASAN: use-after-free Read in rdma_listen
ci2-linux-4-14 2022/06/27 00:03 linux-4.14.y f051383ef03b a371c43c .config log report syz C KASAN: use-after-free Read in rdma_listen
ci2-linux-4-14 2022/06/24 04:41 linux-4.14.y 84bae26850e3 912f5df7 .config log report syz C KASAN: use-after-free Read in rdma_listen
ci2-linux-4-14 2022/06/09 18:04 linux-4.14.y b8f3be299d51 0d5abf15 .config log report syz C KASAN: use-after-free Read in rdma_listen
ci2-linux-4-14 2022/05/29 09:16 linux-4.14.y 501eec4f9e13 a46af346 .config log report syz C KASAN: use-after-free Read in rdma_listen
ci2-linux-4-14 2022/03/15 01:52 linux-4.14.y af48f51cb593 9e8eaa75 .config log report syz C KASAN: use-after-free Read in rdma_listen
ci2-linux-4-14 2022/02/02 08:45 linux-4.14.y b86ee2b7ae42 4ebb2798 .config log report syz C KASAN: use-after-free Read in rdma_listen
ci2-linux-4-14 2021/09/25 13:45 linux-4.14.y 8ea4f73cfa7e 8cac236e .config log report syz C KASAN: use-after-free Read in rdma_listen
ci2-linux-4-14 2021/02/11 07:17 linux-4.14.y 2c8a3fceddf0 a52ee10a .config log report syz C KASAN: use-after-free Read in rdma_listen
ci2-linux-4-14 2020/10/29 16:15 linux-4.14.y 2b7915014161 f24824d3 .config log report syz C
ci2-linux-4-14 2020/10/08 08:40 linux-4.14.y cbfa1702aaf6 1880b4a9 .config log report syz C
ci2-linux-4-14 2020/09/10 07:57 linux-4.14.y 458a534cac0c ac7ca78e .config log report syz C
ci2-linux-4-14 2020/09/10 02:53 linux-4.14.y 458a534cac0c ac7ca78e .config log report syz C
ci2-linux-4-14 2019/06/10 00:11 linux-4.14.y e6a95d8851f1 0159583c .config log report syz C
ci2-linux-4-14 2021/04/14 13:07 linux-4.14.y 958e517f4e16 3134b37f .config log report syz KASAN: use-after-free Read in rdma_listen
ci2-linux-4-14 2021/04/06 03:01 linux-4.14.y bd634aa64163 6a81331a .config log report syz KASAN: use-after-free Read in rdma_listen
ci2-linux-4-14 2021/03/05 13:02 linux-4.14.y 397a88b2cc86 9d751681 .config log report syz KASAN: use-after-free Read in rdma_listen
ci2-linux-4-14 2020/07/30 21:44 linux-4.14.y e5a54aa2d312 b0947553 .config log report syz
ci2-linux-4-14 2020/05/29 16:11 linux-4.14.y 4f68020fef1c bed08304 .config log report syz
ci2-linux-4-14 2020/04/23 13:48 linux-4.14.y c10b57a567e4 2e44d63e .config log report syz
ci2-linux-4-14 2020/04/22 20:52 linux-4.14.y c10b57a567e4 2e44d63e .config log report syz
ci2-linux-4-14 2020/04/19 14:26 linux-4.14.y c10b57a567e4 6dfd45e1 .config log report syz
ci2-linux-4-14 2020/04/18 06:03 linux-4.14.y c10b57a567e4 435c6d53 .config log report syz
ci2-linux-4-14 2020/04/17 13:56 linux-4.14.y c10b57a567e4 18397578 .config log report syz
ci2-linux-4-14 2020/04/17 13:28 linux-4.14.y c10b57a567e4 18397578 .config log report syz
ci2-linux-4-14 2020/04/17 02:13 linux-4.14.y c10b57a567e4 c743fcb3 .config log report syz
ci2-linux-4-14 2020/04/16 22:55 linux-4.14.y c10b57a567e4 c743fcb3 .config log report syz
ci2-linux-4-14 2020/04/16 12:09 linux-4.14.y c10b57a567e4 c743fcb3 .config log report syz
ci2-linux-4-14 2020/04/15 07:25 linux-4.14.y c10b57a567e4 3f3c5574 .config log report syz
ci2-linux-4-14 2020/04/15 01:07 linux-4.14.y c10b57a567e4 3f3c5574 .config log report syz
ci2-linux-4-14 2020/04/14 15:24 linux-4.14.y c10b57a567e4 3f3c5574 .config log report syz
ci2-linux-4-14 2020/04/13 16:39 linux-4.14.y c10b57a567e4 17a986e5 .config log report syz
ci2-linux-4-14 2020/04/12 03:19 linux-4.14.y 4520f06b03ae a8c6a3f8 .config log report syz
ci2-linux-4-14 2020/04/11 14:08 linux-4.14.y 4520f06b03ae a8c6a3f8 .config log report syz
ci2-linux-4-14 2022/09/29 11:17 linux-4.14.y 9d5c0b3a8e1a a41a2080 .config log report info KASAN: use-after-free Read in rdma_listen
ci2-linux-4-14 2022/09/27 14:21 linux-4.14.y 4edbf74132a4 10323ddf .config log report info KASAN: use-after-free Read in rdma_listen
ci2-linux-4-14 2022/09/25 10:22 linux-4.14.y 4edbf74132a4 0042f2b4 .config log report info KASAN: use-after-free Read in rdma_listen
ci2-linux-4-14 2022/09/24 14:54 linux-4.14.y 4edbf74132a4 0042f2b4 .config log report info KASAN: use-after-free Read in rdma_listen
ci2-linux-4-14 2022/09/24 11:46 linux-4.14.y 4edbf74132a4 0042f2b4 .config log report info KASAN: use-after-free Read in rdma_listen
ci2-linux-4-14 2022/09/23 11:55 linux-4.14.y 4edbf74132a4 0042f2b4 .config log report info KASAN: use-after-free Read in rdma_listen
ci2-linux-4-14 2022/09/21 03:35 linux-4.14.y 4edbf74132a4 c4b8ccfd .config log report info KASAN: use-after-free Read in rdma_listen
ci2-linux-4-14 2022/09/19 06:34 linux-4.14.y 5df8b4735177 dd9a85ff .config log report info KASAN: use-after-free Read in rdma_listen
ci2-linux-4-14 2022/09/19 01:12 linux-4.14.y 5df8b4735177 dd9a85ff .config log report info KASAN: use-after-free Read in rdma_listen
ci2-linux-4-14 2022/09/17 16:16 linux-4.14.y 5df8b4735177 dd9a85ff .config log report info KASAN: use-after-free Read in rdma_listen
ci2-linux-4-14 2022/09/17 00:20 linux-4.14.y 5df8b4735177 dd9a85ff .config log report info KASAN: use-after-free Read in rdma_listen
ci2-linux-4-14 2022/09/16 22:38 linux-4.14.y 5df8b4735177 dd9a85ff .config log report info KASAN: use-after-free Read in rdma_listen
ci2-linux-4-14 2022/09/16 21:37 linux-4.14.y 5df8b4735177 dd9a85ff .config log report info KASAN: use-after-free Read in rdma_listen
ci2-linux-4-14 2022/09/15 20:52 linux-4.14.y 5df8b4735177 dd9a85ff .config log report info KASAN: use-after-free Read in rdma_listen
ci2-linux-4-14 2022/09/15 02:54 linux-4.14.y 65640c873dcf b884348d .config log report info KASAN: use-after-free Read in rdma_listen
ci2-linux-4-14 2022/09/12 15:09 linux-4.14.y 65640c873dcf 356d8217 .config log report info KASAN: use-after-free Read in rdma_listen
ci2-linux-4-14 2022/09/11 04:11 linux-4.14.y 65640c873dcf 356d8217 .config log report info KASAN: use-after-free Read in rdma_listen
ci2-linux-4-14 2022/09/11 03:09 linux-4.14.y 65640c873dcf 356d8217 .config log report info KASAN: use-after-free Read in rdma_listen
ci2-linux-4-14 2022/09/10 20:50 linux-4.14.y 65640c873dcf 356d8217 .config log report info KASAN: use-after-free Read in rdma_listen
ci2-linux-4-14 2022/09/10 17:18 linux-4.14.y 65640c873dcf 356d8217 .config log report info KASAN: use-after-free Read in rdma_listen
ci2-linux-4-14 2022/09/10 14:28 linux-4.14.y 65640c873dcf 356d8217 .config log report info KASAN: use-after-free Read in rdma_listen
ci2-linux-4-14 2022/09/09 19:38 linux-4.14.y 65640c873dcf 90058bdc .config log report info KASAN: use-after-free Read in rdma_listen
ci2-linux-4-14 2022/09/09 09:02 linux-4.14.y 65640c873dcf f3027468 .config log report info KASAN: use-after-free Read in rdma_listen
ci2-linux-4-14 2022/09/04 21:18 linux-4.14.y e548869f356f 28811d0a .config log report info KASAN: use-after-free Read in rdma_listen
ci2-linux-4-14 2022/09/04 17:06 linux-4.14.y e548869f356f 28811d0a .config log report info KASAN: use-after-free Read in rdma_listen
ci2-linux-4-14 2022/09/04 11:22 linux-4.14.y e548869f356f 28811d0a .config log report info KASAN: use-after-free Read in rdma_listen
ci2-linux-4-14 2022/09/04 08:48 linux-4.14.y e548869f356f 28811d0a .config log report info KASAN: use-after-free Read in rdma_listen
ci2-linux-4-14 2022/09/04 00:33 linux-4.14.y e548869f356f 28811d0a .config log report info KASAN: use-after-free Read in rdma_listen
ci2-linux-4-14 2022/08/30 19:57 linux-4.14.y e548869f356f 4a380809 .config log report info KASAN: use-after-free Read in rdma_listen
ci2-linux-4-14 2022/08/29 05:38 linux-4.14.y e548869f356f 07177916 .config log report info KASAN: use-after-free Read in rdma_listen
ci2-linux-4-14 2022/08/29 01:11 linux-4.14.y e548869f356f 07177916 .config log report info KASAN: use-after-free Read in rdma_listen
ci2-linux-4-14 2022/08/28 11:10 linux-4.14.y e548869f356f 07177916 .config log report info KASAN: use-after-free Read in rdma_listen
ci2-linux-4-14 2022/08/24 03:27 linux-4.14.y b641242202ed cea8b0f7 .config log report info KASAN: use-after-free Read in rdma_listen
ci2-linux-4-14 2022/08/22 13:24 linux-4.14.y b641242202ed 26a13b38 .config log report info KASAN: use-after-free Read in rdma_listen
ci2-linux-4-14 2022/08/22 03:20 linux-4.14.y b641242202ed 26a13b38 .config log report info KASAN: use-after-free Read in rdma_listen
ci2-linux-4-14 2022/08/22 00:22 linux-4.14.y b641242202ed 26a13b38 .config log report info KASAN: use-after-free Read in rdma_listen
ci2-linux-4-14 2022/08/21 10:37 linux-4.14.y b641242202ed 26a13b38 .config log report info KASAN: use-after-free Read in rdma_listen
ci2-linux-4-14 2022/08/18 17:49 linux-4.14.y b641242202ed d58e263f .config log report info KASAN: use-after-free Read in rdma_listen
ci2-linux-4-14 2022/08/15 16:37 linux-4.14.y b641242202ed 8dfcaa3d .config log report info KASAN: use-after-free Read in rdma_listen
ci2-linux-4-14 2022/08/15 00:23 linux-4.14.y b641242202ed 8dfcaa3d .config log report info KASAN: use-after-free Read in rdma_listen
ci2-linux-4-14 2022/08/14 11:16 linux-4.14.y b641242202ed 8dfcaa3d .config log report info KASAN: use-after-free Read in rdma_listen
ci2-linux-4-14 2022/08/13 16:25 linux-4.14.y b641242202ed 8dfcaa3d .config log report info KASAN: use-after-free Read in rdma_listen
ci2-linux-4-14 2022/08/13 14:03 linux-4.14.y b641242202ed 8dfcaa3d .config log report info KASAN: use-after-free Read in rdma_listen
ci2-linux-4-14 2022/08/13 03:54 linux-4.14.y b641242202ed 8dfcaa3d .config log report info KASAN: use-after-free Read in rdma_listen
ci2-linux-4-14 2022/08/11 20:37 linux-4.14.y b641242202ed 787ed7e0 .config log report info KASAN: use-after-free Read in rdma_listen
ci2-linux-4-14 2022/08/11 05:55 linux-4.14.y b641242202ed a6201f11 .config log report info KASAN: use-after-free Read in rdma_listen
ci2-linux-4-14 2021/01/17 00:22 linux-4.14.y f79dc86058bc 65a7a854 .config log report info
* Struck through repros no longer work on HEAD.