================================================================== BUG: KASAN: slab-use-after-free in instrument_atomic_read_write include/linux/instrumented.h:96 [inline] BUG: KASAN: slab-use-after-free in atomic_fetch_sub_release include/linux/atomic/atomic-instrumented.h:400 [inline] BUG: KASAN: slab-use-after-free in __refcount_sub_and_test include/linux/refcount.h:389 [inline] BUG: KASAN: slab-use-after-free in __refcount_dec_and_test include/linux/refcount.h:432 [inline] BUG: KASAN: slab-use-after-free in refcount_dec_and_test include/linux/refcount.h:450 [inline] BUG: KASAN: slab-use-after-free in skb_unref include/linux/skbuff.h:1249 [inline] BUG: KASAN: slab-use-after-free in __sk_skb_reason_drop net/core/skbuff.c:1185 [inline] BUG: KASAN: slab-use-after-free in sk_skb_reason_drop+0x37/0x170 net/core/skbuff.c:1213 Write of size 4 at addr ffff888042e8fd64 by task syz.0.0/5333 CPU: 0 UID: 0 PID: 5333 Comm: syz.0.0 Not tainted 6.15.0-rc7-syzkaller-00082-g5cdb2c77c4c3 #0 PREEMPT(full) Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2~bpo12+1 04/01/2014 Call Trace: dump_stack_lvl+0x189/0x250 lib/dump_stack.c:120 print_address_description mm/kasan/report.c:408 [inline] print_report+0xb4/0x290 mm/kasan/report.c:521 kasan_report+0x118/0x150 mm/kasan/report.c:634 check_region_inline mm/kasan/generic.c:-1 [inline] kasan_check_range+0x29a/0x2b0 mm/kasan/generic.c:189 instrument_atomic_read_write include/linux/instrumented.h:96 [inline] atomic_fetch_sub_release include/linux/atomic/atomic-instrumented.h:400 [inline] __refcount_sub_and_test include/linux/refcount.h:389 [inline] __refcount_dec_and_test include/linux/refcount.h:432 [inline] refcount_dec_and_test include/linux/refcount.h:450 [inline] skb_unref include/linux/skbuff.h:1249 [inline] __sk_skb_reason_drop net/core/skbuff.c:1185 [inline] sk_skb_reason_drop+0x37/0x170 net/core/skbuff.c:1213 kfree_skb_reason include/linux/skbuff.h:1279 [inline] kfree_skb include/linux/skbuff.h:1288 [inline] nr_transmit_buffer+0x11d/0x1b0 net/netrom/nr_out.c:210 nr_establish_data_link+0x62/0xb0 net/netrom/nr_out.c:227 nr_connect+0x6e6/0xde0 net/netrom/af_netrom.c:723 __sys_connect_file net/socket.c:2038 [inline] __sys_connect+0x316/0x440 net/socket.c:2057 __do_sys_connect net/socket.c:2063 [inline] __se_sys_connect net/socket.c:2060 [inline] __x64_sys_connect+0x7a/0x90 net/socket.c:2060 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xf6/0x210 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7f0ae838e969 Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 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 73 01 c3 48 c7 c1 a8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f0ae91b2038 EFLAGS: 00000246 ORIG_RAX: 000000000000002a RAX: ffffffffffffffda RBX: 00007f0ae85b6080 RCX: 00007f0ae838e969 RDX: 0000000000000048 RSI: 0000200000000300 RDI: 0000000000000005 RBP: 00007f0ae8410ab1 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000000 R14: 00007f0ae85b6080 R15: 00007ffce82237b8 Allocated by task 5333: kasan_save_stack mm/kasan/common.c:47 [inline] kasan_save_track+0x3e/0x80 mm/kasan/common.c:68 unpoison_slab_object mm/kasan/common.c:319 [inline] __kasan_slab_alloc+0x6c/0x80 mm/kasan/common.c:345 kasan_slab_alloc include/linux/kasan.h:250 [inline] slab_post_alloc_hook mm/slub.c:4147 [inline] slab_alloc_node mm/slub.c:4196 [inline] kmem_cache_alloc_node_noprof+0x1bb/0x3c0 mm/slub.c:4248 __alloc_skb+0x112/0x2d0 net/core/skbuff.c:658 alloc_skb include/linux/skbuff.h:1340 [inline] nr_write_internal+0xe2/0xc60 net/netrom/nr_subr.c:144 nr_establish_data_link+0x62/0xb0 net/netrom/nr_out.c:227 nr_connect+0x6e6/0xde0 net/netrom/af_netrom.c:723 __sys_connect_file net/socket.c:2038 [inline] __sys_connect+0x316/0x440 net/socket.c:2057 __do_sys_connect net/socket.c:2063 [inline] __se_sys_connect net/socket.c:2060 [inline] __x64_sys_connect+0x7a/0x90 net/socket.c:2060 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xf6/0x210 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f Freed by task 5333: kasan_save_stack mm/kasan/common.c:47 [inline] kasan_save_track+0x3e/0x80 mm/kasan/common.c:68 kasan_save_free_info+0x46/0x50 mm/kasan/generic.c:576 poison_slab_object mm/kasan/common.c:247 [inline] __kasan_slab_free+0x62/0x70 mm/kasan/common.c:264 kasan_slab_free include/linux/kasan.h:233 [inline] slab_free_hook mm/slub.c:2380 [inline] slab_free mm/slub.c:4642 [inline] kmem_cache_free+0x192/0x3f0 mm/slub.c:4744 kfree_skb_reason include/linux/skbuff.h:1279 [inline] kfree_skb include/linux/skbuff.h:1288 [inline] nr_route_frame+0x467/0x7e0 net/netrom/nr_route.c:820 nr_transmit_buffer+0xe7/0x1b0 net/netrom/nr_out.c:209 nr_establish_data_link+0x62/0xb0 net/netrom/nr_out.c:227 nr_connect+0x6e6/0xde0 net/netrom/af_netrom.c:723 __sys_connect_file net/socket.c:2038 [inline] __sys_connect+0x316/0x440 net/socket.c:2057 __do_sys_connect net/socket.c:2063 [inline] __se_sys_connect net/socket.c:2060 [inline] __x64_sys_connect+0x7a/0x90 net/socket.c:2060 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xf6/0x210 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f The buggy address belongs to the object at ffff888042e8fc80 which belongs to the cache skbuff_head_cache of size 240 The buggy address is located 228 bytes inside of freed 240-byte region [ffff888042e8fc80, ffff888042e8fd70) The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x42e8f ksm flags: 0x4fff00000000000(node=1|zone=1|lastcpupid=0x7ff) page_type: f5(slab) raw: 04fff00000000000 ffff888030ae68c0 ffffea00010cd200 0000000000000003 raw: 0000000000000000 00000000800c000c 00000000f5000000 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 0x52cc0(GFP_KERNEL|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP), pid 5015, tgid 5015 (dhcpcd), ts 134291335621, free_ts 133946729063 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x1d8/0x230 mm/page_alloc.c:1714 prep_new_page mm/page_alloc.c:1722 [inline] get_page_from_freelist+0x21ce/0x22b0 mm/page_alloc.c:3684 __alloc_frozen_pages_noprof+0x181/0x370 mm/page_alloc.c:4966 alloc_pages_mpol+0x232/0x4a0 mm/mempolicy.c:2301 alloc_slab_page mm/slub.c:2450 [inline] allocate_slab+0x8a/0x3b0 mm/slub.c:2618 new_slab mm/slub.c:2672 [inline] ___slab_alloc+0xbfc/0x1480 mm/slub.c:3858 __slab_alloc mm/slub.c:3948 [inline] __slab_alloc_node mm/slub.c:4023 [inline] slab_alloc_node mm/slub.c:4184 [inline] kmem_cache_alloc_node_noprof+0x280/0x3c0 mm/slub.c:4248 __alloc_skb+0x112/0x2d0 net/core/skbuff.c:658 alloc_skb include/linux/skbuff.h:1340 [inline] alloc_skb_with_frags+0xca/0x890 net/core/skbuff.c:6639 sock_alloc_send_pskb+0x857/0x990 net/core/sock.c:2954 unix_dgram_sendmsg+0x5c2/0x17c0 net/unix/af_unix.c:2007 sock_sendmsg_nosec net/socket.c:712 [inline] __sock_sendmsg+0x21c/0x270 net/socket.c:727 sock_write_iter+0x258/0x330 net/socket.c:1131 do_iter_readv_writev+0x56e/0x7f0 fs/read_write.c:-1 vfs_writev+0x306/0x9a0 fs/read_write.c:1055 do_writev+0x14d/0x2d0 fs/read_write.c:1101 page last free pid 5304 tgid 5304 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1258 [inline] __free_frozen_pages+0xb0e/0xcd0 mm/page_alloc.c:2721 rcu_do_batch kernel/rcu/tree.c:2568 [inline] rcu_core+0xca8/0x1710 kernel/rcu/tree.c:2824 handle_softirqs+0x286/0x870 kernel/softirq.c:579 do_softirq+0xec/0x180 kernel/softirq.c:480 __local_bh_enable_ip+0x17d/0x1c0 kernel/softirq.c:407 local_bh_enable include/linux/bottom_half.h:33 [inline] fpregs_unlock arch/x86/include/asm/fpu/api.h:77 [inline] kernel_fpu_end+0xd2/0x120 arch/x86/kernel/fpu/core.c:460 _sha256_update arch/x86/crypto/sha256_ssse3_glue.c:75 [inline] sha256_avx2_update+0x129/0x200 arch/x86/crypto/sha256_ssse3_glue.c:256 ima_calc_file_hash_tfm security/integrity/ima/ima_crypto.c:491 [inline] ima_calc_file_shash security/integrity/ima/ima_crypto.c:511 [inline] ima_calc_file_hash+0x1567/0x18d0 security/integrity/ima/ima_crypto.c:568 ima_collect_measurement+0x42e/0x8e0 security/integrity/ima/ima_api.c:293 process_measurement+0x1121/0x1a40 security/integrity/ima/ima_main.c:385 ima_file_check+0xd7/0x120 security/integrity/ima/ima_main.c:613 security_file_post_open+0xbb/0x290 security/security.c:3130 do_open fs/namei.c:3882 [inline] path_openat+0x2f26/0x3830 fs/namei.c:4039 do_filp_open+0x1fa/0x410 fs/namei.c:4066 file_open_name+0x159/0x1a0 fs/open.c:1373 __do_sys_swapon mm/swapfile.c:3308 [inline] __se_sys_swapon+0x990/0x1e70 mm/swapfile.c:3266 Memory state around the buggy address: ffff888042e8fc00: fb fb fb fb fb fb fc fc fc fc fc fc fc fc fc fc ffff888042e8fc80: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff888042e8fd00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fc fc ^ ffff888042e8fd80: fc fc fc fc fc fc fc fc 00 00 00 00 00 00 00 00 ffff888042e8fe00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ==================================================================