syzbot


KASAN: use-after-free Write in __linkwatch_run_queue

Status: fixed on 2020/09/16 22:51
Subsystems: net
[Documentation on labels]
Reported-by: syzbot+bbc3a11c4da63c1b74d6@syzkaller.appspotmail.com
Fix commit: c75d1d5248c0 bonding: check return value of register_netdevice() in bond_newlink()
First crash: 1603d, last: 1598d
Cause bisection: failed (error log, bisect log)
  
Discussions (6)
Title Replies (including bot) Last reply
[PATCH 5.7 000/179] 5.7.11-rc1 review 187 (187) 2020/07/29 08:22
[PATCH 4.19 00/86] 4.19.135-rc1 review 109 (109) 2020/07/28 21:18
[PATCH 5.4 000/138] 5.4.54-rc1 review 143 (143) 2020/07/28 18:23
[PATCH 4.14 00/64] 4.14.190-rc1 review 68 (68) 2020/07/28 18:22
[Patch net] bonding: check return value of register_netdevice() in bond_newlink() 2 (2) 2020/07/23 22:17
KASAN: use-after-free Write in __linkwatch_run_queue 1 (3) 2020/07/22 22:24
Last patch testing requests (1)
Created Duration User Patch Repo Result
2020/07/22 21:00 18m xiyou.wangcong@gmail.com https://github.com/congwang/linux.git net OK

Sample crash report:
==================================================================
BUG: KASAN: use-after-free in __list_splice include/linux/list.h:422 [inline]
BUG: KASAN: use-after-free in list_splice_init include/linux/list.h:464 [inline]
BUG: KASAN: use-after-free in __linkwatch_run_queue+0x58a/0x630 net/core/link_watch.c:200
Write of size 8 at addr ffff888094ccc578 by task kworker/0:1/12

CPU: 0 PID: 12 Comm: kworker/0:1 Not tainted 5.8.0-rc4-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Workqueue: events linkwatch_event
Call Trace:
 __dump_stack lib/dump_stack.c:77 [inline]
 dump_stack+0x18f/0x20d lib/dump_stack.c:118
 print_address_description.constprop.0.cold+0xae/0x436 mm/kasan/report.c:383
 __kasan_report mm/kasan/report.c:513 [inline]
 kasan_report.cold+0x1f/0x37 mm/kasan/report.c:530
 __list_splice include/linux/list.h:422 [inline]
 list_splice_init include/linux/list.h:464 [inline]
 __linkwatch_run_queue+0x58a/0x630 net/core/link_watch.c:200
 linkwatch_event+0x4a/0x60 net/core/link_watch.c:251
 process_one_work+0x94c/0x1670 kernel/workqueue.c:2269
 worker_thread+0x64c/0x1120 kernel/workqueue.c:2415
 kthread+0x3b5/0x4a0 kernel/kthread.c:291
 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:293

Allocated by task 6822:
 save_stack+0x1b/0x40 mm/kasan/common.c:48
 set_track mm/kasan/common.c:56 [inline]
 __kasan_kmalloc.constprop.0+0xc2/0xd0 mm/kasan/common.c:494
 kmalloc_node include/linux/slab.h:578 [inline]
 kvmalloc_node+0xb4/0xf0 mm/util.c:574
 kvmalloc include/linux/mm.h:753 [inline]
 kvzalloc include/linux/mm.h:761 [inline]
 alloc_netdev_mqs+0x97/0xdc0 net/core/dev.c:9938
 rtnl_create_link+0x219/0xad0 net/core/rtnetlink.c:3067
 __rtnl_newlink+0xfa0/0x1750 net/core/rtnetlink.c:3329
 rtnl_newlink+0x64/0xa0 net/core/rtnetlink.c:3398
 rtnetlink_rcv_msg+0x44e/0xad0 net/core/rtnetlink.c:5461
 netlink_rcv_skb+0x15a/0x430 net/netlink/af_netlink.c:2469
 netlink_unicast_kernel net/netlink/af_netlink.c:1303 [inline]
 netlink_unicast+0x533/0x7d0 net/netlink/af_netlink.c:1329
 netlink_sendmsg+0x856/0xd90 net/netlink/af_netlink.c:1918
 sock_sendmsg_nosec net/socket.c:652 [inline]
 sock_sendmsg+0xcf/0x120 net/socket.c:672
 ____sys_sendmsg+0x6e8/0x810 net/socket.c:2352
 ___sys_sendmsg+0xf3/0x170 net/socket.c:2406
 __sys_sendmsg+0xe5/0x1b0 net/socket.c:2439
 do_syscall_64+0x60/0xe0 arch/x86/entry/common.c:384
 entry_SYSCALL_64_after_hwframe+0x44/0xa9

