================================================================== BUG: KASAN: double-free in slab_free mm/slub.c:3534 [inline] BUG: KASAN: double-free in kfree+0xe2/0x4d0 mm/slub.c:4562 CPU: 0 PID: 5042 Comm: syz-executor.5 Not tainted 5.19.0-rc4-next-20220628-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 06/29/2022 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xcd/0x134 lib/dump_stack.c:106 print_address_description mm/kasan/report.c:317 [inline] print_report.cold+0x2ba/0x719 mm/kasan/report.c:433 kasan_report_invalid_free+0x8f/0x1a0 mm/kasan/report.c:462 ____kasan_slab_free+0x18b/0x1c0 mm/kasan/common.c:355 kasan_slab_free include/linux/kasan.h:200 [inline] slab_free_hook mm/slub.c:1754 [inline] slab_free_freelist_hook+0x8b/0x1c0 mm/slub.c:1780 slab_free mm/slub.c:3534 [inline] kfree+0xe2/0x4d0 mm/slub.c:4562 kfree_const+0x51/0x60 mm/util.c:41 free_prealloced_shrinker+0x32/0x160 mm/vmscan.c:658 destroy_unused_super.part.0+0x106/0x170 fs/super.c:185 destroy_unused_super fs/super.c:278 [inline] alloc_super+0x8bd/0xaa0 fs/super.c:277 sget_fc+0x13e/0x7c0 fs/super.c:530 vfs_get_super fs/super.c:1134 [inline] get_tree_nodev+0x24/0x1d0 fs/super.c:1169 vfs_get_tree+0x89/0x2f0 fs/super.c:1501 do_new_mount fs/namespace.c:3040 [inline] path_mount+0x1320/0x1fa0 fs/namespace.c:3370 do_mount fs/namespace.c:3383 [inline] __do_sys_mount fs/namespace.c:3591 [inline] __se_sys_mount fs/namespace.c:3568 [inline] __x64_sys_mount+0x27f/0x300 fs/namespace.c:3568 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x46/0xb0 RIP: 0033:0x7fa3d0c89199 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 b8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007fa3d1d02168 EFLAGS: 00000246 ORIG_RAX: 00000000000000a5 RAX: ffffffffffffffda RBX: 00007fa3d0d9bf60 RCX: 00007fa3d0c89199 RDX: 0000000020000180 RSI: 0000000020000100 RDI: 0000000000000000 RBP: 00007fa3d1d021d0 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000002 R13: 00007ffd9d93e73f R14: 00007fa3d1d02300 R15: 0000000000022000 Allocated by task 3641: kasan_save_stack+0x1e/0x40 mm/kasan/common.c:38 kasan_set_track mm/kasan/common.c:45 [inline] set_alloc_info mm/kasan/common.c:436 [inline] ____kasan_kmalloc mm/kasan/common.c:515 [inline] ____kasan_kmalloc mm/kasan/common.c:474 [inline] __kasan_kmalloc+0xa9/0xd0 mm/kasan/common.c:524 kmalloc include/linux/slab.h:600 [inline] kzalloc include/linux/slab.h:733 [inline] apparmor_sk_alloc_security+0x84/0x150 security/apparmor/lsm.c:812 security_sk_alloc+0x50/0xb0 security/security.c:2274 sk_prot_alloc+0xdd/0x290 net/core/sock.c:1979 sk_alloc+0x36/0x770 net/core/sock.c:2029 inet_create net/ipv4/af_inet.c:319 [inline] inet_create+0x395/0xea0 net/ipv4/af_inet.c:245 __sock_create+0x353/0x790 net/socket.c:1515 sock_create net/socket.c:1566 [inline] __sys_socket_create net/socket.c:1603 [inline] __sys_socket_create net/socket.c:1588 [inline] __sys_socket+0x12f/0x240 net/socket.c:1636 __do_sys_socket net/socket.c:1649 [inline] __se_sys_socket net/socket.c:1647 [inline] __x64_sys_socket+0x6f/0xb0 net/socket.c:1647 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x46/0xb0 Freed by task 5042: kasan_save_stack+0x1e/0x40 mm/kasan/common.c:38 kasan_set_track+0x21/0x30 mm/kasan/common.c:45 kasan_set_free_info+0x20/0x30 mm/kasan/generic.c:370 ____kasan_slab_free mm/kasan/common.c:366 [inline] ____kasan_slab_free+0x166/0x1c0 mm/kasan/common.c:328 kasan_slab_free include/linux/kasan.h:200 [inline] slab_free_hook mm/slub.c:1754 [inline] slab_free_freelist_hook+0x8b/0x1c0 mm/slub.c:1780 slab_free mm/slub.c:3534 [inline] kfree+0xe2/0x4d0 mm/slub.c:4562 kfree_const+0x51/0x60 mm/util.c:41 prealloc_shrinker+0x179/0x1b0 mm/vmscan.c:644 alloc_super+0x831/0xaa0 fs/super.c:268 sget_fc+0x13e/0x7c0 fs/super.c:530 vfs_get_super fs/super.c:1134 [inline] get_tree_nodev+0x24/0x1d0 fs/super.c:1169 vfs_get_tree+0x89/0x2f0 fs/super.c:1501 do_new_mount fs/namespace.c:3040 [inline] path_mount+0x1320/0x1fa0 fs/namespace.c:3370 do_mount fs/namespace.c:3383 [inline] __do_sys_mount fs/namespace.c:3591 [inline] __se_sys_mount fs/namespace.c:3568 [inline] __x64_sys_mount+0x27f/0x300 fs/namespace.c:3568 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x46/0xb0 The buggy address belongs to the object at ffff88801c374ba0 which belongs to the cache kmalloc-16 of size 16 The buggy address is located 0 bytes inside of 16-byte region [ffff88801c374ba0, ffff88801c374bb0) The buggy address belongs to the physical page: page:ffffea000070dd00 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1c374 flags: 0xfff00000000200(slab|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000000200 dead000000000100 dead000000000122 ffff8880118413c0 raw: 0000000000000000 0000000080800080 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 0x112cc0(GFP_USER|__GFP_NOWARN|__GFP_NORETRY), pid 3643, tgid 3643 (syz-executor.2), ts 303324701718, free_ts 303292655755 prep_new_page mm/page_alloc.c:2535 [inline] get_page_from_freelist+0x210d/0x3a30 mm/page_alloc.c:4282 __alloc_pages+0x1c7/0x510 mm/page_alloc.c:5506 __alloc_pages_node include/linux/gfp.h:583 [inline] alloc_slab_page mm/slub.c:1826 [inline] allocate_slab+0x80/0x3d0 mm/slub.c:1969 new_slab mm/slub.c:2029 [inline] ___slab_alloc+0x89d/0xef0 mm/slub.c:3031 __slab_alloc.constprop.0+0x4d/0xa0 mm/slub.c:3118 slab_alloc_node mm/slub.c:3209 [inline] __kmalloc_node+0x2e2/0x380 mm/slub.c:4468 kmalloc_node include/linux/slab.h:623 [inline] kvmalloc_node+0x3e/0x190 mm/util.c:581 xt_jumpstack_alloc net/netfilter/x_tables.c:1354 [inline] xt_replace_table+0x1a2/0x820 net/netfilter/x_tables.c:1393 __do_replace+0x1d7/0x890 net/ipv6/netfilter/ip6_tables.c:1084 do_replace net/ipv6/netfilter/ip6_tables.c:1157 [inline] do_ip6t_set_ctl+0x90d/0xb90 net/ipv6/netfilter/ip6_tables.c:1639 nf_setsockopt+0x83/0xe0 net/netfilter/nf_sockopt.c:101 ipv6_setsockopt+0x122/0x180 net/ipv6/ipv6_sockglue.c:1026 tcp_setsockopt+0x136/0x2520 net/ipv4/tcp.c:3740 __sys_setsockopt+0x2d6/0x690 net/socket.c:2251 __do_sys_setsockopt net/socket.c:2262 [inline] __se_sys_setsockopt net/socket.c:2259 [inline] __x64_sys_setsockopt+0xba/0x150 net/socket.c:2259 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1453 [inline] free_pcp_prepare+0x5e4/0xd20 mm/page_alloc.c:1503 free_unref_page_prepare mm/page_alloc.c:3383 [inline] free_unref_page+0x19/0x4d0 mm/page_alloc.c:3479 __unfreeze_partials+0x17c/0x1a0 mm/slub.c:2548 qlink_free mm/kasan/quarantine.c:168 [inline] qlist_free_all+0x6a/0x170 mm/kasan/quarantine.c:187 kasan_quarantine_reduce+0x180/0x200 mm/kasan/quarantine.c:294 __kasan_slab_alloc+0xa2/0xc0 mm/kasan/common.c:446 kasan_slab_alloc include/linux/kasan.h:224 [inline] slab_post_alloc_hook mm/slab.h:736 [inline] slab_alloc_node mm/slub.c:3243 [inline] kmem_cache_alloc_node_trace+0x303/0x410 mm/slub.c:3307 kmalloc_node include/linux/slab.h:618 [inline] kzalloc_node include/linux/slab.h:744 [inline] __get_vm_area_node+0xed/0x3f0 mm/vmalloc.c:2477 __vmalloc_node_range+0x250/0x13a0 mm/vmalloc.c:3156 __vmalloc_node mm/vmalloc.c:3261 [inline] vzalloc+0x67/0x80 mm/vmalloc.c:3334 do_ip6t_get_ctl+0x60f/0xa10 net/ipv6/netfilter/ip6_tables.c:817 nf_getsockopt+0x72/0xd0 net/netfilter/nf_sockopt.c:116 ipv6_getsockopt+0x1be/0x270 net/ipv6/ipv6_sockglue.c:1504 tcp_getsockopt+0x86/0xd0 net/ipv4/tcp.c:4338 __sys_getsockopt+0x216/0x690 net/socket.c:2295 __do_sys_getsockopt net/socket.c:2310 [inline] __se_sys_getsockopt net/socket.c:2307 [inline] __x64_sys_getsockopt+0xba/0x150 net/socket.c:2307 Memory state around the buggy address: ffff88801c374a80: fa fb fc fc fa fb fc fc fa fb fc fc 00 00 fc fc ffff88801c374b00: fb fb fc fc fb fb fc fc 00 00 fc fc fb fb fc fc >ffff88801c374b80: fb fb fc fc fa fb fc fc fa fb fc fc fa fb fc fc ^ ffff88801c374c00: fa fb fc fc fa fb fc fc 00 00 fc fc fa fb fc fc ffff88801c374c80: fa fb fc fc fa fb fc fc fa fb fc fc fa fb fc fc ==================================================================