syzbot


KASAN: use-after-free Read in neigh_mark_dead

Status: fixed on 2019/01/11 01:22
Subsystems: net
[Documentation on labels]
Reported-by: syzbot+35e87b87c00f386b041f@syzkaller.appspotmail.com
Fix commit: 8cc196d6ef86 neighbor: gc_list changes should be protected by table lock
First crash: 1903d, last: 1898d
Duplicate bugs (1)
duplicates (1):
Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
KASAN: use-after-free Read in handle_userfault (2) fs 1 1899d 1899d 0/26 closed as dup on 2019/01/07 09:45
Discussions (2)
Title Replies (including bot) Last reply
[PATCH net-next] neighbor: gc_list changes should be protected by table lock 2 (2) 2018/12/11 01:42
KASAN: use-after-free Read in neigh_mark_dead 0 (1) 2018/12/10 05:41

Sample crash report:
8021q: adding VLAN 0 to HW filter on device team0
8021q: adding VLAN 0 to HW filter on device team0
8021q: adding VLAN 0 to HW filter on device team0
8021q: adding VLAN 0 to HW filter on device team0
==================================================================
BUG: KASAN: use-after-free in __list_del_entry_valid+0xf1/0x100 lib/list_debug.c:51
Read of size 8 at addr ffff8881ba491db0 by task ip/7439

CPU: 1 PID: 7439 Comm: ip Not tainted 4.20.0-rc6+ #336
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Call Trace:
 __dump_stack lib/dump_stack.c:77 [inline]
 dump_stack+0x244/0x39d lib/dump_stack.c:113
 print_address_description.cold.7+0x9/0x1ff mm/kasan/report.c:256
 kasan_report_error mm/kasan/report.c:354 [inline]
 kasan_report.cold.8+0x242/0x309 mm/kasan/report.c:412
 __asan_report_load8_noabort+0x14/0x20 mm/kasan/report.c:433
 __list_del_entry_valid+0xf1/0x100 lib/list_debug.c:51
 __list_del_entry include/linux/list.h:117 [inline]
 list_del_init include/linux/list.h:159 [inline]
 neigh_mark_dead+0x13b/0x410 net/core/neighbour.c:125
 neigh_flush_dev+0x3a1/0x960 net/core/neighbour.c:290
 neigh_changeaddr+0x31/0x40 net/core/neighbour.c:319
 ndisc_netdev_event+0xe6/0x5b0 net/ipv6/ndisc.c:1770
 notifier_call_chain+0x17e/0x380 kernel/notifier.c:93
 __raw_notifier_call_chain kernel/notifier.c:394 [inline]
 raw_notifier_call_chain+0x2d/0x40 kernel/notifier.c:401
 call_netdevice_notifiers_info+0x3f/0x90 net/core/dev.c:1737
 call_netdevice_notifiers_extack net/core/dev.c:1749 [inline]
 call_netdevice_notifiers net/core/dev.c:1763 [inline]
 dev_set_mac_address+0x293/0x3b0 net/core/dev.c:7780
 do_setlink+0x7c7/0x3f30 net/core/rtnetlink.c:2447
 __rtnl_newlink+0xcde/0x19e0 net/core/rtnetlink.c:3115
 rtnl_newlink+0x6b/0xa0 net/core/rtnetlink.c:3240
 rtnetlink_rcv_msg+0x46a/0xc20 net/core/rtnetlink.c:4969
 netlink_rcv_skb+0x172/0x440 net/netlink/af_netlink.c:2477
 rtnetlink_rcv+0x1c/0x20 net/core/rtnetlink.c:4987
 netlink_unicast_kernel net/netlink/af_netlink.c:1310 [inline]
 netlink_unicast+0x5a5/0x760 net/netlink/af_netlink.c:1336
 netlink_sendmsg+0xa18/0xfc0 net/netlink/af_netlink.c:1917
 sock_sendmsg_nosec net/socket.c:621 [inline]
 sock_sendmsg+0xd5/0x120 net/socket.c:631
 ___sys_sendmsg+0x7fd/0x930 net/socket.c:2116
 __sys_sendmsg+0x11d/0x280 net/socket.c:2154
 __do_sys_sendmsg net/socket.c:2163 [inline]
 __se_sys_sendmsg net/socket.c:2161 [inline]
 __x64_sys_sendmsg+0x78/0xb0 net/socket.c:2161
 do_syscall_64+0x1b9/0x820 arch/x86/entry/common.c:290
 entry_SYSCALL_64_after_hwframe+0x49/0xbe
