syzbot


KASAN: use-after-free Read in netdevice_event_work_handler

Status: upstream: reported C repro on 2020/09/05 14:15
Reported-by: syzbot+f65ada862fcd638b0ca5@syzkaller.appspotmail.com
First crash: 1540d, last: 628d
Similar bugs (3)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
linux-4.14 KASAN: use-after-free Read in netdevice_event_work_handler 1 1024d 1024d 0/1 auto-closed as invalid on 2022/06/03 04:22
upstream KASAN: use-after-free Read in netdevice_event_work_handler rdma C done unreliable 265 1271d 1597d 0/28 auto-obsoleted due to no activity on 2023/01/04 13:02
linux-4.14 KASAN: use-after-free Read in netdevice_event_work_handler (2) C 6 641d 893d 0/1 upstream: reported C repro on 2022/06/13 22:07

Sample crash report:
==================================================================
BUG: KASAN: use-after-free in dev_put include/linux/netdevice.h:3676 [inline]
BUG: KASAN: use-after-free in netdevice_event_work_handler+0x15b/0x1b0 drivers/infiniband/core/roce_gid_mgmt.c:626
Read of size 8 at addr ffff8880aa18a640 by task kworker/u4:6/9459

CPU: 1 PID: 9459 Comm: kworker/u4:6 Not tainted 4.19.211-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/22/2022
Workqueue: gid-cache-wq netdevice_event_work_handler
Call Trace:
 __dump_stack lib/dump_stack.c:77 [inline]
 dump_stack+0x1fc/0x2ef lib/dump_stack.c:118
 print_address_description.cold+0x54/0x219 mm/kasan/report.c:256
 kasan_report_error.cold+0x8a/0x1b9 mm/kasan/report.c:354
 kasan_report mm/kasan/report.c:412 [inline]
 __asan_report_load8_noabort+0x88/0x90 mm/kasan/report.c:433
 dev_put include/linux/netdevice.h:3676 [inline]
 netdevice_event_work_handler+0x15b/0x1b0 drivers/infiniband/core/roce_gid_mgmt.c:626
 process_one_work+0x864/0x1570 kernel/workqueue.c:2153
 worker_thread+0x64c/0x1130 kernel/workqueue.c:2296
 kthread+0x33f/0x460 kernel/kthread.c:259
 ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:415

Allocated by task 10662:
 __do_kmalloc_node mm/slab.c:3689 [inline]
 __kmalloc_node+0x4c/0x70 mm/slab.c:3696
 kmalloc_node include/linux/slab.h:557 [inline]
 kvmalloc_node+0x61/0xf0 mm/util.c:423
 kvmalloc include/linux/mm.h:577 [inline]
 kvzalloc include/linux/mm.h:585 [inline]
 alloc_netdev_mqs+0x97/0xd50 net/core/dev.c:9152
 rtnl_create_link+0x1d4/0xa40 net/core/rtnetlink.c:2869
 rtnl_newlink+0xf45/0x15c0 net/core/rtnetlink.c:3131
 rtnetlink_rcv_msg+0x453/0xb80 net/core/rtnetlink.c:4782
 netlink_rcv_skb+0x160/0x440 net/netlink/af_netlink.c:2463
 netlink_unicast_kernel net/netlink/af_netlink.c:1325 [inline]
 netlink_unicast+0x4d5/0x690 net/netlink/af_netlink.c:1351
 netlink_sendmsg+0x6c3/0xc50 net/netlink/af_netlink.c:1917
 sock_sendmsg_nosec net/socket.c:651 [inline]
 sock_sendmsg+0xc3/0x120 net/socket.c:661
 ___sys_sendmsg+0x7bb/0x8e0 net/socket.c:2227
 __sys_sendmsg net/socket.c:2265 [inline]
 __do_sys_sendmsg net/socket.c:2274 [inline]
 __se_sys_sendmsg net/socket.c:2272 [inline]
 __x64_sys_sendmsg+0x132/0x220 net/socket.c:2272
 do_syscall_64+0xf9/0x620 arch/x86/entry/common.c:293
 entry_SYSCALL_64_after_hwframe+0x49/0xbe

