================================================================== BUG: KASAN: use-after-free in atomic_read include/asm-generic/atomic-instrumented.h:21 [inline] BUG: KASAN: use-after-free in refcount_inc_not_zero_checked+0x91/0x2e0 lib/refcount.c:120 Read of size 4 at addr ffff88808c3db3c0 by task syz-executor5/25366 CPU: 0 PID: 25366 Comm: syz-executor5 Not tainted 5.0.0-rc3+ #40 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+0x1db/0x2d0 lib/dump_stack.c:113 print_address_description.cold+0x7c/0x20d mm/kasan/report.c:187 kasan_report.cold+0x1b/0x40 mm/kasan/report.c:317 check_memory_region_inline mm/kasan/generic.c:185 [inline] check_memory_region+0x123/0x190 mm/kasan/generic.c:191 kasan_check_read+0x11/0x20 mm/kasan/common.c:100 atomic_read include/asm-generic/atomic-instrumented.h:21 [inline] refcount_inc_not_zero_checked+0x91/0x2e0 lib/refcount.c:120 refcount_inc_checked+0x17/0x70 lib/refcount.c:153 sock_hold include/net/sock.h:647 [inline] nr_release+0x62/0x3c0 net/netrom/af_netrom.c:523 __sock_release+0xd3/0x250 net/socket.c:579 sock_close+0x1b/0x30 net/socket.c:1141 __fput+0x3c5/0xb10 fs/file_table.c:278 ____fput+0x16/0x20 fs/file_table.c:309 task_work_run+0x1f4/0x2b0 kernel/task_work.c:113 exit_task_work include/linux/task_work.h:22 [inline] do_exit+0xad7/0x26e0 kernel/exit.c:867 do_group_exit+0x177/0x430 kernel/exit.c:971 get_signal+0x8b4/0x19b0 kernel/signal.c:2517 do_signal+0x91/0x1ea0 arch/x86/kernel/signal.c:816 exit_to_usermode_loop+0x2f7/0x3b0 arch/x86/entry/common.c:162 prepare_exit_to_usermode arch/x86/entry/common.c:197 [inline] syscall_return_slowpath arch/x86/entry/common.c:268 [inline] do_syscall_64+0x696/0x800 arch/x86/entry/common.c:293 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x458099 Code: 6d 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 3b b7 fb ff c3 66 2e 0f 1f 84 00 00 00 00 RSP: 002b:00007fe4f1e76cf8 EFLAGS: 00000246 ORIG_RAX: 00000000000000ca RAX: fffffffffffffe00 RBX: 000000000073bfa8 RCX: 0000000000458099 RDX: 0000000000000000 RSI: 0000000000000080 RDI: 000000000073bfa8 RBP: 000000000073bfa0 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 000000000073bfac R13: 00007ffda9a8268f R14: 00007fe4f1e779c0 R15: 0000000000000001 Allocated by task 27943: save_stack+0x45/0xd0 mm/kasan/common.c:73 set_track mm/kasan/common.c:85 [inline] __kasan_kmalloc mm/kasan/common.c:496 [inline] __kasan_kmalloc.constprop.0+0xcf/0xe0 mm/kasan/common.c:469 kasan_kmalloc+0x9/0x10 mm/kasan/common.c:504 __do_kmalloc_node mm/slab.c:3673 [inline] __kmalloc_node_track_caller+0x4e/0x70 mm/slab.c:3687 __kmalloc_reserve.isra.0+0x40/0xe0 net/core/skbuff.c:140 __alloc_skb+0x12d/0x730 net/core/skbuff.c:208 alloc_skb include/linux/skbuff.h:1011 [inline] alloc_skb_with_frags+0xef/0x720 net/core/skbuff.c:5283 sock_alloc_send_pskb+0x8c9/0xad0 net/core/sock.c:2091 sock_alloc_send_skb+0x32/0x40 net/core/sock.c:2108 __ip6_append_data.isra.0+0x2556/0x3f20 net/ipv6/ip6_output.c:1443 ip6_append_data+0x1bd/0x2e0 net/ipv6/ip6_output.c:1619 icmp6_send+0x1d94/0x2d20 net/ipv6/icmp.c:578 icmpv6_send+0x17e/0x310 net/ipv6/ip6_icmp.c:43 ip6_link_failure+0x97/0x6d0 net/ipv6/route.c:2231 dst_link_failure include/net/dst.h:427 [inline] ip6_tnl_xmit+0x463/0x38c0 net/ipv6/ip6_tunnel.c:1227 ip6ip6_tnl_xmit net/ipv6/ip6_tunnel.c:1383 [inline] ip6_tnl_start_xmit+0xa03/0x2560 net/ipv6/ip6_tunnel.c:1409 __netdev_start_xmit include/linux/netdevice.h:4382 [inline] netdev_start_xmit include/linux/netdevice.h:4391 [inline] xmit_one net/core/dev.c:3278 [inline] dev_hard_start_xmit+0x261/0xc70 net/core/dev.c:3294 __dev_queue_xmit+0x2f8a/0x3a60 net/core/dev.c:3864 dev_queue_xmit+0x18/0x20 net/core/dev.c:3897 neigh_direct_output+0x16/0x20 net/core/neighbour.c:1516 neigh_output include/net/neighbour.h:508 [inline] ip6_finish_output2+0xc56/0x28e0 net/ipv6/ip6_output.c:120 ip6_fragment+0x2a70/0x3780 net/ipv6/ip6_output.c:727 ip6_finish_output+0x6aa/0xc30 net/ipv6/ip6_output.c:152 NF_HOOK_COND include/linux/netfilter.h:278 [inline] ip6_output+0x23c/0xa00 net/ipv6/ip6_output.c:171 dst_output include/net/dst.h:444 [inline] ip6_local_out+0xc4/0x1b0 net/ipv6/output_core.c:176 ip6_send_skb+0xbb/0x350 net/ipv6/ip6_output.c:1727 ip6_push_pending_frames+0xc8/0xf0 net/ipv6/ip6_output.c:1747 rawv6_push_pending_frames net/ipv6/raw.c:615 [inline] rawv6_sendmsg+0x39e6/0x49e0 net/ipv6/raw.c:945 inet_sendmsg+0x1af/0x740 net/ipv4/af_inet.c:798 sock_sendmsg_nosec net/socket.c:621 [inline] sock_sendmsg+0xdd/0x130 net/socket.c:631 sock_write_iter+0x379/0x5e0 net/socket.c:900 call_write_iter include/linux/fs.h:1862 [inline] new_sync_write fs/read_write.c:474 [inline] __vfs_write+0x764/0xb40 fs/read_write.c:487 vfs_write+0x20c/0x580 fs/read_write.c:549 ksys_write+0x105/0x260 fs/read_write.c:598 __do_sys_write fs/read_write.c:610 [inline] __se_sys_write fs/read_write.c:607 [inline] __x64_sys_write+0x73/0xb0 fs/read_write.c:607 do_syscall_64+0x1a3/0x800 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x49/0xbe Freed by task 27943: save_stack+0x45/0xd0 mm/kasan/common.c:73 set_track mm/kasan/common.c:85 [inline] __kasan_slab_free+0x102/0x150 mm/kasan/common.c:458 kasan_slab_free+0xe/0x10 mm/kasan/common.c:466 __cache_free mm/slab.c:3487 [inline] kfree+0xcf/0x230 mm/slab.c:3806 skb_free_head+0x93/0xb0 net/core/skbuff.c:553 skb_release_data+0x6ea/0x970 net/core/skbuff.c:573 skb_release_all+0x4d/0x60 net/core/skbuff.c:627 __kfree_skb net/core/skbuff.c:641 [inline] kfree_skb net/core/skbuff.c:659 [inline] kfree_skb+0x199/0x580 net/core/skbuff.c:653 icmpv6_rcv+0x7af/0x1c40 net/ipv6/icmp.c:927 ip6_protocol_deliver_rcu+0x3aa/0x1940 net/ipv6/ip6_input.c:394 ip6_input_finish+0x84/0x170 net/ipv6/ip6_input.c:434 NF_HOOK include/linux/netfilter.h:289 [inline] NF_HOOK include/linux/netfilter.h:283 [inline] ip6_input+0xf9/0x600 net/ipv6/ip6_input.c:443 dst_input include/net/dst.h:450 [inline] ip6_rcv_finish+0x177/0x330 net/ipv6/ip6_input.c:76 NF_HOOK include/linux/netfilter.h:289 [inline] NF_HOOK include/linux/netfilter.h:283 [inline] ipv6_rcv+0x113/0x650 net/ipv6/ip6_input.c:272 __netif_receive_skb_one_core+0x160/0x210 net/core/dev.c:4973 __netif_receive_skb+0x2c/0x1c0 net/core/dev.c:5083 process_backlog+0x206/0x750 net/core/dev.c:5923 napi_poll net/core/dev.c:6346 [inline] net_rx_action+0x76d/0x1930 net/core/dev.c:6412 __do_softirq+0x30b/0xb11 kernel/softirq.c:292 The buggy address belongs to the object at ffff88808c3db340 which belongs to the cache kmalloc-2k of size 2048 The buggy address is located 128 bytes inside of 2048-byte region [ffff88808c3db340, ffff88808c3dbb40) The buggy address belongs to the page: page:ffffea000230f680 count:1 mapcount:0 mapping:ffff88812c3f0c40 index:0xffff88808c3daac0 compound_mapcount: 0 flags: 0x1fffc0000010200(slab|head) raw: 01fffc0000010200 ffffea000255ac08 ffffea0001366f88 ffff88812c3f0c40 raw: ffff88808c3daac0 ffff88808c3da240 0000000100000002 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff88808c3db280: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ffff88808c3db300: fc fc fc fc fc fc fc fc fb fb fb fb fb fb fb fb >ffff88808c3db380: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88808c3db400: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88808c3db480: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================