================================================================== BUG: KASAN: double-free or invalid-free in slab_free mm/slub.c:3204 [inline] BUG: KASAN: double-free or invalid-free in kfree+0xd5/0x320 mm/slub.c:4192 CPU: 1 PID: 1840 Comm: syz-executor.0 Tainted: G W 5.10.76-syzkaller-01178-g4944ec82ebb9 #0 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_lvl+0x1e2/0x24b lib/dump_stack.c:118 print_address_description+0x8d/0x3d0 mm/kasan/report.c:233 kasan_report_invalid_free+0x58/0x130 mm/kasan/report.c:358 ____kasan_slab_free+0x14b/0x170 mm/kasan/common.c:362 __kasan_slab_free+0x11/0x20 mm/kasan/common.c:368 kasan_slab_free include/linux/kasan.h:235 [inline] slab_free_hook mm/slub.c:1596 [inline] slab_free_freelist_hook+0xcc/0x1a0 mm/slub.c:1622 slab_free mm/slub.c:3204 [inline] kfree+0xd5/0x320 mm/slub.c:4192 __io_queue_deferred fs/io_uring.c:1541 [inline] io_commit_cqring+0x76a/0xa00 fs/io_uring.c:1587 io_iopoll_complete fs/io_uring.c:2378 [inline] io_do_iopoll+0x1e18/0x23f0 fs/io_uring.c:2431 io_iopoll_try_reap_events+0x116/0x290 fs/io_uring.c:2470 io_ring_ctx_wait_and_kill+0x295/0x670 fs/io_uring.c:8575 io_uring_release+0x5b/0x70 fs/io_uring.c:8602 __fput+0x348/0x7d0 fs/file_table.c:281 ____fput+0x15/0x20 fs/file_table.c:314 task_work_run+0x147/0x1b0 kernel/task_work.c:154 exit_task_work include/linux/task_work.h:30 [inline] do_exit+0x70e/0x23a0 kernel/exit.c:813 do_group_exit+0x16a/0x2d0 kernel/exit.c:910 get_signal+0x133e/0x1f80 kernel/signal.c:2790 arch_do_signal+0x8d/0x620 arch/x86/kernel/signal.c:805 exit_to_user_mode_loop kernel/entry/common.c:161 [inline] exit_to_user_mode_prepare+0xaa/0xe0 kernel/entry/common.c:191 syscall_exit_to_user_mode+0x24/0x40 kernel/entry/common.c:266 do_syscall_64+0x3d/0x70 arch/x86/entry/common.c:56 entry_SYSCALL_64_after_hwframe+0x44/0xa9 RIP: 0033:0x7f3f591d8ae9 Code: Unable to access opcode bytes at RIP 0x7f3f591d8abf. RSP: 002b:00007f3f56f4f188 EFLAGS: 00000246 ORIG_RAX: 0000000000000101 RAX: fffffffffffffffe RBX: 00007f3f592ebf60 RCX: 00007f3f591d8ae9 RDX: 0000000000000000 RSI: 0000000020002040 RDI: ffffffffffffff9c RBP: 00007f3f59232f25 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007fff463ce98f R14: 00007f3f56f4f300 R15: 0000000000022000 Allocated by task 1840: 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:428 [inline] ____kasan_kmalloc+0xdc/0x110 mm/kasan/common.c:507 __kasan_kmalloc+0x9/0x10 mm/kasan/common.c:516 kasan_kmalloc include/linux/kasan.h:269 [inline] kmem_cache_alloc_trace+0x210/0x3a0 mm/slub.c:2975 kmalloc include/linux/slab.h:552 [inline] io_req_defer+0x40e/0x11b0 fs/io_uring.c:5921 io_queue_sqe+0x2a/0x1180 fs/io_uring.c:6397 io_submit_sqe+0x385/0xfd0 fs/io_uring.c:6487 io_submit_sqes+0x1050/0x2da0 fs/io_uring.c:6715 __do_sys_io_uring_enter fs/io_uring.c:9110 [inline] __se_sys_io_uring_enter+0x322/0x12b0 fs/io_uring.c:9052 __x64_sys_io_uring_enter+0xe5/0x100 fs/io_uring.c:9052 do_syscall_64+0x31/0x70 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x44/0xa9 Freed by task 1841: kasan_save_stack mm/kasan/common.c:38 [inline] kasan_set_track+0x4c/0x80 mm/kasan/common.c:46 kasan_set_free_info+0x23/0x40 mm/kasan/generic.c:357 ____kasan_slab_free+0x133/0x170 mm/kasan/common.c:360 __kasan_slab_free+0x11/0x20 mm/kasan/common.c:368 kasan_slab_free include/linux/kasan.h:235 [inline] slab_free_hook mm/slub.c:1596 [inline] slab_free_freelist_hook+0xcc/0x1a0 mm/slub.c:1622 slab_free mm/slub.c:3204 [inline] kfree+0xd5/0x320 mm/slub.c:4192 __io_queue_deferred fs/io_uring.c:1541 [inline] io_commit_cqring+0x76a/0xa00 fs/io_uring.c:1587 __io_req_task_cancel+0x64/0x720 fs/io_uring.c:2065 io_req_task_cancel+0x51/0x130 fs/io_uring.c:2078 task_work_run+0x147/0x1b0 kernel/task_work.c:154 io_wq_manager+0x1aa/0x8b0 fs/io-wq.c:797 kthread+0x371/0x390 kernel/kthread.c:313 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:296 The buggy address belongs to the object at ffff888112a267c0 which belongs to the cache kmalloc-32 of size 32 The buggy address is located 0 bytes inside of 32-byte region [ffff888112a267c0, ffff888112a267e0) The buggy address belongs to the page: page:ffffea00044a8980 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x112a26 flags: 0x8000000000000200(slab) raw: 8000000000000200 0000000000000000 0000000100000001 ffff888100043980 raw: 0000000000000000 0000000000400040 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 0x12cc0(GFP_KERNEL|__GFP_NOWARN|__GFP_NORETRY), pid 163, ts 3901514552, free_ts 0 set_page_owner include/linux/page_owner.h:35 [inline] post_alloc_hook mm/page_alloc.c:2385 [inline] prep_new_page mm/page_alloc.c:2391 [inline] get_page_from_freelist+0xa74/0xa90 mm/page_alloc.c:4063 __alloc_pages_nodemask+0x3c8/0x820 mm/page_alloc.c:5106 alloc_slab_page mm/slub.c:1807 [inline] allocate_slab+0x6b/0x350 mm/slub.c:1809 new_slab mm/slub.c:1870 [inline] new_slab_objects mm/slub.c:2629 [inline] ___slab_alloc+0x143/0x2f0 mm/slub.c:2792 __slab_alloc mm/slub.c:2832 [inline] slab_alloc_node mm/slub.c:2914 [inline] slab_alloc mm/slub.c:2956 [inline] __kmalloc_track_caller+0x299/0x3b0 mm/slub.c:4535 kstrdup+0x34/0x70 mm/util.c:63 security_context_to_sid_core+0x153/0x870 security/selinux/ss/services.c:1554 security_context_to_sid_force+0x38/0x50 security/selinux/ss/services.c:1647 selinux_inode_post_setxattr+0x12d/0x510 security/selinux/hooks.c:3297 security_inode_post_setxattr+0xcc/0x140 security/security.c:1286 __vfs_setxattr_noperm+0x394/0x4e0 fs/xattr.c:211 __vfs_setxattr_locked+0x1f9/0x210 fs/xattr.c:266 vfs_setxattr+0x11e/0x2d0 fs/xattr.c:283 setxattr+0x1ea/0x3f0 fs/xattr.c:548 path_setxattr+0x164/0x240 fs/xattr.c:567 __do_sys_lsetxattr fs/xattr.c:589 [inline] __se_sys_lsetxattr fs/xattr.c:585 [inline] __x64_sys_lsetxattr+0xc2/0xe0 fs/xattr.c:585 page_owner free stack trace missing Memory state around the buggy address: ffff888112a26680: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc ffff888112a26700: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc >ffff888112a26780: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc ^ ffff888112a26800: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc ffff888112a26880: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc ==================================================================