Freed by task 6822:
 save_stack+0x1b/0x40 mm/kasan/common.c:48
 set_track mm/kasan/common.c:56 [inline]
 kasan_set_free_info mm/kasan/common.c:316 [inline]
 __kasan_slab_free+0xf5/0x140 mm/kasan/common.c:455
 __cache_free mm/slab.c:3426 [inline]
 kfree+0x103/0x2c0 mm/slab.c:3757
 kvfree+0x42/0x50 mm/util.c:603
 device_release+0x71/0x200 drivers/base/core.c:1559
 kobject_cleanup lib/kobject.c:693 [inline]
 kobject_release lib/kobject.c:722 [inline]
 kref_put include/linux/kref.h:65 [inline]
 kobject_put+0x1c0/0x270 lib/kobject.c:739
 put_device+0x1b/0x30 drivers/base/core.c:2779
 free_netdev+0x35d/0x480 net/core/dev.c:10054
 __rtnl_newlink+0x14d8/0x1750 net/core/rtnetlink.c:3354
 rtnl_newlink+0x64/0xa0 net/core/rtnetlink.c:3398
 rtnetlink_rcv_msg+0x44e/0xad0 net/core/rtnetlink.c:5461
 netlink_rcv_skb+0x15a/0x430 net/netlink/af_netlink.c:2469
 netlink_unicast_kernel net/netlink/af_netlink.c:1303 [inline]
 netlink_unicast+0x533/0x7d0 net/netlink/af_netlink.c:1329
 netlink_sendmsg+0x856/0xd90 net/netlink/af_netlink.c:1918
 sock_sendmsg_nosec net/socket.c:652 [inline]
 sock_sendmsg+0xcf/0x120 net/socket.c:672
 ____sys_sendmsg+0x6e8/0x810 net/socket.c:2352
 ___sys_sendmsg+0xf3/0x170 net/socket.c:2406
 __sys_sendmsg+0xe5/0x1b0 net/socket.c:2439
 do_syscall_64+0x60/0xe0 arch/x86/entry/common.c:384
 entry_SYSCALL_64_after_hwframe+0x44/0xa9

The buggy address belongs to the object at ffff888094ccc000
 which belongs to the cache kmalloc-8k of size 8192
The buggy address is located 1400 bytes inside of
 8192-byte region [ffff888094ccc000, ffff888094cce000)
The buggy address belongs to the page:
page:ffffea0002533300 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 head:ffffea0002533300 order:2 compound_mapcount:0 compound_pincount:0
flags: 0xfffe0000010200(slab|head)
raw: 00fffe0000010200 ffffea0002519408 ffffea0002623008 ffff8880aa0021c0
raw: 0000000000000000 ffff888094ccc000 0000000100000001 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
 ffff888094ccc400: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff888094ccc480: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff888094ccc500: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
                                                                ^
 ffff888094ccc580: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff888094ccc600: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================

Crashes (24):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2020/07/20 22:23 net-old 544f287b8495 4285ffa3 .config console log report syz C ci-upstream-net-this-kasan-gce
2020/07/21 02:35 linux-next ab8be66e724e 4285ffa3 .config console log report syz C ci-upstream-linux-next-kasan-gce-root
2020/07/24 01:08 net-old e6827d1abdc9 70c104a1 .config console log report ci-upstream-net-this-kasan-gce
2020/07/23 23:09 net-old e6827d1abdc9 70c104a1 .config console log report ci-upstream-net-this-kasan-gce
2020/07/23 18:09 net-old e6827d1abdc9 70c104a1 .config console log report ci-upstream-net-this-kasan-gce
2020/07/23 06:18 net-old 2c4dc3148603 340ea530 .config console log report ci-upstream-net-this-kasan-gce
2020/07/23 05:27 net-old 2c4dc3148603 340ea530 .config console log report ci-upstream-net-this-kasan-gce
2020/07/23 03:21 net-old 2c4dc3148603 340ea530 .config console log report ci-upstream-net-this-kasan-gce
2020/07/22 19:16 net-old 2c4dc3148603 128cd85f .config console log report ci-upstream-net-this-kasan-gce
2020/07/22 14:20 net-old 2c4dc3148603 128cd85f .config console log report ci-upstream-net-this-kasan-gce
2020/07/22 13:01 net-old 2c4dc3148603 128cd85f .config console log report ci-upstream-net-this-kasan-gce
2020/07/22 05:21 net-old 6ef9dcb78046 21f1765e .config console log report ci-upstream-net-this-kasan-gce
2020/07/21 22:54 net-old 6ef9dcb78046 21f1765e .config console log report ci-upstream-net-this-kasan-gce
2020/07/21 17:09 net-old 6ef9dcb78046 21f1765e .config console log report ci-upstream-net-this-kasan-gce
2020/07/20 22:44 net-old 544f287b8495 4285ffa3 .config console log report ci-upstream-net-this-kasan-gce
2020/07/20 22:31 net-old 544f287b8495 4285ffa3 .config console log report ci-upstream-net-this-kasan-gce
2020/07/20 22:09 net-old 544f287b8495 4285ffa3 .config console log report ci-upstream-net-this-kasan-gce
2020/07/20 00:52 net-old a463fa2cda56 9c812472 .config console log report ci-upstream-net-this-kasan-gce
2020/07/19 05:16 net-old 2ccb0161a0e9 9c812472 .config console log report ci-upstream-net-this-kasan-gce
2020/07/19 02:28 net-old 2ccb0161a0e9 9c812472 .config console log report ci-upstream-net-this-kasan-gce
2020/07/18 19:12 net-old 2ccb0161a0e9 9c812472 .config console log report ci-upstream-net-this-kasan-gce
2020/07/21 00:21 linux-next ab8be66e724e 4285ffa3 .config console log report ci-upstream-linux-next-kasan-gce-root
2020/07/20 18:03 linux-next ab8be66e724e 4285ffa3 .config console log report ci-upstream-linux-next-kasan-gce-root
2020/07/20 17:58 linux-next ab8be66e724e 4285ffa3 .config console log report ci-upstream-linux-next-kasan-gce-root
* Struck through repros no longer work on HEAD.