syzbot


KASAN: use-after-free Read in rxe_query_port

Status: closed as dup on 2020/03/10 14:52
Subsystems: rdma
[Documentation on labels]
Reported-by: syzbot+e11efb687f5ab7f01f3d@syzkaller.appspotmail.com
First crash: 1764d, last: 1729d
Duplicate of
Title Repro Cause bisect Fix bisect Count Last Reported
WARNING: ODEBUG bug in smc_ib_remove_dev net s390 52 1746d 1760d
Discussions (1)
Title Replies (including bot) Last reply
KASAN: use-after-free Read in rxe_query_port 6 (7) 2020/03/10 14:52

Sample crash report:
==================================================================
BUG: KASAN: use-after-free in rxe_query_port+0x27d/0x2d0 drivers/infiniband/sw/rxe/rxe_verbs.c:71
Read of size 4 at addr ffff888092547020 by task kworker/1:4/2685

CPU: 1 PID: 2685 Comm: kworker/1:4 Not tainted 5.6.0-rc5-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Workqueue: events smc_ib_port_event_work
Call Trace:
 __dump_stack lib/dump_stack.c:77 [inline]
 dump_stack+0x188/0x20d lib/dump_stack.c:118
 print_address_description.constprop.0.cold+0xd3/0x315 mm/kasan/report.c:374
 __kasan_report.cold+0x1a/0x32 mm/kasan/report.c:506
 kasan_report+0xe/0x20 mm/kasan/common.c:641
 rxe_query_port+0x27d/0x2d0 drivers/infiniband/sw/rxe/rxe_verbs.c:71
 __ib_query_port drivers/infiniband/core/device.c:2022 [inline]
 ib_query_port drivers/infiniband/core/device.c:2057 [inline]
 ib_query_port+0x523/0xac0 drivers/infiniband/core/device.c:2047
 smc_ib_remember_port_attr net/smc/smc_ib.c:219 [inline]
 smc_ib_port_event_work+0x127/0x360 net/smc/smc_ib.c:244
 process_one_work+0x94b/0x1690 kernel/workqueue.c:2266
 worker_thread+0x96/0xe20 kernel/workqueue.c:2412
 kthread+0x357/0x430 kernel/kthread.c:255
 ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:352

Allocated by task 13512:
 save_stack+0x1b/0x80 mm/kasan/common.c:72
 set_track mm/kasan/common.c:80 [inline]
 __kasan_kmalloc mm/kasan/common.c:515 [inline]
 __kasan_kmalloc.constprop.0+0xbf/0xd0 mm/kasan/common.c:488
 kmem_cache_alloc_trace+0x153/0x7d0 mm/slab.c:3551
 kmalloc include/linux/slab.h:555 [inline]
 kzalloc include/linux/slab.h:669 [inline]
 smc_ib_add_dev net/smc/smc_ib.c:541 [inline]
 smc_ib_add_dev+0xa4/0x590 net/smc/smc_ib.c:532
 add_client_context+0x3b4/0x520 drivers/infiniband/core/device.c:681
 enable_device_and_get+0x1cd/0x3b0 drivers/infiniband/core/device.c:1316
 ib_register_device drivers/infiniband/core/device.c:1382 [inline]
 ib_register_device+0xa12/0xda0 drivers/infiniband/core/device.c:1343
 rxe_register_device+0x4fa/0x621 drivers/infiniband/sw/rxe/rxe_verbs.c:1231
 rxe_add+0x1227/0x1664 drivers/infiniband/sw/rxe/rxe.c:302
 rxe_net_add+0x8c/0xe0 drivers/infiniband/sw/rxe/rxe_net.c:539
 rxe_newlink+0x34/0x90 drivers/infiniband/sw/rxe/rxe.c:318
 nldev_newlink+0x27f/0x400 drivers/infiniband/core/nldev.c:1538
 rdma_nl_rcv_msg drivers/infiniband/core/netlink.c:195 [inline]
 rdma_nl_rcv_skb drivers/infiniband/core/netlink.c:239 [inline]
 rdma_nl_rcv+0x586/0x900 drivers/infiniband/core/netlink.c:259
 netlink_unicast_kernel net/netlink/af_netlink.c:1303 [inline]
 netlink_unicast+0x537/0x740 net/netlink/af_netlink.c:1329
 netlink_sendmsg+0x882/0xe10 net/netlink/af_netlink.c:1918
 sock_sendmsg_nosec net/socket.c:652 [inline]
 sock_sendmsg+0xcf/0x120 net/socket.c:672
 ____sys_sendmsg+0x6b9/0x7d0 net/socket.c:2343
 ___sys_sendmsg+0x100/0x170 net/socket.c:2397
 __sys_sendmsg+0xec/0x1b0 net/socket.c:2430
 do_syscall_64+0xf6/0x7d0 arch/x86/entry/common.c:294
 entry_SYSCALL_64_after_hwframe+0x49/0xbe

