syzbot


KASAN: use-after-free Read in fib6_purge_rt (2)

Status: auto-closed as invalid on 2019/10/25 08:52
Subsystems: net
[Documentation on labels]
Reported-by: syzbot+8d3b8249a5071f9213e5@syzkaller.appspotmail.com
First crash: 1787d, last: 1787d
Similar bugs (1)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream KASAN: use-after-free Read in fib6_purge_rt net 3 1873d 1923d 0/26 closed as invalid on 2019/04/02 19:13

Sample crash report:
==================================================================
BUG: KASAN: use-after-free in __read_once_size include/linux/compiler.h:194 [inline]
BUG: KASAN: use-after-free in __fib6_drop_pcpu_from net/ipv6/ip6_fib.c:900 [inline]
BUG: KASAN: use-after-free in fib6_drop_pcpu_from net/ipv6/ip6_fib.c:921 [inline]
BUG: KASAN: use-after-free in fib6_purge_rt+0x72d/0x800 net/ipv6/ip6_fib.c:929
Read of size 8 at addr ffff888092a1551c by task syz-executor.4/25385

CPU: 1 PID: 25385 Comm: syz-executor.4 Not tainted 5.2.0-rc3+ #22
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+0x172/0x1f0 lib/dump_stack.c:113
 print_address_description.cold+0x7c/0x20d mm/kasan/report.c:188
 __kasan_report.cold+0x1b/0x40 mm/kasan/report.c:317
 kasan_report+0x12/0x20 mm/kasan/common.c:614
 __asan_report_load8_noabort+0x14/0x20 mm/kasan/generic_report.c:132
 __read_once_size include/linux/compiler.h:194 [inline]
 __fib6_drop_pcpu_from net/ipv6/ip6_fib.c:900 [inline]
 fib6_drop_pcpu_from net/ipv6/ip6_fib.c:921 [inline]
 fib6_purge_rt+0x72d/0x800 net/ipv6/ip6_fib.c:929
 fib6_del_route net/ipv6/ip6_fib.c:1817 [inline]
 fib6_del+0x9bd/0xeb0 net/ipv6/ip6_fib.c:1848
 fib6_clean_node+0x3a5/0x590 net/ipv6/ip6_fib.c:2010
 fib6_walk_continue+0x4a9/0x8e0 net/ipv6/ip6_fib.c:1932
 fib6_walk+0x9d/0x100 net/ipv6/ip6_fib.c:1980
 fib6_clean_tree+0xe0/0x120 net/ipv6/ip6_fib.c:2059
 __fib6_clean_all+0x118/0x2a0 net/ipv6/ip6_fib.c:2075
 fib6_clean_all+0x2b/0x40 net/ipv6/ip6_fib.c:2086
 rt6_sync_down_dev+0x134/0x150 net/ipv6/route.c:4343
 rt6_disable_ip+0x27/0x5f0 net/ipv6/route.c:4348
 addrconf_ifdown+0xa2/0x1220 net/ipv6/addrconf.c:3707
 addrconf_notify+0x5db/0x2370 net/ipv6/addrconf.c:3632
 notifier_call_chain+0xc2/0x230 kernel/notifier.c:95
 __raw_notifier_call_chain kernel/notifier.c:396 [inline]
 raw_notifier_call_chain+0x2e/0x40 kernel/notifier.c:403
 call_netdevice_notifiers_info+0x3f/0x90 net/core/dev.c:1749
 call_netdevice_notifiers_extack net/core/dev.c:1761 [inline]
 call_netdevice_notifiers net/core/dev.c:1775 [inline]
 dev_close_many+0x33f/0x6f0 net/core/dev.c:1518
 rollback_registered_many+0x43b/0xfc0 net/core/dev.c:8155
 rollback_registered+0x109/0x1d0 net/core/dev.c:8220
 unregister_netdevice_queue net/core/dev.c:9267 [inline]
 unregister_netdevice_queue+0x1ee/0x2c0 net/core/dev.c:9260
 unregister_netdevice include/linux/netdevice.h:2631 [inline]
 __tun_detach+0xd8a/0x1040 drivers/net/tun.c:724
 tun_detach drivers/net/tun.c:741 [inline]
 tun_chr_close+0xe0/0x180 drivers/net/tun.c:3451
 __fput+0x2ff/0x890 fs/file_table.c:280
 ____fput+0x16/0x20 fs/file_table.c:313
 task_work_run+0x145/0x1c0 kernel/task_work.c:113
 exit_task_work include/linux/task_work.h:22 [inline]
 do_exit+0x90a/0x2fa0 kernel/exit.c:877
 do_group_exit+0x135/0x370 kernel/exit.c:981
 __do_sys_exit_group kernel/exit.c:992 [inline]
 __se_sys_exit_group kernel/exit.c:990 [inline]
 __x64_sys_exit_group+0x44/0x50 kernel/exit.c:990
 do_syscall_64+0xfd/0x680 arch/x86/entry/common.c:301
 entry_SYSCALL_64_after_hwframe+0x49/0xbe
