syzbot


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

Status: closed as invalid on 2018/04/10 15:13
Subsystems: net
[Documentation on labels]
Reported-by: syzbot+b2edb958464dab3eb910@syzkaller.appspotmail.com
First crash: 2703d, last: 2703d

Sample crash report:
rdma_op 00000000f7ca11d0 conn xmit_rdma           (null)
==================================================================
BUG: KASAN: slab-out-of-bounds in __read_once_size include/linux/compiler.h:188 [inline]
BUG: KASAN: slab-out-of-bounds in __netif_receive_skb_core+0x32b0/0x3460 net/core/dev.c:4493
Read of size 8 at addr ffff8801c00c4968 by task syz-executor5/8646

CPU: 1 PID: 8646 Comm: syz-executor5 Not tainted 4.16.0-rc6+ #285
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Call Trace:
 __dump_stack lib/dump_stack.c:17 [inline]
 dump_stack+0x194/0x24d lib/dump_stack.c:53
 print_address_description+0x73/0x250 mm/kasan/report.c:256
 kasan_report_error mm/kasan/report.c:354 [inline]
 kasan_report+0x23c/0x360 mm/kasan/report.c:412
 __asan_report_load8_noabort+0x14/0x20 mm/kasan/report.c:433
 __read_once_size include/linux/compiler.h:188 [inline]
 __netif_receive_skb_core+0x32b0/0x3460 net/core/dev.c:4493
 __netif_receive_skb+0x2c/0x1b0 net/core/dev.c:4649
 netif_receive_skb_internal+0x10b/0x670 net/core/dev.c:4723
 netif_receive_skb+0xae/0x390 net/core/dev.c:4747
 tun_rx_batched.isra.50+0x5ee/0x870 drivers/net/tun.c:1556
 tun_get_user+0x299e/0x3c20 drivers/net/tun.c:1960
 tun_chr_write_iter+0xb9/0x160 drivers/net/tun.c:1988
 call_write_iter include/linux/fs.h:1782 [inline]
 do_iter_readv_writev+0x55c/0x830 fs/read_write.c:653
 do_iter_write+0x154/0x540 fs/read_write.c:932
 vfs_writev+0x18a/0x340 fs/read_write.c:977
 do_writev+0xfc/0x2a0 fs/read_write.c:1012
 SYSC_writev fs/read_write.c:1085 [inline]
 SyS_writev+0x27/0x30 fs/read_write.c:1082
 do_syscall_64+0x281/0x940 arch/x86/entry/common.c:287
 entry_SYSCALL_64_after_hwframe+0x42/0xb7
RIP: 0033:0x454791
RSP: 002b:00007f086a0fdba0 EFLAGS: 00000293 ORIG_RAX: 0000000000000014
RAX: ffffffffffffffda RBX: 000000000000004a RCX: 0000000000454791
RDX: 0000000000000001 RSI: 00007f086a0fdbf0 RDI: 00000000000000fc
RBP: 0000000020000040 R08: 00000000000000fc R09: 0000000000000000
R10: 000000000000004a R11: 0000000000000293 R12: 00000000ffffffff
R13: 0000000000000653 R14: 00000000006fb868 R15: 0000000000000000

Allocated by task 8652:
 save_stack+0x43/0xd0 mm/kasan/kasan.c:447
 set_track mm/kasan/kasan.c:459 [inline]
 kasan_kmalloc+0xad/0xe0 mm/kasan/kasan.c:552
 __do_kmalloc mm/slab.c:3705 [inline]
 __kmalloc+0x162/0x760 mm/slab.c:3714
 kmalloc include/linux/slab.h:517 [inline]
 sk_prot_alloc+0x101/0x2a0 net/core/sock.c:1474
 sk_alloc+0x105/0x1440 net/core/sock.c:1528
 __netlink_create+0x6a/0x270 net/netlink/af_netlink.c:642
 netlink_create+0x2fb/0x500 net/netlink/af_netlink.c:704
 __sock_create+0x4d4/0x850 net/socket.c:1285
 sock_create net/socket.c:1325 [inline]
 SYSC_socket net/socket.c:1355 [inline]
 SyS_socket+0xeb/0x1d0 net/socket.c:1335
 do_syscall_64+0x281/0x940 arch/x86/entry/common.c:287
 entry_SYSCALL_64_after_hwframe+0x42/0xb7

Freed by task 5778:
 save_stack+0x43/0xd0 mm/kasan/kasan.c:447
 set_track mm/kasan/kasan.c:459 [inline]
 __kasan_slab_free+0x11a/0x170 mm/kasan/kasan.c:520
 kasan_slab_free+0xe/0x10 mm/kasan/kasan.c:527
 __cache_free mm/slab.c:3485 [inline]
 kfree+0xd9/0x260 mm/slab.c:3800
 sk_prot_free net/core/sock.c:1511 [inline]
 __sk_destruct+0x750/0x920 net/core/sock.c:1593
 sk_destruct+0x47/0x80 net/core/sock.c:1601
 __sk_free+0xf1/0x2b0 net/core/sock.c:1612
 sk_free+0x2a/0x40 net/core/sock.c:1623
 sock_put include/net/sock.h:1660 [inline]
 af_alg_release+0x5d/0x70 crypto/af_alg.c:126
 sock_release+0x8d/0x1e0 net/socket.c:594
 sock_close+0x16/0x20 net/socket.c:1149
 __fput+0x327/0x7e0 fs/file_table.c:209
 ____fput+0x15/0x20 fs/file_table.c:243
 task_work_run+0x199/0x270 kernel/task_work.c:113
 exit_task_work include/linux/task_work.h:22 [inline]
 do_exit+0x9bb/0x1ad0 kernel/exit.c:865
 do_group_exit+0x149/0x400 kernel/exit.c:968
 get_signal+0x73a/0x16d0 kernel/signal.c:2469
 do_signal+0x90/0x1e90 arch/x86/kernel/signal.c:809
 exit_to_usermode_loop+0x258/0x2f0 arch/x86/entry/common.c:162
 prepare_exit_to_usermode arch/x86/entry/common.c:196 [inline]
 syscall_return_slowpath arch/x86/entry/common.c:265 [inline]
 do_syscall_64+0x6ec/0x940 arch/x86/entry/common.c:292
 entry_SYSCALL_64_after_hwframe+0x42/0xb7

The buggy address belongs to the object at ffff8801c00c4200
 which belongs to the cache kmalloc-2048 of size 2048
The buggy address is located 1896 bytes inside of
 2048-byte region [ffff8801c00c4200, ffff8801c00c4a00)
The buggy address belongs to the page:
page:ffffea0007003100 count:1 mapcount:0 mapping:ffff8801c00c4200 index:0x0 compound_mapcount: 0
flags: 0x2fffc0000008100(slab|head)
raw: 02fffc0000008100 ffff8801c00c4200 0000000000000000 0000000100000003
raw: ffffea0006f4ea20 ffffea00074c3ba0 ffff8801dac00c40 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
 ffff8801c00c4800: 00 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc
 ffff8801c00c4880: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
>ffff8801c00c4900: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
                                                          ^
 ffff8801c00c4980: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
 ffff8801c00c4a00: 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
2018/03/30 04:23 net-next-old 56455e0998dd d47f0ed6 .config console log report ci-upstream-net-kasan-gce
* Struck through repros no longer work on HEAD.