Freed by task 2711:
 save_stack+0x1b/0x80 mm/kasan/common.c:72
 set_track mm/kasan/common.c:80 [inline]
 kasan_set_free_info mm/kasan/common.c:337 [inline]
 __kasan_slab_free+0xf7/0x140 mm/kasan/common.c:476
 __cache_free mm/slab.c:3426 [inline]
 kfree+0x109/0x2b0 mm/slab.c:3757
 smc_ib_remove_dev+0x1e3/0x310 net/smc/smc_ib.c:585
 remove_client_context+0xbe/0x110 drivers/infiniband/core/device.c:724
 disable_device+0x13b/0x230 drivers/infiniband/core/device.c:1268
 __ib_unregister_device+0x91/0x180 drivers/infiniband/core/device.c:1435
 ib_unregister_work+0x15/0x30 drivers/infiniband/core/device.c:1545
 process_one_work+0x94b/0x1690 kernel/workqueue.c:2266
 worker_thread+0x96/0xe20 kernel/workqueue.c:2412
 kthread+0x357/0x430 kernel/kthread.c:255
 ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:352

The buggy address belongs to the object at ffff888092547000
 which belongs to the cache kmalloc-512 of size 512
The buggy address is located 32 bytes inside of
 512-byte region [ffff888092547000, ffff888092547200)
The buggy address belongs to the page:
page:ffffea00024951c0 refcount:1 mapcount:0 mapping:ffff8880aa000a80 index:0xffff888092547800
flags: 0xfffe0000000200(slab)
raw: 00fffe0000000200 ffffea00028a0a48 ffffea00027b6788 ffff8880aa000a80
raw: ffff888092547800 ffff888092547000 0000000100000003 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
 ffff888092546f00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 ffff888092546f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
>ffff888092547000: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
                               ^
 ffff888092547080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff888092547100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================