Freed by task 10662:
 __cache_free mm/slab.c:3503 [inline]
 kfree+0xcc/0x210 mm/slab.c:3822
 kvfree+0x59/0x60 mm/util.c:452
 device_release+0x76/0x210 drivers/base/core.c:1076
 kobject_cleanup lib/kobject.c:662 [inline]
 kobject_release lib/kobject.c:691 [inline]
 kref_put include/linux/kref.h:70 [inline]
 kobject_put+0x28b/0x5d0 lib/kobject.c:708
 put_device+0x1c/0x30 drivers/base/core.c:2267
 free_netdev+0x309/0x410 net/core/dev.c:9265
 rtnl_newlink+0x13a3/0x15c0 net/core/rtnetlink.c:3157
 rtnetlink_rcv_msg+0x453/0xb80 net/core/rtnetlink.c:4782
 netlink_rcv_skb+0x160/0x440 net/netlink/af_netlink.c:2463
 netlink_unicast_kernel net/netlink/af_netlink.c:1325 [inline]
 netlink_unicast+0x4d5/0x690 net/netlink/af_netlink.c:1351
 netlink_sendmsg+0x6c3/0xc50 net/netlink/af_netlink.c:1917
 sock_sendmsg_nosec net/socket.c:651 [inline]
 sock_sendmsg+0xc3/0x120 net/socket.c:661
 ___sys_sendmsg+0x7bb/0x8e0 net/socket.c:2227
 __sys_sendmsg net/socket.c:2265 [inline]
 __do_sys_sendmsg net/socket.c:2274 [inline]
 __se_sys_sendmsg net/socket.c:2272 [inline]
 __x64_sys_sendmsg+0x132/0x220 net/socket.c:2272
 do_syscall_64+0xf9/0x620 arch/x86/entry/common.c:293
 entry_SYSCALL_64_after_hwframe+0x49/0xbe

The buggy address belongs to the object at ffff8880aa18a100
 which belongs to the cache kmalloc-4096 of size 4096
The buggy address is located 1344 bytes inside of
 4096-byte region [ffff8880aa18a100, ffff8880aa18b100)
The buggy address belongs to the page:
page:ffffea0002a86280 count:1 mapcount:0 mapping:ffff88813bff0dc0 index:0x0 compound_mapcount: 0
flags: 0xfff00000008100(slab|head)
raw: 00fff00000008100 ffffea0002a99808 ffffea0002aaa808 ffff88813bff0dc0
raw: 0000000000000000 ffff8880aa18a100 0000000100000001 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
 ffff8880aa18a500: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff8880aa18a580: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff8880aa18a600: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
                                           ^
 ffff8880aa18a680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff8880aa18a700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================

