================================================================== BUG: KASAN: slab-out-of-bounds in __ptr_ring_produce include/linux/ptr_ring.h:107 [inline] BUG: KASAN: slab-out-of-bounds in ptr_ring_produce include/linux/ptr_ring.h:130 [inline] BUG: KASAN: slab-out-of-bounds in skb_array_produce include/linux/skb_array.h:48 [inline] BUG: KASAN: slab-out-of-bounds in tun_net_xmit+0x10b8/0x1180 drivers/net/tun.c:920 Read of size 8 at addr ffff88015f853278 by task syz-executor.5/8706 CPU: 0 PID: 8706 Comm: syz-executor.5 Not tainted 4.9.141+ #1 ffff88014e0e7098 ffffffff81b42e79 ffffea00057e14c0 ffff88015f853278 0000000000000000 ffff88015f853278 ffff8801a45c4108 ffff88014e0e70d0 ffffffff815009b8 ffff88015f853278 0000000000000008 0000000000000000 Call Trace: [] __dump_stack lib/dump_stack.c:15 [inline] [] dump_stack+0xc1/0x128 lib/dump_stack.c:51 [] print_address_description+0x6c/0x234 mm/kasan/report.c:256 [] kasan_report_error mm/kasan/report.c:355 [inline] [] kasan_report.cold.6+0x242/0x2fe mm/kasan/report.c:412 [] __asan_report_load8_noabort+0x14/0x20 mm/kasan/report.c:433 [] __ptr_ring_produce include/linux/ptr_ring.h:107 [inline] [] ptr_ring_produce include/linux/ptr_ring.h:130 [inline] [] skb_array_produce include/linux/skb_array.h:48 [inline] [] tun_net_xmit+0x10b8/0x1180 drivers/net/tun.c:920 [] __netdev_start_xmit include/linux/netdevice.h:4069 [inline] [] netdev_start_xmit include/linux/netdevice.h:4078 [inline] [] xmit_one net/core/dev.c:2977 [inline] [] dev_hard_start_xmit+0x197/0x8b0 net/core/dev.c:2993 [] sch_direct_xmit+0x2b3/0x580 net/sched/sch_generic.c:182 [] __dev_xmit_skb net/core/dev.c:3173 [inline] [] __dev_queue_xmit+0x152e/0x1b90 net/core/dev.c:3441 [] dev_queue_xmit+0x17/0x20 net/core/dev.c:3506 [] neigh_direct_output+0x15/0x20 net/core/neighbour.c:1365 [] dst_neigh_output include/net/dst.h:470 [inline] [] ip_finish_output2+0x8f0/0x1100 net/ipv4/ip_output.c:225 [] ip_finish_output+0x3b5/0xc90 net/ipv4/ip_output.c:313 [] NF_HOOK_COND include/linux/netfilter.h:246 [inline] [] ip_output+0x1cd/0x550 net/ipv4/ip_output.c:401 [] dst_output include/net/dst.h:507 [inline] [] ip_local_out+0x9b/0x180 net/ipv4/ip_output.c:124 [] ip_send_skb+0x3c/0xc0 net/ipv4/ip_output.c:1489 [] udp_send_skb+0x500/0xc70 net/ipv4/udp.c:833 [] udp_sendmsg+0x1622/0x1c60 net/ipv4/udp.c:1057 [] inet_sendmsg+0x203/0x4d0 net/ipv4/af_inet.c:770 [] sock_sendmsg_nosec net/socket.c:648 [inline] [] sock_sendmsg+0xbb/0x110 net/socket.c:658 [] ___sys_sendmsg+0x47a/0x840 net/socket.c:1982 [] __sys_sendmmsg+0x161/0x3d0 net/socket.c:2072 [] SYSC_sendmmsg net/socket.c:2103 [inline] [] SyS_sendmmsg+0x35/0x60 net/socket.c:2098 [] do_syscall_64+0x19f/0x550 arch/x86/entry/common.c:285 [] entry_SYSCALL_64_after_swapgs+0x5d/0xdb Allocated by task 8620: save_stack_trace+0x16/0x20 arch/x86/kernel/stacktrace.c:57 save_stack mm/kasan/kasan.c:505 [inline] set_track mm/kasan/kasan.c:517 [inline] kasan_kmalloc.part.1+0x62/0xf0 mm/kasan/kasan.c:609 kasan_kmalloc+0xaf/0xc0 mm/kasan/kasan.c:594 __kmalloc+0x12f/0x310 mm/slub.c:3741 kmalloc_array include/linux/slab.h:582 [inline] kcalloc include/linux/slab.h:593 [inline] __ptr_ring_init_queue_alloc include/linux/ptr_ring.h:356 [inline] ptr_ring_resize_multiple include/linux/ptr_ring.h:445 [inline] skb_array_resize_multiple include/linux/skb_array.h:169 [inline] tun_queue_resize drivers/net/tun.c:2523 [inline] tun_device_event+0x3e0/0xa00 drivers/net/tun.c:2541 notifier_call_chain+0xb4/0x1d0 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+0x55/0x70 net/core/dev.c:1647 call_netdevice_notifiers+0x70/0xa0 net/core/dev.c:1663 do_setlink+0xc55/0x2ef0 net/core/rtnetlink.c:2052 rtnl_group_changelink net/core/rtnetlink.c:2423 [inline] rtnl_newlink+0xbd0/0x1550 net/core/rtnetlink.c:2571 rtnetlink_rcv_msg+0x49c/0x650 net/core/rtnetlink.c:4078 netlink_rcv_skb+0x145/0x370 net/netlink/af_netlink.c:2365 rtnetlink_rcv+0x2a/0x40 net/core/rtnetlink.c:4084 netlink_unicast_kernel net/netlink/af_netlink.c:1285 [inline] netlink_unicast+0x4d8/0x6d0 net/netlink/af_netlink.c:1311 netlink_sendmsg+0x694/0xc30 net/netlink/af_netlink.c:1859 sock_sendmsg_nosec net/socket.c:648 [inline] sock_sendmsg+0xbb/0x110 net/socket.c:658 ___sys_sendmsg+0x6fc/0x840 net/socket.c:1982 __sys_sendmsg+0xd9/0x190 net/socket.c:2016 SYSC_sendmsg net/socket.c:2027 [inline] SyS_sendmsg+0x2d/0x50 net/socket.c:2023 do_syscall_64+0x19f/0x550 arch/x86/entry/common.c:285 entry_SYSCALL_64_after_swapgs+0x5d/0xdb Freed by task 2099: save_stack_trace+0x16/0x20 arch/x86/kernel/stacktrace.c:57 save_stack mm/kasan/kasan.c:505 [inline] set_track mm/kasan/kasan.c:517 [inline] kasan_slab_free+0xac/0x190 mm/kasan/kasan.c:582 slab_free_hook mm/slub.c:1355 [inline] slab_free_freelist_hook mm/slub.c:1377 [inline] slab_free mm/slub.c:2958 [inline] kfree+0xfb/0x310 mm/slub.c:3878 kvfree+0x4b/0x60 mm/util.c:356 __vunmap+0x295/0x400 mm/vmalloc.c:1518 vfree+0x50/0x110 mm/vmalloc.c:1552 copy_entries_to_user net/ipv4/netfilter/arp_tables.c:720 [inline] get_entries net/ipv4/netfilter/arp_tables.c:874 [inline] do_arpt_get_ctl+0x763/0x860 net/ipv4/netfilter/arp_tables.c:1496 nf_sockopt net/netfilter/nf_sockopt.c:103 [inline] nf_getsockopt+0x70/0xd0 net/netfilter/nf_sockopt.c:121 ip_getsockopt+0x127/0x170 net/ipv4/ip_sockglue.c:1557 tcp_getsockopt+0x88/0xe0 net/ipv4/tcp.c:3106 sock_common_getsockopt+0x9a/0xe0 net/core/sock.c:2665 SYSC_getsockopt net/socket.c:1816 [inline] SyS_getsockopt+0x150/0x240 net/socket.c:1798 do_syscall_64+0x19f/0x550 arch/x86/entry/common.c:285 entry_SYSCALL_64_after_swapgs+0x5d/0xdb The buggy address belongs to the object at ffff88015f853270 which belongs to the cache kmalloc-8 of size 8 The buggy address is located 0 bytes to the right of 8-byte region [ffff88015f853270, ffff88015f853278) The buggy address belongs to the page: page:ffffea00057e14c0 count:1 mapcount:0 mapping: (null) index:0xffff88015f853258 flags: 0x4000000000000080(slab) page dumped because: kasan: bad access detected Memory state around the buggy address: ffff88015f853100: fc 00 fc fc 00 fc fc 00 fc fc fb fc fc fb fc fc ffff88015f853180: fb fc fc fb fc fc fb fc fc fb fc fc fb fc fc 00 >ffff88015f853200: fc fc 00 fc fc 00 fc fc fb fc fc fb fc fc 00 fc ^ ffff88015f853280: fc 00 fc fc 00 fc fc 00 fc fc 00 fc fc 00 fc fc ffff88015f853300: 00 fc fc fb fc fc fb fc fc fb fc fc fb fc fc 00 ==================================================================