syzbot


KASAN: slab-out-of-bounds Read in neigh_mark_dead

Status: fixed on 2019/01/11 01:22
Subsystems: net
[Documentation on labels]
Reported-by: syzbot+424d47d5c456ce8b2bbe@syzkaller.appspotmail.com
Fix commit: 8cc196d6ef86 neighbor: gc_list changes should be protected by table lock
First crash: 1965d, last: 1961d
Duplicate bugs (1)
duplicates (1):
Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
BUG: corrupted list in entry_SYSCALL_64_after_hwframe net 1 1964d 1963d 0/26 closed as dup on 2018/12/10 23:35
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: slab-out-of-bounds Read in neigh_mark_dead 0 (1) 2018/12/10 07:51

Sample crash report:
==================================================================
BUG: KASAN: slab-out-of-bounds in __list_del_entry_valid+0xf1/0x100 lib/list_debug.c:51
Read of size 8 at addr ffff8881d91366f0 by task kworker/0:4/13875

CPU: 0 PID: 13875 Comm: kworker/0:4 Not tainted 4.20.0-rc6+ #337
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Workqueue: events_power_efficient neigh_periodic_work
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_periodic_work+0x89a/0xc30 net/core/neighbour.c:905
 process_one_work+0xc90/0x1c40 kernel/workqueue.c:2153
 worker_thread+0x17f/0x1390 kernel/workqueue.c:2296
 kthread+0x35a/0x440 kernel/kthread.c:246
 ret_from_fork+0x3a/0x50 arch/x86/entry/entry_64.S:352

Allocated by task 14685:
 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]
 __register_sysctl_table+0xc7/0xfb0 fs/proc/proc_sysctl.c:1307
 register_net_sysctl+0x29/0x30 net/sysctl_net.c:120
 neigh_sysctl_register+0x399/0x730 net/core/neighbour.c:3430
 devinet_sysctl_register+0xb4/0x220 net/ipv4/devinet.c:2520
 inetdev_init+0x2df/0x590 net/ipv4/devinet.c:274
 inetdev_event+0xf19/0x1340 net/ipv4/devinet.c:1479
 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]
 register_netdevice+0xb7d/0x11a0 net/core/dev.c:8620
 __ip_tunnel_create+0x361/0x550 net/ipv4/ip_tunnel.c:282
 ip_tunnel_init_net+0x3fc/0xac0 net/ipv4/ip_tunnel.c:1029
 vti_init_net+0x84/0x480 net/ipv4/ip_vti.c:437
 ops_init+0x101/0x560 net/core/net_namespace.c:129
 setup_net+0x362/0x8d0 net/core/net_namespace.c:314
 copy_net_ns+0x2b1/0x4a0 net/core/net_namespace.c:437
 create_new_namespaces+0x6ad/0x900 kernel/nsproxy.c:107
 unshare_nsproxy_namespaces+0xc3/0x1f0 kernel/nsproxy.c:206
 ksys_unshare+0x79c/0x10b0 kernel/fork.c:2539
 __do_sys_unshare kernel/fork.c:2607 [inline]
 __se_sys_unshare kernel/fork.c:2605 [inline]
 __x64_sys_unshare+0x31/0x40 kernel/fork.c:2605
 do_syscall_64+0x1b9/0x820 arch/x86/entry/common.c:290
 entry_SYSCALL_64_after_hwframe+0x49/0xbe

Freed by task 9:
 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 ffff8881d9136480
 which belongs to the cache kmalloc-1k of size 1024
The buggy address is located 624 bytes inside of
 1024-byte region [ffff8881d9136480, ffff8881d9136880)
The buggy address belongs to the page:
page:ffffea0007644d80 count:1 mapcount:0 mapping:ffff8881da800ac0 index:0xffff8881d9136000 compound_mapcount: 0
flags: 0x2fffc0000010200(slab|head)
raw: 02fffc0000010200 ffffea00067bf488 ffffea0007514d88 ffff8881da800ac0
raw: ffff8881d9136000 ffff8881d9136000 0000000100000005 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
 ffff8881d9136580: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 ffff8881d9136600: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
>ffff8881d9136680: 00 00 00 00 00 00 00 00 00 00 fc fc fc fc fc fc
                                                             ^
 ffff8881d9136700: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
 ffff8881d9136780: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
==================================================================

Crashes (12):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2018/12/11 04:05 net-next-old d8ed257f313f 4093e33b .config console log report ci-upstream-net-kasan-gce
2018/12/11 03:13 net-next-old d8ed257f313f 4093e33b .config console log report ci-upstream-net-kasan-gce
2018/12/11 01:54 net-next-old d8ed257f313f 4093e33b .config console log report ci-upstream-net-kasan-gce
2018/12/10 19:33 net-next-old 4cc1feeb6ffc 6565f24d .config console log report ci-upstream-net-kasan-gce
2018/12/10 13:42 net-next-old 4cc1feeb6ffc 6565f24d .config console log report ci-upstream-net-kasan-gce
2018/12/10 07:44 net-next-old 4cc1feeb6ffc 96cc4c50 .config console log report ci-upstream-net-kasan-gce
2018/12/09 23:55 net-next-old a60956ed72f7 96cc4c50 .config console log report ci-upstream-net-kasan-gce
2018/12/08 19:43 net-next-old 83af01ba1c2d 60562a1d .config console log report ci-upstream-net-kasan-gce
2018/12/12 23:14 linux-next 14cf8c1d5b90 02613a41 .config console log report ci-upstream-linux-next-kasan-gce-root
2018/12/12 00:53 linux-next 14cf8c1d5b90 7795ae03 .config console log report ci-upstream-linux-next-kasan-gce-root
2018/12/11 18:59 linux-next 14cf8c1d5b90 7795ae03 .config console log report ci-upstream-linux-next-kasan-gce-root
2018/12/11 04:53 linux-next 14cf8c1d5b90 4093e33b .config console log report ci-upstream-linux-next-kasan-gce-root
* Struck through repros no longer work on HEAD.