================================================================== BUG: KASAN: use-after-free in atomic_read include/generated/atomic-instrumented.h:26 [inline] BUG: KASAN: use-after-free in refcount_inc_not_zero_checked+0x90/0x2c0 lib/refcount.c:120 Read of size 4 at addr ffff8880904c13c0 by task syz-executor5/12063 CPU: 1 PID: 12063 Comm: syz-executor5 Not tainted 4.20.0-next-20190103 #5 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/generated/atomic-instrumented.h:26 [inline] refcount_inc_not_zero_checked+0x90/0x2c0 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+0x19ec/0x26c0 kernel/exit.c:867 do_group_exit+0x177/0x430 kernel/exit.c:970 get_signal+0x8b4/0x19b0 kernel/signal.c:2515 do_signal+0x91/0x1e80 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:0x457ec9 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:00007ff836fb7cf8 EFLAGS: 00000246 ORIG_RAX: 00000000000000ca RAX: fffffffffffffe00 RBX: 000000000073c048 RCX: 0000000000457ec9 RDX: 0000000000000000 RSI: 0000000000000080 RDI: 000000000073c048 RBP: 000000000073c040 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 000000000073c04c R13: 00007ffe9c2f39ff R14: 00007ff836fb89c0 R15: 000000000073c04c Allocated by task 19400: save_stack+0x45/0xd0 mm/kasan/common.c:73 set_track mm/kasan/common.c:85 [inline] kasan_kmalloc mm/kasan/common.c:482 [inline] kasan_kmalloc+0xcf/0xe0 mm/kasan/common.c:455 __do_kmalloc_node mm/slab.c:3671 [inline] __kmalloc_node_track_caller+0x4e/0x70 mm/slab.c:3685 __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] __ip_append_data.isra.0+0x27ea/0x3350 net/ipv4/ip_output.c:1005 ip_append_data.part.0+0xf2/0x170 net/ipv4/ip_output.c:1220 ip_append_data+0x6e/0x90 net/ipv4/ip_output.c:1209 raw_sendmsg+0x1235/0x2ad0 net/ipv4/raw.c:670 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 __sys_sendto+0x387/0x5f0 net/socket.c:1788 __do_sys_sendto net/socket.c:1800 [inline] __se_sys_sendto net/socket.c:1796 [inline] __x64_sys_sendto+0xe1/0x1a0 net/socket.c:1796 do_syscall_64+0x1a3/0x800 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x49/0xbe Freed by task 19399: 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:444 kasan_slab_free+0xe/0x10 mm/kasan/common.c:452 __cache_free mm/slab.c:3485 [inline] kfree+0xcf/0x230 mm/slab.c:3804 skb_free_head+0x93/0xb0 net/core/skbuff.c:553 skb_release_data+0x6a9/0x960 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 kfree_skb_list net/core/skbuff.c:668 [inline] skb_release_data+0x44e/0x960 net/core/skbuff.c:570 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 __skb_queue_purge include/linux/skbuff.h:2656 [inline] inet_sock_destruct+0x180/0x9b0 net/ipv4/af_inet.c:138 __sk_destruct+0xd2/0xa60 net/core/sock.c:1569 sk_destruct+0x7b/0x90 net/core/sock.c:1604 __sk_free+0xce/0x300 net/core/sock.c:1615 sk_free+0x42/0x50 net/core/sock.c:1626 sock_put include/net/sock.h:1707 [inline] sk_common_release+0x224/0x330 net/core/sock.c:3042 raw_close+0x22/0x30 net/ipv4/raw.c:708 inet_release+0x105/0x1f0 net/ipv4/af_inet.c:428 __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 tracehook_notify_resume include/linux/tracehook.h:188 [inline] exit_to_usermode_loop+0x32a/0x3b0 arch/x86/entry/common.c:166 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 The buggy address belongs to the object at ffff8880904c1340 which belongs to the cache kmalloc-2k of size 2048 The buggy address is located 128 bytes inside of 2048-byte region [ffff8880904c1340, ffff8880904c1b40) The buggy address belongs to the page: page:ffffea0002413000 count:1 mapcount:0 mapping:ffff88812c3f0c40 index:0x0 compound_mapcount: 0 flags: 0x1fffc0000010200(slab|head) raw: 01fffc0000010200 ffffea000225d608 ffffea00021a2408 ffff88812c3f0c40 raw: 0000000000000000 ffff8880904c0240 0000000100000003 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff8880904c1280: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ffff8880904c1300: fc fc fc fc fc fc fc fc fb fb fb fb fb fb fb fb >ffff8880904c1380: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff8880904c1400: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8880904c1480: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================