RIP: 0033:0x459279
Code: fd b7 fb ff c3 66 2e 0f 1f 84 00 00 00 00 00 66 90 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 0f 83 cb b7 fb ff c3 66 2e 0f 1f 84 00 00 00 00
RSP: 002b:00007ffd4ac23498 EFLAGS: 00000246 ORIG_RAX: 00000000000000e7
RAX: ffffffffffffffda RBX: 000000000000001c RCX: 0000000000459279
RDX: 0000000000412e80 RSI: 0000000000a74ef0 RDI: 0000000000000043
RBP: 00000000004be9d7 R08: 000000000000000c R09: 00000000000dc5ac
R10: 0000555556dc1940 R11: 0000000000000246 R12: 00000000ffffffff
R13: 00007ffd4ac235e0 R14: 00000000000dc3f9 R15: 00007ffd4ac235f0

Allocated by task 14203:
 save_stack+0x23/0x90 mm/kasan/common.c:71
 set_track mm/kasan/common.c:79 [inline]
 __kasan_kmalloc mm/kasan/common.c:489 [inline]
 __kasan_kmalloc.constprop.0+0xcf/0xe0 mm/kasan/common.c:462
 kasan_kmalloc+0x9/0x10 mm/kasan/common.c:503
 __do_kmalloc mm/slab.c:3660 [inline]
 __kmalloc+0x15c/0x740 mm/slab.c:3669
 kmalloc include/linux/slab.h:552 [inline]
 kzalloc include/linux/slab.h:742 [inline]
 ops_init+0xff/0x410 net/core/net_namespace.c:120
 setup_net+0x2d3/0x740 net/core/net_namespace.c:316
 copy_net_ns+0x1df/0x340 net/core/net_namespace.c:439
 create_new_namespaces+0x400/0x7b0 kernel/nsproxy.c:107
 unshare_nsproxy_namespaces+0xc2/0x200 kernel/nsproxy.c:206
 ksys_unshare+0x440/0x980 kernel/fork.c:2692
 __do_sys_unshare kernel/fork.c:2760 [inline]
 __se_sys_unshare kernel/fork.c:2758 [inline]
 __x64_sys_unshare+0x31/0x40 kernel/fork.c:2758
 do_syscall_64+0xfd/0x680 arch/x86/entry/common.c:301
 entry_SYSCALL_64_after_hwframe+0x49/0xbe

Freed by task 21:
 save_stack+0x23/0x90 mm/kasan/common.c:71
 set_track mm/kasan/common.c:79 [inline]
 __kasan_slab_free+0x102/0x150 mm/kasan/common.c:451
 kasan_slab_free+0xe/0x10 mm/kasan/common.c:459
 __cache_free mm/slab.c:3432 [inline]
 kfree+0xcf/0x220 mm/slab.c:3755
 ops_free net/core/net_namespace.c:144 [inline]
 ops_free_list.part.0+0x268/0x3c0 net/core/net_namespace.c:166
 ops_free_list net/core/net_namespace.c:164 [inline]
 cleanup_net+0x4a1/0x960 net/core/net_namespace.c:557
 process_one_work+0x989/0x1790 kernel/workqueue.c:2269
 worker_thread+0x98/0xe40 kernel/workqueue.c:2415
 kthread+0x354/0x420 kernel/kthread.c:255
 ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:352

The buggy address belongs to the object at ffff888092a14ec0
 which belongs to the cache kmalloc-2k of size 2048
The buggy address is located 1628 bytes inside of
 2048-byte region [ffff888092a14ec0, ffff888092a156c0)
The buggy address belongs to the page:
page:ffffea00024a8500 refcount:1 mapcount:0 mapping:ffff8880aa400c40 index:0xffff888092a15740 compound_mapcount: 0
flags: 0x1fffc0000010200(slab|head)
raw: 01fffc0000010200 ffffea00028fc008 ffffea0002432d08 ffff8880aa400c40
raw: ffff888092a15740 ffff888092a14640 0000000100000002 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
 ffff888092a15400: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff888092a15480: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff888092a15500: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
                            ^
 ffff888092a15580: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff888092a15600: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================

Crashes (1):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2019/06/10 08:49 net-next-old 900d96e418dc 0159583c .config console log report ci-upstream-net-kasan-gce
* Struck through repros no longer work on HEAD.