================================================================== BUG: KASAN: use-after-free in instrument_atomic_read include/linux/instrumented.h:71 [inline] BUG: KASAN: use-after-free in atomic_read include/linux/atomic/atomic-instrumented.h:27 [inline] BUG: KASAN: use-after-free in refcount_read include/linux/refcount.h:147 [inline] BUG: KASAN: use-after-free in skb_unref include/linux/skbuff.h:1076 [inline] BUG: KASAN: use-after-free in consume_skb+0x27/0x110 net/core/skbuff.c:908 Read of size 4 at addr ffff8880793f385c by task syz-executor.0/16561 CPU: 1 PID: 16561 Comm: syz-executor.0 Not tainted 5.16.0-rc2-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x1dc/0x2d8 lib/dump_stack.c:106 print_address_description+0x65/0x380 mm/kasan/report.c:247 __kasan_report mm/kasan/report.c:433 [inline] kasan_report+0x19a/0x1f0 mm/kasan/report.c:450 kasan_check_range+0x2b5/0x2f0 mm/kasan/generic.c:189 instrument_atomic_read include/linux/instrumented.h:71 [inline] atomic_read include/linux/atomic/atomic-instrumented.h:27 [inline] refcount_read include/linux/refcount.h:147 [inline] skb_unref include/linux/skbuff.h:1076 [inline] consume_skb+0x27/0x110 net/core/skbuff.c:908 __sk_msg_free+0x788/0x820 net/core/skmsg.c:196 sk_msg_free net/core/skmsg.c:209 [inline] __sk_psock_purge_ingress_msg net/core/skmsg.c:748 [inline] __sk_psock_zap_ingress net/core/skmsg.c:766 [inline] sk_psock_stop+0x3f5/0x4a0 net/core/skmsg.c:784 sock_map_close+0x4a5/0x720 net/core/sock_map.c:1510 unix_release+0x7e/0xc0 net/unix/af_unix.c:948 __sock_release net/socket.c:649 [inline] sock_close+0xd8/0x260 net/socket.c:1314 __fput+0x3fc/0x870 fs/file_table.c:280 task_work_run+0x146/0x1c0 kernel/task_work.c:164 tracehook_notify_resume include/linux/tracehook.h:189 [inline] exit_to_user_mode_loop kernel/entry/common.c:175 [inline] exit_to_user_mode_prepare+0x209/0x220 kernel/entry/common.c:207 __syscall_exit_to_user_mode_work kernel/entry/common.c:289 [inline] syscall_exit_to_user_mode+0x2e/0x70 kernel/entry/common.c:300 do_syscall_64+0x53/0xd0 arch/x86/entry/common.c:86 entry_SYSCALL_64_after_hwframe+0x44/0xae RIP: 0033:0x7efcc6ebd72b Code: 0f 05 48 3d 00 f0 ff ff 77 45 c3 0f 1f 40 00 48 83 ec 18 89 7c 24 0c e8 63 fc ff ff 8b 7c 24 0c 41 89 c0 b8 03 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 35 44 89 c7 89 44 24 0c e8 a1 fc ff ff 8b 44 RSP: 002b:00007ffcc56e9280 EFLAGS: 00000293 ORIG_RAX: 0000000000000003 RAX: 0000000000000000 RBX: 0000000000000006 RCX: 00007efcc6ebd72b RDX: 0000000000000000 RSI: ffffffff8169ec15 RDI: 0000000000000005 RBP: 0000000000000001 R08: 0000000000000000 R09: 0000001b2c422df0 R10: 00000000000012bd R11: 0000000000000293 R12: 00007efcc701eb60 R13: 00007efcc701eb60 R14: 00007efcc701df60 R15: 000000000005677f Allocated by task 16573: kasan_save_stack mm/kasan/common.c:38 [inline] kasan_set_track mm/kasan/common.c:46 [inline] set_alloc_info mm/kasan/common.c:434 [inline] __kasan_slab_alloc+0xb6/0xf0 mm/kasan/common.c:467 kasan_slab_alloc include/linux/kasan.h:259 [inline] slab_post_alloc_hook mm/slab.h:519 [inline] slab_alloc_node mm/slub.c:3234 [inline] slab_alloc mm/slub.c:3242 [inline] kmem_cache_alloc+0x1c9/0x310 mm/slub.c:3247 skb_clone+0x1b4/0x360 net/core/skbuff.c:1521 sk_psock_verdict_recv+0x68/0x640 net/core/skmsg.c:1157 unix_read_sock+0x130/0x370 net/unix/af_unix.c:2420 sk_psock_verdict_data_ready+0x166/0x1e0 net/core/skmsg.c:1200 unix_dgram_sendmsg+0x19cc/0x2a50 net/unix/af_unix.c:1941 sock_sendmsg_nosec net/socket.c:704 [inline] sock_sendmsg net/socket.c:724 [inline] ____sys_sendmsg+0x5b9/0x910 net/socket.c:2409 ___sys_sendmsg net/socket.c:2463 [inline] __sys_sendmmsg+0x3ba/0x750 net/socket.c:2549 __do_sys_sendmmsg net/socket.c:2578 [inline] __se_sys_sendmmsg net/socket.c:2575 [inline] __x64_sys_sendmmsg+0x9c/0xb0 net/socket.c:2575 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x44/0xd0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x44/0xae Freed by task 8682: kasan_save_stack mm/kasan/common.c:38 [inline] kasan_set_track+0x4c/0x80 mm/kasan/common.c:46 kasan_set_free_info+0x1f/0x40 mm/kasan/generic.c:370 ____kasan_slab_free+0x10d/0x150 mm/kasan/common.c:366 kasan_slab_free include/linux/kasan.h:235 [inline] slab_free_hook mm/slub.c:1723 [inline] slab_free_freelist_hook+0x12e/0x1a0 mm/slub.c:1749 slab_free mm/slub.c:3513 [inline] kmem_cache_free+0xa4/0x180 mm/slub.c:3530 sock_drop include/linux/skmsg.h:310 [inline] sk_psock_backlog+0xf98/0x1130 net/core/skmsg.c:668 process_one_work+0x853/0x1140 kernel/workqueue.c:2298 worker_thread+0xac1/0x1320 kernel/workqueue.c:2445 kthread+0x468/0x490 kernel/kthread.c:327 ret_from_fork+0x1f/0x30 The buggy address belongs to the object at ffff8880793f3780 which belongs to the cache skbuff_head_cache of size 232 The buggy address is located 220 bytes inside of 232-byte region [ffff8880793f3780, ffff8880793f3868) The buggy address belongs to the page: page:ffffea0001e4fcc0 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x793f3 flags: 0xfff00000000200(slab|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000000200 ffffea0001b612c0 dead000000000003 ffff888015bcd640 raw: 0000000000000000 00000000000c000c 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 0, migratetype Unmovable, gfp_mask 0x12a20(GFP_ATOMIC|__GFP_NOWARN|__GFP_NORETRY), pid 922, ts 279129048740, free_ts 279047537364 prep_new_page mm/page_alloc.c:2418 [inline] get_page_from_freelist+0x729/0x9e0 mm/page_alloc.c:4149 __alloc_pages+0x255/0x580 mm/page_alloc.c:5369 alloc_slab_page mm/slub.c:1793 [inline] allocate_slab+0xcc/0x4d0 mm/slub.c:1930 new_slab mm/slub.c:1993 [inline] ___slab_alloc+0x41e/0xc40 mm/slub.c:3022 __slab_alloc mm/slub.c:3109 [inline] slab_alloc_node mm/slub.c:3200 [inline] kmem_cache_alloc_node+0x2bb/0x370 mm/slub.c:3270 __alloc_skb+0xd8/0x5a0 net/core/skbuff.c:414 alloc_skb include/linux/skbuff.h:1126 [inline] nsim_dev_trap_skb_build drivers/net/netdevsim/dev.c:745 [inline] nsim_dev_trap_report drivers/net/netdevsim/dev.c:802 [inline] nsim_dev_trap_report_work+0x264/0xaf0 drivers/net/netdevsim/dev.c:843 process_one_work+0x853/0x1140 kernel/workqueue.c:2298 worker_thread+0xac1/0x1320 kernel/workqueue.c:2445 kthread+0x468/0x490 kernel/kthread.c:327 ret_from_fork+0x1f/0x30 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1338 [inline] free_pcp_prepare+0xd1c/0xe00 mm/page_alloc.c:1389 free_unref_page_prepare mm/page_alloc.c:3309 [inline] free_unref_page_list+0x11f/0xa50 mm/page_alloc.c:3425 release_pages+0x15a7/0x17d0 mm/swap.c:980 tlb_batch_pages_flush mm/mmu_gather.c:49 [inline] tlb_flush_mmu_free mm/mmu_gather.c:242 [inline] tlb_flush_mmu+0x780/0x910 mm/mmu_gather.c:249 tlb_finish_mmu+0xcb/0x200 mm/mmu_gather.c:340 exit_mmap+0x3dd/0x6f0 mm/mmap.c:3172 __mmput+0x111/0x3a0 kernel/fork.c:1113 exit_mm+0x211/0x2f0 kernel/exit.c:507 do_exit+0x688/0x24f0 kernel/exit.c:819 do_group_exit+0x168/0x2d0 kernel/exit.c:929 get_signal+0x1740/0x2120 kernel/signal.c:2852 arch_do_signal_or_restart+0x9c/0x730 arch/x86/kernel/signal.c:868 handle_signal_work kernel/entry/common.c:148 [inline] exit_to_user_mode_loop kernel/entry/common.c:172 [inline] exit_to_user_mode_prepare+0x191/0x220 kernel/entry/common.c:207 __syscall_exit_to_user_mode_work kernel/entry/common.c:289 [inline] syscall_exit_to_user_mode+0x2e/0x70 kernel/entry/common.c:300 do_syscall_64+0x53/0xd0 arch/x86/entry/common.c:86 entry_SYSCALL_64_after_hwframe+0x44/0xae Memory state around the buggy address: ffff8880793f3700: fb fb fb fb fb fc fc fc fc fc fc fc fc fc fc fc ffff8880793f3780: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff8880793f3800: fb fb fb fb fb fb fb fb fb fb fb fb fb fc fc fc ^ ffff8880793f3880: fc fc fc fc fc fc fc fc fa fb fb fb fb fb fb fb ffff8880793f3900: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================