syzbot


KASAN: use-after-free Read in addr_resolve

Status: auto-closed as invalid on 2019/10/25 18:39
Subsystems: rdma
[Documentation on labels]
Reported-by: syzbot+bd034f3fdc0402e942ed@syzkaller.appspotmail.com
First crash: 1861d, last: 1763d
Discussions (11)
Title Replies (including bot) Last reply
[PATCH 4.19 00/54] 4.19.115-rc1 review 70 (70) 2020/05/27 20:33
[PATCH AUTOSEL 5.4 001/108] net: wan: wanxl: use allow to pass CROSS_COMPILE_M68k for rebuilding firmware 111 (111) 2020/04/17 17:18
[PATCH AUTOSEL 5.6 001/149] net: hns3: drop the WQ_MEM_RECLAIM flag when allocating WQ 152 (152) 2020/04/17 17:06
[PATCH 5.6 00/38] 5.6.4-rc1 review 44 (44) 2020/04/14 10:36
[PATCH 5.5 00/44] 5.5.17-rc1 review 48 (48) 2020/04/14 10:36
[PATCH 5.4 00/41] 5.4.32-rc1 review 45 (45) 2020/04/14 10:36
[PATCH AUTOSEL 5.5 001/121] net: wan: wanxl: use allow to pass CROSS_COMPILE_M68k for rebuilding firmware 122 (122) 2020/04/12 01:16
[PATCH AUTOSEL 4.19 01/66] net: wan: wanxl: use allow to pass CROSS_COMPILE_M68k for rebuilding firmware 67 (67) 2020/04/12 01:16
Reminder: 11 open syzbot bugs in RDMA subsystem 1 (1) 2019/07/24 01:48
Reminder: 11 open syzbot bugs in RDMA subsystem 1 (1) 2019/06/25 05:48
KASAN: use-after-free Read in addr_resolve 0 (1) 2019/03/22 08:11

Sample crash report:
==================================================================
BUG: KASAN: use-after-free in addr_resolve+0x14fa/0x1730 drivers/infiniband/core/addr.c:562
Read of size 8 at addr ffff88809ffbeb10 by task kworker/u4:4/999

CPU: 1 PID: 999 Comm: kworker/u4:4 Not tainted 5.2.0-rc6+ #60
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Workqueue: ib_addr process_one_req
Call Trace:
 __dump_stack lib/dump_stack.c:77 [inline]
 dump_stack+0x172/0x1f0 lib/dump_stack.c:113
 print_address_description.cold+0x7c/0x20d mm/kasan/report.c:188
 __kasan_report.cold+0x1b/0x40 mm/kasan/report.c:317
 kasan_report+0x12/0x20 mm/kasan/common.c:614
 __asan_report_load8_noabort+0x14/0x20 mm/kasan/generic_report.c:132
 addr_resolve+0x14fa/0x1730 drivers/infiniband/core/addr.c:562
 process_one_req+0x31c/0x680 drivers/infiniband/core/addr.c:629
 process_one_work+0x989/0x1790 kernel/workqueue.c:2269
 worker_thread+0x98/0xe40 kernel/workqueue.c:2415
 kthread+0x354/0x420 kernel/kthread.c:255
 ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:352

Allocated by task 12197:
 save_stack+0x23/0x90 mm/kasan/common.c:71
 set_track mm/kasan/common.c:79 [inline]
 __kasan_kmalloc mm/kasan/common.c:489 [inline]
 __kasan_kmalloc.constprop.0+0xcf/0xe0 mm/kasan/common.c:462
 kasan_kmalloc+0x9/0x10 mm/kasan/common.c:503
 kmem_cache_alloc_trace+0x151/0x750 mm/slab.c:3555
 kmalloc include/linux/slab.h:547 [inline]
 kzalloc include/linux/slab.h:742 [inline]
 __rdma_create_id+0x5f/0x4e0 drivers/infiniband/core/cma.c:882
 ucma_create_id+0x1de/0x640 drivers/infiniband/core/ucma.c:506
 ucma_write+0x2d7/0x3c0 drivers/infiniband/core/ucma.c:1696
 __vfs_write+0x8a/0x110 fs/read_write.c:494
 vfs_write+0x20c/0x580 fs/read_write.c:558
 ksys_write+0x220/0x290 fs/read_write.c:611
 __do_sys_write fs/read_write.c:623 [inline]
 __se_sys_write fs/read_write.c:620 [inline]
 __x64_sys_write+0x73/0xb0 fs/read_write.c:620
 do_syscall_64+0xfd/0x680 arch/x86/entry/common.c:301
 entry_SYSCALL_64_after_hwframe+0x49/0xbe

Freed by task 12196:
 save_stack+0x23/0x90 mm/kasan/common.c:71
 set_track mm/kasan/common.c:79 [inline]
 __kasan_slab_free+0x102/0x150 mm/kasan/common.c:451
 kasan_slab_free+0xe/0x10 mm/kasan/common.c:459
 __cache_free mm/slab.c:3432 [inline]
 kfree+0xcf/0x220 mm/slab.c:3755
 rdma_destroy_id+0x719/0xaa0 drivers/infiniband/core/cma.c:1877
 ucma_close+0x115/0x320 drivers/infiniband/core/ucma.c:1777
 __fput+0x2ff/0x890 fs/file_table.c:280
 ____fput+0x16/0x20 fs/file_table.c:313
 task_work_run+0x145/0x1c0 kernel/task_work.c:113
 tracehook_notify_resume include/linux/tracehook.h:185 [inline]
 exit_to_usermode_loop+0x273/0x2c0 arch/x86/entry/common.c:168
 prepare_exit_to_usermode arch/x86/entry/common.c:199 [inline]
 syscall_return_slowpath arch/x86/entry/common.c:279 [inline]
 do_syscall_64+0x58e/0x680 arch/x86/entry/common.c:304
 entry_SYSCALL_64_after_hwframe+0x49/0xbe

The buggy address belongs to the object at ffff88809ffbe980
 which belongs to the cache kmalloc-2k of size 2048
The buggy address is located 400 bytes inside of
 2048-byte region [ffff88809ffbe980, ffff88809ffbf180)
The buggy address belongs to the page:
page:ffffea00027fef80 refcount:1 mapcount:0 mapping:ffff8880aa400c40 index:0x0 compound_mapcount: 0
flags: 0x1fffc0000010200(slab|head)
raw: 01fffc0000010200 ffffea0002502f08 ffffea0002663288 ffff8880aa400c40
raw: 0000000000000000 ffff88809ffbe100 0000000100000003 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
 ffff88809ffbea00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff88809ffbea80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff88809ffbeb00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
                         ^
 ffff88809ffbeb80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff88809ffbec00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================

Crashes (2):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2019/06/27 18:39 upstream 249155c20f9b 7509bf36 .config console log report ci-upstream-kasan-gce
2019/03/21 23:37 upstream 54c490164523 dce6e62f .config console log report ci-upstream-kasan-gce-smack-root
* Struck through repros no longer work on HEAD.