Crashes (71):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2020/03/13 02:11 upstream 3cc6e2c599cd d850e9d0 .config console log report ci-upstream-kasan-gce-selinux-root
2020/03/12 23:49 upstream 3cc6e2c599cd d850e9d0 .config console log report ci-upstream-kasan-gce-selinux-root
2020/03/11 18:01 upstream f35111a94654 e7caca8e .config console log report ci-upstream-kasan-gce-root
2020/03/10 23:58 upstream e94148454103 35f53e45 .config console log report ci-upstream-kasan-gce-root
2020/03/10 13:17 upstream 30bb5572ce7a 35f53e45 .config console log report ci-upstream-kasan-gce-selinux-root
2020/03/10 02:23 upstream 30bb5572ce7a 35f53e45 .config console log report ci-upstream-kasan-gce-root
2020/03/09 19:55 upstream 2c523b344dfa 35f53e45 .config console log report ci-upstream-kasan-gce-smack-root
2020/03/09 01:24 upstream 61a09258f2e5 2e9971bb .config console log report ci-upstream-kasan-gce-root
2020/03/08 18:17 upstream 61a09258f2e5 2e9971bb .config console log report ci-upstream-kasan-gce-selinux-root
2020/03/08 03:50 upstream c20037652700 2e9971bb .config console log report ci-upstream-kasan-gce-root
2020/03/07 18:29 upstream 63849c8f4107 2e9971bb .config console log report ci-upstream-kasan-gce-smack-root
2020/03/06 18:04 upstream 63623fd44972 c88c7b75 .config console log report ci-upstream-kasan-gce-root
2020/03/06 15:00 upstream 63623fd44972 c88c7b75 .config console log report ci-upstream-kasan-gce-selinux-root
2020/03/06 07:40 upstream 63623fd44972 c88c7b75 .config console log report ci-upstream-kasan-gce-smack-root
2020/03/05 20:42 upstream 63623fd44972 c88c7b75 .config console log report ci-upstream-kasan-gce-smack-root
2020/03/05 15:51 upstream 63623fd44972 c88c7b75 .config console log report ci-upstream-kasan-gce-smack-root
2020/03/04 22:24 upstream 63623fd44972 c88c7b75 .config console log report ci-upstream-kasan-gce-selinux-root
2020/03/03 20:38 upstream 63623fd44972 c88c7b75 .config console log report ci-upstream-kasan-gce-smack-root
2020/03/03 06:16 upstream 63623fd44972 c88c7b75 .config console log report ci-upstream-kasan-gce-root
2020/02/29 11:00 upstream f8788d86ab28 59b57593 .config console log report ci-upstream-kasan-gce-root
2020/02/28 23:20 upstream f8788d86ab28 59b57593 .config console log report ci-upstream-kasan-gce-selinux-root
2020/02/27 14:44 upstream f8788d86ab28 59b57593 .config console log report ci-upstream-kasan-gce-smack-root
2020/03/10 11:39 net-old 236205942749 35f53e45 .config console log report ci-upstream-net-this-kasan-gce
2020/03/05 09:19 net-old 3614d05b5e6b c88c7b75 .config console log report ci-upstream-net-this-kasan-gce
2020/03/04 21:11 net-old 3614d05b5e6b c88c7b75 .config console log report ci-upstream-net-this-kasan-gce
2020/03/04 19:18 net-old 3614d05b5e6b c88c7b75 .config console log report ci-upstream-net-this-kasan-gce
2020/03/04 11:00 net-old 3614d05b5e6b c88c7b75 .config console log report ci-upstream-net-this-kasan-gce
2020/03/04 03:07 net-old 3614d05b5e6b c88c7b75 .config console log report ci-upstream-net-this-kasan-gce
2020/03/04 00:33 net-old 3614d05b5e6b c88c7b75 .config console log report ci-upstream-net-this-kasan-gce
2020/03/03 20:04 net-old 3614d05b5e6b c88c7b75 .config console log report ci-upstream-net-this-kasan-gce
2020/03/02 14:49 net-old 3614d05b5e6b c88c7b75 .config console log report ci-upstream-net-this-kasan-gce
2020/03/02 00:17 net-old 3614d05b5e6b c88c7b75 .config console log report ci-upstream-net-this-kasan-gce
2020/03/01 23:11 net-old 3614d05b5e6b c88c7b75 .config console log report ci-upstream-net-this-kasan-gce
2020/03/12 09:27 net-next-old e6e0f093d978 d850e9d0 .config console log report ci-upstream-net-kasan-gce
2020/03/06 03:26 net-next-old 3b3e808cd883 c88c7b75 .config console log report ci-upstream-net-kasan-gce
2020/03/06 00:48 net-next-old 3b3e808cd883 c88c7b75 .config console log report ci-upstream-net-kasan-gce
2020/03/05 06:57 net-next-old 3b3e808cd883 c88c7b75 .config console log report ci-upstream-net-kasan-gce
2020/03/05 05:37 net-next-old 3b3e808cd883 c88c7b75 .config console log report ci-upstream-net-kasan-gce
2020/03/05 03:56 net-next-old 3b3e808cd883 c88c7b75 .config console log report ci-upstream-net-kasan-gce
2020/03/04 16:46 net-next-old 3b3e808cd883 c88c7b75 .config console log report ci-upstream-net-kasan-gce
2020/03/04 15:22 net-next-old 3b3e808cd883 c88c7b75 .config console log report ci-upstream-net-kasan-gce
2020/03/04 13:49 net-next-old 3b3e808cd883 c88c7b75 .config console log report ci-upstream-net-kasan-gce
2020/03/04 13:28 net-next-old 3b3e808cd883 c88c7b75 .config console log report ci-upstream-net-kasan-gce
2020/03/04 13:15 net-next-old 3b3e808cd883 c88c7b75 .config console log report ci-upstream-net-kasan-gce
2020/03/04 06:57 net-next-old 3b3e808cd883 c88c7b75 .config console log report ci-upstream-net-kasan-gce
2020/03/04 06:39 net-next-old 3b3e808cd883 c88c7b75 .config console log report ci-upstream-net-kasan-gce
2020/03/04 04:54 net-next-old 3b3e808cd883 c88c7b75 .config console log report ci-upstream-net-kasan-gce
2020/03/03 19:58 net-next-old 3b3e808cd883 c88c7b75 .config console log report ci-upstream-net-kasan-gce
2020/03/03 14:29 net-next-old 3b3e808cd883 c88c7b75 .config console log report ci-upstream-net-kasan-gce
2020/03/03 08:49 net-next-old 3b3e808cd883 c88c7b75 .config console log report ci-upstream-net-kasan-gce
2020/03/03 04:58 net-next-old 3b3e808cd883 c88c7b75 .config console log report ci-upstream-net-kasan-gce
2020/03/02 09:06 net-next-old 3b3e808cd883 c88c7b75 .config console log report ci-upstream-net-kasan-gce
2020/03/02 06:39 net-next-old 3b3e808cd883 c88c7b75 .config console log report ci-upstream-net-kasan-gce
2020/02/27 14:49 net-next-old c3e042f54107 59b57593 .config console log report ci-upstream-net-kasan-gce
2020/04/02 03:58 linux-next 770fbb32d34e a34e2c33 .config console log report ci-upstream-linux-next-kasan-gce-root
2020/03/30 09:54 linux-next 770fbb32d34e 05736b29 .config console log report ci-upstream-linux-next-kasan-gce-root
2020/03/25 02:32 linux-next 770fbb32d34e 68660b21 .config console log report ci-upstream-linux-next-kasan-gce-root
2020/03/24 00:48 linux-next 770fbb32d34e 84f999d6 .config console log report ci-upstream-linux-next-kasan-gce-root
2020/03/09 21:15 linux-next 770fbb32d34e 35f53e45 .config console log report ci-upstream-linux-next-kasan-gce-root
2020/03/08 23:16 linux-next 770fbb32d34e 2e9971bb .config console log report ci-upstream-linux-next-kasan-gce-root
2020/03/06 23:57 linux-next 770fbb32d34e fd2a5f28 .config console log report ci-upstream-linux-next-kasan-gce-root
2020/03/06 13:30 linux-next c99b17ac0399 c88c7b75 .config console log report ci-upstream-linux-next-kasan-gce-root
2020/03/05 02:08 linux-next c99b17ac0399 c88c7b75 .config console log report ci-upstream-linux-next-kasan-gce-root
2020/03/03 16:19 linux-next c99b17ac0399 c88c7b75 .config console log report ci-upstream-linux-next-kasan-gce-root
2020/02/29 12:22 linux-next bdc5461b23ca 59b57593 .config console log report ci-upstream-linux-next-kasan-gce-root
2020/02/29 04:01 linux-next bdc5461b23ca 59b57593 .config console log report ci-upstream-linux-next-kasan-gce-root
* Struck through repros no longer work on HEAD.