RIP: 0033:0x7f80f88dd320
Code: 02 48 83 c8 ff eb 8d 48 8b 05 14 7b 2a 00 f7 da 64 89 10 48 83 c8 ff eb c9 90 83 3d d5 d2 2a 00 00 75 10 b8 2e 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 31 c3 48 83 ec 08 e8 5e ba 00 00 48 89 04 24
RSP: 002b:00007fff4450ecb8 EFLAGS: 00000246 ORIG_RAX: 000000000000002e
RAX: ffffffffffffffda RBX: 00007fff44512db0 RCX: 00007f80f88dd320
RDX: 0000000000000000 RSI: 00007fff4450ecf0 RDI: 0000000000000003
RBP: 00007fff4450ecf0 R08: 0000000000000000 R09: 000000000000000d
R10: 0000000000000000 R11: 0000000000000246 R12: 000000005c0e9587
R13: 0000000000000000 R14: 00000000006395c0 R15: 00007fff44513590

Allocated by task 12:
 save_stack+0x43/0xd0 mm/kasan/kasan.c:448
 set_track mm/kasan/kasan.c:460 [inline]
 kasan_kmalloc+0xc7/0xe0 mm/kasan/kasan.c:553
 __do_kmalloc mm/slab.c:3722 [inline]
 __kmalloc+0x15b/0x760 mm/slab.c:3731
 kmalloc include/linux/slab.h:551 [inline]
 kzalloc include/linux/slab.h:741 [inline]
 neigh_alloc net/core/neighbour.c:375 [inline]
 ___neigh_create+0x13fc/0x2600 net/core/neighbour.c:553
 __neigh_create+0x30/0x40 net/core/neighbour.c:640
 ip6_finish_output2+0xa64/0x2940 net/ipv6/ip6_output.c:117
 ip6_finish_output+0x58c/0xc60 net/ipv6/ip6_output.c:154
 NF_HOOK_COND include/linux/netfilter.h:278 [inline]
 ip6_output+0x232/0x9d0 net/ipv6/ip6_output.c:171
 dst_output include/net/dst.h:444 [inline]
 NF_HOOK include/linux/netfilter.h:289 [inline]
 mld_sendpack+0xad5/0xfa0 net/ipv6/mcast.c:1683
 mld_send_cr net/ipv6/mcast.c:1979 [inline]
 mld_ifc_timer_expire+0x447/0x8a0 net/ipv6/mcast.c:2478
 call_timer_fn+0x272/0x920 kernel/time/timer.c:1326
 expire_timers kernel/time/timer.c:1363 [inline]
 __run_timers+0x7e5/0xc70 kernel/time/timer.c:1682
 run_timer_softirq+0x52/0xb0 kernel/time/timer.c:1695
 __do_softirq+0x308/0xb7e kernel/softirq.c:292

Freed by task 7425:
 save_stack+0x43/0xd0 mm/kasan/kasan.c:448
 set_track mm/kasan/kasan.c:460 [inline]
 __kasan_slab_free+0x102/0x150 mm/kasan/kasan.c:521
 kasan_slab_free+0xe/0x10 mm/kasan/kasan.c:528
 __cache_free mm/slab.c:3498 [inline]
 kfree+0xcf/0x230 mm/slab.c:3817
 __rcu_reclaim kernel/rcu/rcu.h:233 [inline]
 rcu_do_batch kernel/rcu/tree.c:2437 [inline]
 invoke_rcu_callbacks kernel/rcu/tree.c:2716 [inline]
 rcu_process_callbacks+0x1140/0x1ac0 kernel/rcu/tree.c:2697
 __do_softirq+0x308/0xb7e kernel/softirq.c:292

The buggy address belongs to the object at ffff8881ba491b40
 which belongs to the cache kmalloc-1k of size 1024
The buggy address is located 624 bytes inside of
 1024-byte region [ffff8881ba491b40, ffff8881ba491f40)
The buggy address belongs to the page:
page:ffffea0006e92400 count:1 mapcount:0 mapping:ffff8881da800ac0 index:0x0 compound_mapcount: 0
flags: 0x2fffc0000010200(slab|head)
raw: 02fffc0000010200 ffffea0006ebd388 ffffea0006e91408 ffff8881da800ac0
raw: 0000000000000000 ffff8881ba490040 0000000100000007 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
 ffff8881ba491c80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff8881ba491d00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff8881ba491d80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
                                     ^
 ffff8881ba491e00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff8881ba491e80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================

