syzbot


KASAN: slab-out-of-bounds Write in prb_fill_curr_block

Status: fixed on 2018/07/09 18:05
Subsystems: net
[Documentation on labels]
Fix commit: eb73190f4fbe net/packet: refine check for priv area size
First crash: 2153d, last: 2153d

Sample crash report:
IPv6: ADDRCONF(NETDEV_UP): team0: link is not ready
8021q: adding VLAN 0 to HW filter on device team0
IPv6: ADDRCONF(NETDEV_CHANGE): team0: link becomes ready
tpacket_rcv: packet too big, clamped from 72 to 4294967224. macoff=96
==================================================================
BUG: KASAN: slab-out-of-bounds in prb_run_all_ft_ops net/packet/af_packet.c:1016 [inline]
BUG: KASAN: slab-out-of-bounds in prb_fill_curr_block.isra.59+0x4e5/0x5c0 net/packet/af_packet.c:1039
Write of size 2 at addr ffff8801ca00000e by task kworker/1:1/24

CPU: 1 PID: 24 Comm: kworker/1:1 Not tainted 4.17.0-rc7+ #77
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Workqueue: ipv6_addrconf addrconf_dad_work
Call Trace:
 __dump_stack lib/dump_stack.c:77 [inline]
 dump_stack+0x1b9/0x294 lib/dump_stack.c:113
 print_address_description+0x6c/0x20b mm/kasan/report.c:256
 kasan_report_error mm/kasan/report.c:354 [inline]
 kasan_report.cold.7+0x242/0x2fe mm/kasan/report.c:412
 __asan_report_store2_noabort+0x17/0x20 mm/kasan/report.c:436
 prb_run_all_ft_ops net/packet/af_packet.c:1016 [inline]
 prb_fill_curr_block.isra.59+0x4e5/0x5c0 net/packet/af_packet.c:1039
 __packet_lookup_frame_in_block net/packet/af_packet.c:1094 [inline]
 packet_current_rx_frame net/packet/af_packet.c:1117 [inline]
 tpacket_rcv+0x1866/0x3340 net/packet/af_packet.c:2282
 dev_queue_xmit_nit+0x891/0xb90 net/core/dev.c:2018
 xmit_one net/core/dev.c:3049 [inline]
 dev_hard_start_xmit+0x16b/0xc10 net/core/dev.c:3069
 __dev_queue_xmit+0x2724/0x34c0 net/core/dev.c:3584
 dev_queue_xmit+0x17/0x20 net/core/dev.c:3617
 neigh_resolve_output+0x679/0xad0 net/core/neighbour.c:1358
 neigh_output include/net/neighbour.h:482 [inline]
 ip6_finish_output2+0xc9c/0x2810 net/ipv6/ip6_output.c:120
 ip6_finish_output+0x5fe/0xbc0 net/ipv6/ip6_output.c:154
 NF_HOOK_COND include/linux/netfilter.h:277 [inline]
 ip6_output+0x227/0x9b0 net/ipv6/ip6_output.c:171
 dst_output include/net/dst.h:444 [inline]
 NF_HOOK include/linux/netfilter.h:288 [inline]
 ndisc_send_skb+0x100d/0x1570 net/ipv6/ndisc.c:491
 ndisc_send_ns+0x3c1/0x8d0 net/ipv6/ndisc.c:633
 addrconf_dad_work+0xbef/0x1340 net/ipv6/addrconf.c:4033
 process_one_work+0xc1e/0x1b50 kernel/workqueue.c:2145
 worker_thread+0x1cc/0x1440 kernel/workqueue.c:2279
 kthread+0x345/0x410 kernel/kthread.c:240
 ret_from_fork+0x3a/0x50 arch/x86/entry/entry_64.S:412

Allocated by task 3686:
 save_stack+0x43/0xd0 mm/kasan/kasan.c:448
 set_track mm/kasan/kasan.c:460 [inline]
 kasan_kmalloc+0xc4/0xe0 mm/kasan/kasan.c:553
 kasan_slab_alloc+0x12/0x20 mm/kasan/kasan.c:490
 kmem_cache_alloc+0x12e/0x760 mm/slab.c:3554
 getname_flags+0xd0/0x5a0 fs/namei.c:140
 user_path_at_empty+0x2d/0x50 fs/namei.c:2555
 user_path_at include/linux/namei.h:57 [inline]
 do_faccessat+0x24a/0x7c0 fs/open.c:389
 __do_sys_access fs/open.c:441 [inline]
 __se_sys_access fs/open.c:439 [inline]
 __x64_sys_access+0x59/0x80 fs/open.c:439
 do_syscall_64+0x1b1/0x800 arch/x86/entry/common.c:287
 entry_SYSCALL_64_after_hwframe+0x49/0xbe

Freed by task 3686:
 save_stack+0x43/0xd0 mm/kasan/kasan.c:448
 set_track mm/kasan/kasan.c:460 [inline]
 __kasan_slab_free+0x11a/0x170 mm/kasan/kasan.c:521
 kasan_slab_free+0xe/0x10 mm/kasan/kasan.c:528
 __cache_free mm/slab.c:3498 [inline]
 kmem_cache_free+0x86/0x2d0 mm/slab.c:3756
 putname+0xf2/0x130 fs/namei.c:261
 filename_lookup+0x38b/0x4f0 fs/namei.c:2330
 user_path_at_empty+0x40/0x50 fs/namei.c:2555
 user_path_at include/linux/namei.h:57 [inline]
 do_faccessat+0x24a/0x7c0 fs/open.c:389
 __do_sys_access fs/open.c:441 [inline]
 __se_sys_access fs/open.c:439 [inline]
 __x64_sys_access+0x59/0x80 fs/open.c:439
 do_syscall_64+0x1b1/0x800 arch/x86/entry/common.c:287
 entry_SYSCALL_64_after_hwframe+0x49/0xbe

The buggy address belongs to the object at ffff8801ca0004c0
 which belongs to the cache names_cache of size 4096
The buggy address is located 1202 bytes to the left of
 4096-byte region [ffff8801ca0004c0, ffff8801ca0014c0)
The buggy address belongs to the page:
page:ffffea0007280000 count:1 mapcount:0 mapping:ffff8801ca0004c0 index:0x0 compound_mapcount: 0
flags: 0x2fffc0000008100(slab|head)
raw: 02fffc0000008100 ffff8801ca0004c0 0000000000000000 0000000100000001
raw: ffffea0007286420 ffffea000729eca0 ffff8801da988dc0 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
 ffff8801c9ffff00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 ffff8801c9ffff80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
>ffff8801ca000000: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
                      ^
 ffff8801ca000080: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
 ffff8801ca000100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
==================================================================

Crashes (2):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2018/06/01 02:10 upstream dd52cb879063 2f93b54f .config console log report syz C ci-upstream-kasan-gce
2018/06/01 02:06 upstream dd52cb879063 2f93b54f .config console log report syz ci-upstream-kasan-gce-386
* Struck through repros no longer work on HEAD.