syzbot


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

Status: fixed on 2019/07/10 21:40
Subsystems: net
[Documentation on labels]
Fix commit: c3bcde026684 tipc: pass tunnel dev as NULL to udp_tunnel(6)_xmit_skb
First crash: 1831d, last: 1831d

Sample crash report:
==================================================================
BUG: KASAN: slab-out-of-bounds in __read_once_size include/linux/compiler.h:194 [inline]
BUG: KASAN: slab-out-of-bounds in __fib6_drop_pcpu_from.isra.0.part.0+0x1fa/0x210 net/ipv6/ip6_fib.c:900
Read of size 8 at addr ffff88809b92c654 by task syz-executor.0/25406

CPU: 0 PID: 25406 Comm: syz-executor.0 Not tainted 5.2.0-rc3+ #33
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.isra.0.part.0+0x1fa/0x210 net/ipv6/ip6_fib.c:900
 __fib6_drop_pcpu_from net/ipv6/ip6_fib.c:882 [inline]
 fib6_drop_pcpu_from net/ipv6/ip6_fib.c:943 [inline]
 fib6_purge_rt+0x619/0x760 net/ipv6/ip6_fib.c:952
 fib6_del_route net/ipv6/ip6_fib.c:1840 [inline]
 fib6_del+0x9bd/0xeb0 net/ipv6/ip6_fib.c:1871
 fib6_clean_node+0x3a5/0x590 net/ipv6/ip6_fib.c:2033
 fib6_walk_continue+0x4a9/0x8e0 net/ipv6/ip6_fib.c:1955
 fib6_walk+0x9d/0x100 net/ipv6/ip6_fib.c:2003
 fib6_clean_tree+0xe0/0x120 net/ipv6/ip6_fib.c:2082
 __fib6_clean_all+0x118/0x2a0 net/ipv6/ip6_fib.c:2098
 fib6_clean_all+0x2b/0x40 net/ipv6/ip6_fib.c:2109
 rt6_sync_down_dev+0x134/0x150 net/ipv6/route.c:4669
 rt6_disable_ip+0x27/0x5f0 net/ipv6/route.c:4674
 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_notify_flags+0x1e9/0x2c0 net/core/dev.c:7590
 dev_change_flags+0x10d/0x170 net/core/dev.c:7626
 devinet_ioctl+0x1434/0x1cd0 net/ipv4/devinet.c:1129
 inet_ioctl+0x1f4/0x340 net/ipv4/af_inet.c:948
 sock_do_ioctl+0xd8/0x2f0 net/socket.c:1043
 sock_ioctl+0x3ed/0x780 net/socket.c:1194
 vfs_ioctl fs/ioctl.c:46 [inline]
 file_ioctl fs/ioctl.c:509 [inline]
 do_vfs_ioctl+0xd5f/0x1380 fs/ioctl.c:696
 ksys_ioctl+0xab/0xd0 fs/ioctl.c:713
 __do_sys_ioctl fs/ioctl.c:720 [inline]
 __se_sys_ioctl fs/ioctl.c:718 [inline]
 __x64_sys_ioctl+0x73/0xb0 fs/ioctl.c:718
 do_syscall_64+0xfd/0x680 arch/x86/entry/common.c:301
 entry_SYSCALL_64_after_hwframe+0x49/0xbe
RIP: 0033:0x4592c9
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:00007fbf82e45c78 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 0000000000000003 RCX: 00000000004592c9
RDX: 0000000020000000 RSI: 0000000000008914 RDI: 0000000000000003
RBP: 000000000075bf20 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 00007fbf82e466d4
R13: 00000000004c4f17 R14: 00000000004d8f60 R15: 00000000ffffffff

Allocated by task 3850:
 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_slab_alloc+0xf/0x20 mm/kasan/common.c:497
 slab_post_alloc_hook mm/slab.h:437 [inline]
 slab_alloc mm/slab.c:3326 [inline]
 kmem_cache_alloc+0x11a/0x6f0 mm/slab.c:3488
 getname_flags fs/namei.c:138 [inline]
 getname_flags+0xd6/0x5b0 fs/namei.c:128
 user_path_at_empty+0x2f/0x50 fs/namei.c:2606
 do_readlinkat+0xe9/0x320 fs/stat.c:399
 __do_sys_readlink fs/stat.c:432 [inline]
 __se_sys_readlink fs/stat.c:429 [inline]
 __x64_sys_readlink+0x78/0xb0 fs/stat.c:429
 do_syscall_64+0xfd/0x680 arch/x86/entry/common.c:301
 entry_SYSCALL_64_after_hwframe+0x49/0xbe

Freed by task 3850:
 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]
 kmem_cache_free+0x86/0x260 mm/slab.c:3698
 putname+0xef/0x130 fs/namei.c:259
 filename_lookup+0x28f/0x410 fs/namei.c:2355
 user_path_at_empty+0x43/0x50 fs/namei.c:2606
 do_readlinkat+0xe9/0x320 fs/stat.c:399
 __do_sys_readlink fs/stat.c:432 [inline]
 __se_sys_readlink fs/stat.c:429 [inline]
 __x64_sys_readlink+0x78/0xb0 fs/stat.c:429
 do_syscall_64+0xfd/0x680 arch/x86/entry/common.c:301
 entry_SYSCALL_64_after_hwframe+0x49/0xbe

The buggy address belongs to the object at ffff88809b92cdc0
 which belongs to the cache names_cache of size 4096
The buggy address is located 1900 bytes to the left of
 4096-byte region [ffff88809b92cdc0, ffff88809b92ddc0)
The buggy address belongs to the page:
page:ffffea00026e4b00 refcount:1 mapcount:0 mapping:ffff8880aa594c40 index:0x0 compound_mapcount: 0
flags: 0x1fffc0000010200(slab|head)
raw: 01fffc0000010200 ffffea0002536208 ffffea0001837088 ffff8880aa594c40
raw: 0000000000000000 ffff88809b92cdc0 0000000100000001 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
 ffff88809b92c500: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
 ffff88809b92c580: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
>ffff88809b92c600: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
                                                 ^
 ffff88809b92c680: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
 ffff88809b92c700: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
==================================================================

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