Crashes (858):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2018/12/10 16:36 net-next-old 4cc1feeb6ffc 6565f24d .config console log report syz C ci-upstream-net-kasan-gce
2018/12/09 21:35 net-next-old a60956ed72f7 979179d6 .config console log report syz C ci-upstream-net-kasan-gce
2018/12/13 01:42 linux-next 14cf8c1d5b90 02613a41 .config console log report syz C ci-upstream-linux-next-kasan-gce-root
2018/12/12 20:59 linux-next 14cf8c1d5b90 c3b10a5d .config console log report syz C ci-upstream-linux-next-kasan-gce-root
2018/12/12 07:18 linux-next 14cf8c1d5b90 7795ae03 .config console log report syz C ci-upstream-linux-next-kasan-gce-root
2018/12/12 02:37 linux-next 14cf8c1d5b90 7795ae03 .config console log report syz C ci-upstream-linux-next-kasan-gce-root
2018/12/12 00:05 linux-next 14cf8c1d5b90 7795ae03 .config console log report syz C ci-upstream-linux-next-kasan-gce-root
2018/12/11 15:40 linux-next 14cf8c1d5b90 7795ae03 .config console log report syz C ci-upstream-linux-next-kasan-gce-root
2018/12/11 09:28 linux-next 14cf8c1d5b90 4093e33b .config console log report syz C ci-upstream-linux-next-kasan-gce-root
2018/12/10 05:09 net-next-old a60956ed72f7 96cc4c50 .config console log report syz ci-upstream-net-kasan-gce
2018/12/09 22:17 net-next-old a60956ed72f7 979179d6 .config console log report syz ci-upstream-net-kasan-gce
2018/12/09 20:54 net-next-old a60956ed72f7 979179d6 .config console log report syz ci-upstream-net-kasan-gce
2018/12/09 12:50 net-next-old a60956ed72f7 979179d6 .config console log report syz ci-upstream-net-kasan-gce
2018/12/08 13:04 net-next-old 83af01ba1c2d 60562a1d .config console log report syz ci-upstream-net-kasan-gce
2018/12/12 03:46 linux-next 14cf8c1d5b90 7795ae03 .config console log report syz ci-upstream-linux-next-kasan-gce-root
2018/12/11 21:44 linux-next 14cf8c1d5b90 7795ae03 .config console log report syz ci-upstream-linux-next-kasan-gce-root
2018/12/11 11:04 net-next-old d8ed257f313f 4093e33b .config console log report ci-upstream-net-kasan-gce
2018/12/08 12:18 net-next-old 83af01ba1c2d 60562a1d .config console log report ci-upstream-net-kasan-gce
2018/12/13 06:04 linux-next 14cf8c1d5b90 02613a41 .config console log report ci-upstream-linux-next-kasan-gce-root
2018/12/13 05:04 linux-next 14cf8c1d5b90 02613a41 .config console log report ci-upstream-linux-next-kasan-gce-root
2018/12/13 04:59 linux-next 14cf8c1d5b90 02613a41 .config console log report ci-upstream-linux-next-kasan-gce-root
2018/12/13 03:58 linux-next 14cf8c1d5b90 02613a41 .config console log report ci-upstream-linux-next-kasan-gce-root
2018/12/13 02:46 linux-next 14cf8c1d5b90 02613a41 .config console log report ci-upstream-linux-next-kasan-gce-root
2018/12/13 02:46 linux-next 14cf8c1d5b90 02613a41 .config console log report ci-upstream-linux-next-kasan-gce-root
2018/12/13 01:33 linux-next 14cf8c1d5b90 02613a41 .config console log report ci-upstream-linux-next-kasan-gce-root
2018/12/13 00:27 linux-next 14cf8c1d5b90 02613a41 .config console log report ci-upstream-linux-next-kasan-gce-root
2018/12/13 00:25 linux-next 14cf8c1d5b90 02613a41 .config console log report ci-upstream-linux-next-kasan-gce-root
2018/12/12 23:22 linux-next 14cf8c1d5b90 02613a41 .config console log report ci-upstream-linux-next-kasan-gce-root
2018/12/12 23:03 linux-next 14cf8c1d5b90 02613a41 .config console log report ci-upstream-linux-next-kasan-gce-root
2018/12/12 22:03 linux-next 14cf8c1d5b90 02613a41 .config console log report ci-upstream-linux-next-kasan-gce-root
2018/12/12 20:35 linux-next 14cf8c1d5b90 c3b10a5d .config console log report ci-upstream-linux-next-kasan-gce-root
2018/12/12 19:52 linux-next 14cf8c1d5b90 c3b10a5d .config console log report ci-upstream-linux-next-kasan-gce-root
2018/12/12 18:41 linux-next 14cf8c1d5b90 c3b10a5d .config console log report ci-upstream-linux-next-kasan-gce-root
2018/12/12 17:30 linux-next 14cf8c1d5b90 c3b10a5d .config console log report ci-upstream-linux-next-kasan-gce-root
2018/12/12 16:20 linux-next 14cf8c1d5b90 c3b10a5d .config console log report ci-upstream-linux-next-kasan-gce-root
2018/12/12 15:19 linux-next 14cf8c1d5b90 c3b10a5d .config console log report ci-upstream-linux-next-kasan-gce-root
2018/12/12 14:51 linux-next 14cf8c1d5b90 c3b10a5d .config console log report ci-upstream-linux-next-kasan-gce-root
2018/12/12 13:45 linux-next 14cf8c1d5b90 c3b10a5d .config console log report ci-upstream-linux-next-kasan-gce-root
2018/12/12 12:21 linux-next 14cf8c1d5b90 c3b10a5d .config console log report ci-upstream-linux-next-kasan-gce-root
2018/12/12 12:12 linux-next 14cf8c1d5b90 c3b10a5d .config console log report ci-upstream-linux-next-kasan-gce-root
2018/12/12 11:05 linux-next 14cf8c1d5b90 c3b10a5d .config console log report ci-upstream-linux-next-kasan-gce-root
2018/12/12 09:54 linux-next 14cf8c1d5b90 c3b10a5d .config console log report ci-upstream-linux-next-kasan-gce-root
2018/12/12 09:42 linux-next 14cf8c1d5b90 c3b10a5d .config console log report ci-upstream-linux-next-kasan-gce-root
2018/12/12 08:25 linux-next 14cf8c1d5b90 7795ae03 .config console log report ci-upstream-linux-next-kasan-gce-root
2018/12/12 07:14 linux-next 14cf8c1d5b90 7795ae03 .config console log report ci-upstream-linux-next-kasan-gce-root
2018/12/12 06:04 linux-next 14cf8c1d5b90 7795ae03 .config console log report ci-upstream-linux-next-kasan-gce-root
2018/12/12 04:55 linux-next 14cf8c1d5b90 7795ae03 .config console log report ci-upstream-linux-next-kasan-gce-root
2018/12/12 03:52 linux-next 14cf8c1d5b90 7795ae03 .config console log report ci-upstream-linux-next-kasan-gce-root
2018/12/12 03:42 linux-next 14cf8c1d5b90 7795ae03 .config console log report ci-upstream-linux-next-kasan-gce-root
2018/12/12 01:48 linux-next 14cf8c1d5b90 7795ae03 .config console log report ci-upstream-linux-next-kasan-gce-root
2018/12/12 00:45 linux-next 14cf8c1d5b90 7795ae03 .config console log report ci-upstream-linux-next-kasan-gce-root
2018/12/11 23:50 linux-next 14cf8c1d5b90 7795ae03 .config console log report ci-upstream-linux-next-kasan-gce-root
2018/12/11 22:48 linux-next 14cf8c1d5b90 7795ae03 .config console log report ci-upstream-linux-next-kasan-gce-root
2018/12/11 21:34 linux-next 14cf8c1d5b90 7795ae03 .config console log report ci-upstream-linux-next-kasan-gce-root
2018/12/11 20:54 linux-next 14cf8c1d5b90 7795ae03 .config console log report ci-upstream-linux-next-kasan-gce-root
2018/12/11 19:47 linux-next 14cf8c1d5b90 7795ae03 .config console log report ci-upstream-linux-next-kasan-gce-root
2018/12/11 18:46 linux-next 14cf8c1d5b90 7795ae03 .config console log report ci-upstream-linux-next-kasan-gce-root
2018/12/11 17:43 linux-next 14cf8c1d5b90 7795ae03 .config console log report ci-upstream-linux-next-kasan-gce-root
2018/12/11 16:50 linux-next 14cf8c1d5b90 7795ae03 .config console log report ci-upstream-linux-next-kasan-gce-root
2018/12/11 14:51 linux-next 14cf8c1d5b90 7795ae03 .config console log report ci-upstream-linux-next-kasan-gce-root
* Struck through repros no longer work on HEAD.