Crashes (146):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2022/08/31 01:03 linux-4.19.y 3f8a27f9e27b 4a380809 .config console log report syz C [disk image] [vmlinux] ci2-linux-4-19 KASAN: use-after-free Read in netdevice_event_work_handler
2022/08/04 18:40 linux-4.19.y 3f8a27f9e27b 1c9013ac .config console log report syz ci2-linux-4-19 KASAN: use-after-free Read in netdevice_event_work_handler
2022/02/28 21:02 linux-4.19.y 3f8a27f9e27b 45a13a73 .config console log report syz ci2-linux-4-19 KASAN: use-after-free Read in netdevice_event_work_handler
2023/03/06 07:00 linux-4.19.y 3f8a27f9e27b f8902b57 .config console log report info [disk image] [vmlinux] ci2-linux-4-19 KASAN: use-after-free Read in netdevice_event_work_handler
2023/03/05 20:44 linux-4.19.y 3f8a27f9e27b f8902b57 .config console log report info [disk image] [vmlinux] ci2-linux-4-19 KASAN: use-after-free Read in netdevice_event_work_handler
2023/03/05 18:21 linux-4.19.y 3f8a27f9e27b f8902b57 .config console log report info [disk image] [vmlinux] ci2-linux-4-19 KASAN: use-after-free Read in netdevice_event_work_handler
2023/03/03 13:01 linux-4.19.y 3f8a27f9e27b f8902b57 .config console log report info [disk image] [vmlinux] ci2-linux-4-19 KASAN: use-after-free Read in netdevice_event_work_handler
2023/03/01 09:39 linux-4.19.y 3f8a27f9e27b ef65e6cb .config console log report info [disk image] [vmlinux] ci2-linux-4-19 KASAN: use-after-free Read in netdevice_event_work_handler
2023/02/25 20:18 linux-4.19.y 3f8a27f9e27b ee50e71c .config console log report info [disk image] [vmlinux] ci2-linux-4-19 KASAN: use-after-free Read in netdevice_event_work_handler
2023/02/24 11:46 linux-4.19.y 3f8a27f9e27b ee50e71c .config console log report info [disk image] [vmlinux] ci2-linux-4-19 KASAN: use-after-free Read in netdevice_event_work_handler
2023/02/21 16:43 linux-4.19.y 3f8a27f9e27b f949448d .config console log report info [disk image] [vmlinux] ci2-linux-4-19 KASAN: use-after-free Read in netdevice_event_work_handler
2023/02/18 21:20 linux-4.19.y 3f8a27f9e27b d02e9a70 .config console log report info [disk image] [vmlinux] ci2-linux-4-19 KASAN: use-after-free Read in netdevice_event_work_handler
2023/02/15 14:16 linux-4.19.y 3f8a27f9e27b 6be0f1f5 .config console log report info [disk image] [vmlinux] ci2-linux-4-19 KASAN: use-after-free Read in netdevice_event_work_handler
2023/02/14 18:49 linux-4.19.y 3f8a27f9e27b e62ba3c1 .config console log report info [disk image] [vmlinux] ci2-linux-4-19 KASAN: use-after-free Read in netdevice_event_work_handler
2023/02/14 02:56 linux-4.19.y 3f8a27f9e27b 93ae7e0a .config console log report info [disk image] [vmlinux] ci2-linux-4-19 KASAN: use-after-free Read in netdevice_event_work_handler
2023/02/12 13:35 linux-4.19.y 3f8a27f9e27b 93e26d60 .config console log report info [disk image] [vmlinux] ci2-linux-4-19 KASAN: use-after-free Read in netdevice_event_work_handler
2023/02/08 13:22 linux-4.19.y 3f8a27f9e27b abbb67b7 .config console log report info [disk image] [vmlinux] ci2-linux-4-19 KASAN: use-after-free Read in netdevice_event_work_handler
2023/02/05 00:40 linux-4.19.y 3f8a27f9e27b be607b78 .config console log report info [disk image] [vmlinux] ci2-linux-4-19 KASAN: use-after-free Read in netdevice_event_work_handler
2023/02/04 15:35 linux-4.19.y 3f8a27f9e27b be607b78 .config console log report info [disk image] [vmlinux] ci2-linux-4-19 KASAN: use-after-free Read in netdevice_event_work_handler
2023/01/30 12:34 linux-4.19.y 3f8a27f9e27b b68fb8d6 .config console log report info [disk image] [vmlinux] ci2-linux-4-19 KASAN: use-after-free Read in netdevice_event_work_handler
2023/01/24 15:54 linux-4.19.y 3f8a27f9e27b 9dfcf09c .config console log report info [disk image] [vmlinux] ci2-linux-4-19 KASAN: use-after-free Read in netdevice_event_work_handler
2023/01/23 00:57 linux-4.19.y 3f8a27f9e27b cc0f9968 .config console log report info [disk image] [vmlinux] ci2-linux-4-19 KASAN: use-after-free Read in netdevice_event_work_handler
2023/01/18 13:07 linux-4.19.y 3f8a27f9e27b 4620c2d9 .config console log report info [disk image] [vmlinux] ci2-linux-4-19 KASAN: use-after-free Read in netdevice_event_work_handler
2023/01/14 11:36 linux-4.19.y 3f8a27f9e27b a63719e7 .config console log report info [disk image] [vmlinux] ci2-linux-4-19 KASAN: use-after-free Read in netdevice_event_work_handler
2023/01/04 09:56 linux-4.19.y 3f8a27f9e27b 1dac8c7a .config console log report info [disk image] [vmlinux] ci2-linux-4-19 KASAN: use-after-free Read in netdevice_event_work_handler
2023/01/01 17:15 linux-4.19.y 3f8a27f9e27b ab32d508 .config console log report info [disk image] [vmlinux] ci2-linux-4-19 KASAN: use-after-free Read in netdevice_event_work_handler
2022/12/07 08:13 linux-4.19.y 3f8a27f9e27b d88f3abb .config console log report info [disk image] [vmlinux] ci2-linux-4-19 KASAN: use-after-free Read in netdevice_event_work_handler
2022/12/07 00:49 linux-4.19.y 3f8a27f9e27b d88f3abb .config console log report info [disk image] [vmlinux] ci2-linux-4-19 KASAN: use-after-free Read in netdevice_event_work_handler
2022/11/18 03:49 linux-4.19.y 3f8a27f9e27b 5bb70014 .config console log report info [disk image] [vmlinux] ci2-linux-4-19 KASAN: use-after-free Read in netdevice_event_work_handler
2022/11/07 19:19 linux-4.19.y 3f8a27f9e27b a779b11a .config console log report info [disk image] [vmlinux] ci2-linux-4-19 KASAN: use-after-free Read in netdevice_event_work_handler
2022/10/29 16:44 linux-4.19.y 3f8a27f9e27b 2a71366b .config console log report info [disk image] [vmlinux] ci2-linux-4-19 KASAN: use-after-free Read in netdevice_event_work_handler
2022/10/29 02:33 linux-4.19.y 3f8a27f9e27b 899d812a .config console log report info [disk image] [vmlinux] ci2-linux-4-19 KASAN: use-after-free Read in netdevice_event_work_handler
2022/10/27 23:53 linux-4.19.y 3f8a27f9e27b 5c716ff6 .config console log report info [disk image] [vmlinux] ci2-linux-4-19 KASAN: use-after-free Read in netdevice_event_work_handler
2022/10/22 19:18 linux-4.19.y 3f8a27f9e27b c0b80a55 .config console log report info [disk image] [vmlinux] ci2-linux-4-19 KASAN: use-after-free Read in netdevice_event_work_handler
2022/10/19 00:34 linux-4.19.y 3f8a27f9e27b b31320fc .config console log report info [disk image] [vmlinux] ci2-linux-4-19 KASAN: use-after-free Read in netdevice_event_work_handler
2022/10/17 05:28 linux-4.19.y 3f8a27f9e27b 67cb024c .config console log report info [disk image] [vmlinux] ci2-linux-4-19 KASAN: use-after-free Read in netdevice_event_work_handler
2022/10/14 22:48 linux-4.19.y 3f8a27f9e27b 67cb024c .config console log report info [disk image] [vmlinux] ci2-linux-4-19 KASAN: use-after-free Read in netdevice_event_work_handler
2022/10/12 08:07 linux-4.19.y 3f8a27f9e27b 02b6492e .config console log report info [disk image] [vmlinux] ci2-linux-4-19 KASAN: use-after-free Read in netdevice_event_work_handler
2022/10/02 01:53 linux-4.19.y 3f8a27f9e27b feb56351 .config console log report info [disk image] [vmlinux] ci2-linux-4-19 KASAN: use-after-free Read in netdevice_event_work_handler
2022/09/30 15:47 linux-4.19.y 3f8a27f9e27b 45fd7169 .config console log report info ci2-linux-4-19 KASAN: use-after-free Read in netdevice_event_work_handler
2022/09/27 23:12 linux-4.19.y 3f8a27f9e27b 10323ddf .config console log report info [disk image] [vmlinux] ci2-linux-4-19 KASAN: use-after-free Read in netdevice_event_work_handler
2022/09/27 21:32 linux-4.19.y 3f8a27f9e27b 10323ddf .config console log report info [disk image] [vmlinux] ci2-linux-4-19 KASAN: use-after-free Read in netdevice_event_work_handler
2022/09/27 06:12 linux-4.19.y 3f8a27f9e27b 10323ddf .config console log report info [disk image] [vmlinux] ci2-linux-4-19 KASAN: use-after-free Read in netdevice_event_work_handler
2022/09/26 20:48 linux-4.19.y 3f8a27f9e27b d59ba983 .config console log report info [disk image] [vmlinux] ci2-linux-4-19 KASAN: use-after-free Read in netdevice_event_work_handler
2022/09/24 02:21 linux-4.19.y 3f8a27f9e27b 0042f2b4 .config console log report info ci2-linux-4-19 KASAN: use-after-free Read in netdevice_event_work_handler
2022/09/22 15:50 linux-4.19.y 3f8a27f9e27b 0042f2b4 .config console log report info ci2-linux-4-19 KASAN: use-after-free Read in netdevice_event_work_handler
2022/09/22 13:44 linux-4.19.y 3f8a27f9e27b 60af5050 .config console log report info [disk image] [vmlinux] ci2-linux-4-19 KASAN: use-after-free Read in netdevice_event_work_handler
2022/09/18 01:12 linux-4.19.y 3f8a27f9e27b dd9a85ff .config console log report info [disk image] [vmlinux] ci2-linux-4-19 KASAN: use-after-free Read in netdevice_event_work_handler
2022/09/17 10:41 linux-4.19.y 3f8a27f9e27b dd9a85ff .config console log report info [disk image] [vmlinux] ci2-linux-4-19 KASAN: use-after-free Read in netdevice_event_work_handler
2022/09/15 03:09 linux-4.19.y 3f8a27f9e27b b884348d .config console log report info ci2-linux-4-19 KASAN: use-after-free Read in netdevice_event_work_handler
2020/12/14 07:08 linux-4.19.y 13d2ce42de8c b22a7ec3 .config console log report info ci2-linux-4-19
2020/09/05 14:14 linux-4.19.y c37da90efff5 abf9ba4f .config console log report ci2-linux-4-19
* Struck through repros no longer work on HEAD.