================================================================== BUG: KASAN: double-free in rcu_free_sheaf+0x1a/0xe0 mm/slub.c:6182 Free of addr ffff888014e51e80 by task syz-executor/24293 CPU: 2 UID: 0 PID: 24293 Comm: syz-executor Tainted: G L syzkaller #0 PREEMPT(full) Tainted: [L]=SOFTLOCKUP Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014 Call Trace: __dump_stack lib/dump_stack.c:94 [inline] dump_stack_lvl+0x100/0x190 lib/dump_stack.c:120 print_address_description mm/kasan/report.c:378 [inline] print_report+0x13d/0x4b0 mm/kasan/report.c:482 kasan_report_invalid_free+0xb8/0x190 mm/kasan/report.c:557 check_slab_allocation+0xc3/0xf0 mm/kasan/common.c:246 kasan_slab_pre_free include/linux/kasan.h:199 [inline] slab_free_hook mm/slub.c:2725 [inline] __rcu_free_sheaf_prepare+0x117/0x300 mm/slub.c:3041 rcu_free_sheaf+0x1a/0xe0 mm/slub.c:6182 rcu_do_batch kernel/rcu/tree.c:2650 [inline] rcu_core+0x5f0/0x1220 kernel/rcu/tree.c:2919 handle_softirqs+0x216/0xa20 kernel/softirq.c:669 __do_softirq kernel/softirq.c:703 [inline] invoke_softirq kernel/softirq.c:542 [inline] __irq_exit_rcu+0x178/0x220 kernel/softirq.c:786 irq_exit_rcu+0x9/0x30 kernel/softirq.c:809 instr_sysvec_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1062 [inline] sysvec_apic_timer_interrupt+0xa3/0xc0 arch/x86/kernel/apic/apic.c:1062 asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:674 RIP: 0010:bitmap_intersects include/linux/bitmap.h:447 [inline] RIP: 0010:vma_flags_test_any_mask include/linux/mm.h:1122 [inline] RIP: 0010:vma_flags_test_single_mask include/linux/mm.h:1168 [inline] RIP: 0010:vma_test_single_mask include/linux/mm.h:1328 [inline] RIP: 0010:userfaultfd_rwp+0xbc/0x120 include/linux/userfaultfd_k.h:217 Code: 89 c5 89 c6 e8 e5 7e a5 ff 41 83 fd 01 7f 67 e8 6a 84 a5 ff 49 8d 7c 24 20 48 b8 00 00 00 00 00 fc ff df 48 89 fa 48 c1 ea 03 <80> 3c 02 00 75 51 49 23 5c 24 20 31 ff 48 89 de e8 df 7e a5 ff 48 RSP: 0018:ffffc9000320f480 EFLAGS: 00000a06 RAX: dffffc0000000000 RBX: 0000080000000000 RCX: 0000000000000002 RDX: 1ffff1100a07ea84 RSI: ffffffff82685cb6 RDI: ffff8880503f5420 RBP: 1ffff92000641e90 R08: 0000000000000001 R09: 0000000000000001 R10: ffffc9000320f4a7 R11: 0000000000000001 R12: ffff8880503f5400 R13: 0000000000000001 R14: ffff88805ea2ad78 R15: ffffea00019b6080 __copy_present_ptes mm/memory.c:1147 [inline] copy_present_ptes mm/memory.c:1242 [inline] copy_pte_range mm/memory.c:1365 [inline] copy_pmd_range mm/memory.c:1453 [inline] copy_pud_range mm/memory.c:1488 [inline] copy_p4d_range mm/memory.c:1512 [inline] copy_page_range+0x2636/0x5a00 mm/memory.c:1598 dup_mmap+0x1515/0x2180 mm/mmap.c:1813 dup_mm kernel/fork.c:1549 [inline] copy_mm kernel/fork.c:1602 [inline] copy_process+0x7c5c/0x88e0 kernel/fork.c:2328 kernel_clone+0x176/0x9d0 kernel/fork.c:2798 __do_compat_sys_ia32_clone+0xd4/0x120 arch/x86/kernel/sys_ia32.c:255 do_syscall_32_irqs_on arch/x86/entry/syscall_32.c:79 [inline] __do_fast_syscall_32+0x14d/0x8e0 arch/x86/entry/syscall_32.c:286 do_fast_syscall_32+0x32/0x70 arch/x86/entry/syscall_32.c:311 entry_SYSENTER_compat_after_hwframe+0x84/0x8e RIP: 0023:0xf740efbc Code: d2 74 05 c1 e8 0c 89 02 8b 5d fc 31 c0 c9 c3 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 0f 1f 00 51 52 55 89 e5 0f 34 cd 80 <5d> 5a 59 c3 90 2e 8d b4 26 00 00 00 00 8d b4 26 00 00 00 00 58 b8 RSP: 002b:00000000ff8d2d80 EFLAGS: 00000282 ORIG_RAX: 0000000000000078 RAX: ffffffffffffffda RBX: 0000000001200011 RCX: 0000000000000000 RDX: 0000000000000000 RSI: 0000000000000000 RDI: 00000000582414e8 RBP: 00000000ff8d2db4 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000 Allocated by task 12053: kasan_save_stack+0x30/0x50 mm/kasan/common.c:57 kasan_save_track+0x14/0x30 mm/kasan/common.c:78 poison_kmalloc_redzone mm/kasan/common.c:409 [inline] __kasan_kmalloc+0xaa/0xb0 mm/kasan/common.c:426 kasan_kmalloc include/linux/kasan.h:263 [inline] __kmalloc_cache_noprof+0x2f8/0x6d0 mm/slub.c:5680 _kmalloc_noprof include/linux/slab.h:991 [inline] _kzalloc_noprof include/linux/slab.h:1312 [inline] hwsim_update_pib.isra.0+0x53/0x410 drivers/net/ieee802154/mac802154_hwsim.c:103 hwsim_set_promiscuous_mode+0x14f/0x3a0 drivers/net/ieee802154/mac802154_hwsim.c:326 drv_set_promiscuous_mode+0x12e/0x330 net/mac802154/driver-ops.h:127 drv_start net/mac802154/driver-ops.h:167 [inline] mac802154_scan_worker+0x689/0x1240 net/mac802154/scan.c:248 process_one_work+0xac7/0x1b10 kernel/workqueue.c:3495 process_scheduled_works kernel/workqueue.c:3578 [inline] worker_thread+0x5ef/0xe50 kernel/workqueue.c:3659 kthread+0x373/0x450 kernel/kthread.c:436 ret_from_fork+0x730/0xd60 arch/x86/kernel/process.c:158 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245 Freed by task 24293: kasan_save_stack+0x30/0x50 mm/kasan/common.c:57 kasan_save_track+0x14/0x30 mm/kasan/common.c:78 kasan_save_free_info+0x3b/0x70 mm/kasan/generic.c:584 poison_slab_object mm/kasan/common.c:264 [inline] __kasan_slab_free+0x5f/0x80 mm/kasan/common.c:296 kasan_slab_free include/linux/kasan.h:235 [inline] slab_free_hook mm/slub.c:2780 [inline] __rcu_free_sheaf_prepare+0x5d/0x300 mm/slub.c:3041 rcu_free_sheaf+0x1a/0xe0 mm/slub.c:6182 rcu_do_batch kernel/rcu/tree.c:2650 [inline] rcu_core+0x5f0/0x1220 kernel/rcu/tree.c:2919 handle_softirqs+0x216/0xa20 kernel/softirq.c:669 __do_softirq kernel/softirq.c:703 [inline] invoke_softirq kernel/softirq.c:542 [inline] __irq_exit_rcu+0x178/0x220 kernel/softirq.c:786 irq_exit_rcu+0x9/0x30 kernel/softirq.c:809 instr_sysvec_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1062 [inline] sysvec_apic_timer_interrupt+0xa3/0xc0 arch/x86/kernel/apic/apic.c:1062 asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:674 The buggy address belongs to the object at ffff888014e51e80 which belongs to the cache kmalloc-64 of size 64 The buggy address is located 0 bytes inside of 64-byte region [ffff888014e51e80, ffff888014e51ec0) The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x14e51 flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff) page_type: f5(slab) raw: 00fff00000000000 ffff88801d4428c0 dead000000000100 dead000000000122 raw: 0000000000000000 0000000000200020 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 0xd2c40(GFP_NOFS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 6787, tgid 6787 (syz-executor), ts 132101415866 set_page_owner include/linux/page_owner.h:33 [inline] post_alloc_hook+0xfd/0x120 mm/page_alloc.c:1860 prep_new_page mm/page_alloc.c:1868 [inline] get_page_from_freelist+0xdae/0x2c80 mm/page_alloc.c:3950 __alloc_frozen_pages_noprof+0x2ad/0x31e0 mm/page_alloc.c:5492 alloc_slab_page mm/slub.c:3384 [inline] allocate_slab mm/slub.c:3499 [inline] new_slab+0xb1/0x6d0 mm/slub.c:3550 refill_objects+0xe3/0x410 mm/slub.c:7539 refill_sheaf mm/slub.c:2917 [inline] __pcs_replace_empty_main+0x35e/0x650 mm/slub.c:4811 alloc_from_pcs mm/slub.c:4887 [inline] slab_alloc_node mm/slub.c:5021 [inline] __do_kmalloc_node mm/slub.c:5530 [inline] __kmalloc_noprof+0x677/0x840 mm/slub.c:5556 _kmalloc_noprof include/linux/slab.h:995 [inline] _kzalloc_noprof include/linux/slab.h:1312 [inline] tomoyo_encode2+0xfb/0x3c0 security/tomoyo/realpath.c:45 tomoyo_encode+0x29/0x50 security/tomoyo/realpath.c:80 tomoyo_realpath_from_path+0x18c/0x690 security/tomoyo/realpath.c:283 tomoyo_get_realpath security/tomoyo/file.c:151 [inline] tomoyo_path_perm+0x276/0x460 security/tomoyo/file.c:827 tomoyo_path_unlink+0x91/0xe0 security/tomoyo/tomoyo.c:162 security_path_unlink+0x145/0x2b0 security/security.c:1498 filename_unlinkat+0x316/0x770 fs/namei.c:5734 __do_sys_unlink fs/namei.c:5772 [inline] __se_sys_unlink fs/namei.c:5769 [inline] __ia32_sys_unlink+0x45/0x60 fs/namei.c:5769 do_syscall_32_irqs_on arch/x86/entry/syscall_32.c:79 [inline] __do_fast_syscall_32+0x14d/0x8e0 arch/x86/entry/syscall_32.c:286 page last free pid 7597 tgid 7597 ts 111992329025 stack trace: reset_page_owner include/linux/page_owner.h:26 [inline] __free_pages_prepare mm/page_alloc.c:1402 [inline] __free_frozen_pages+0x7b1/0x10f0 mm/page_alloc.c:2958 qlink_free mm/kasan/quarantine.c:163 [inline] qlist_free_all+0x47/0xf0 mm/kasan/quarantine.c:179 kasan_quarantine_reduce+0x1a0/0x1f0 mm/kasan/quarantine.c:286 __kasan_slab_alloc+0x69/0x90 mm/kasan/common.c:361 kasan_slab_alloc include/linux/kasan.h:253 [inline] slab_post_alloc_hook mm/slub.c:4720 [inline] slab_alloc_node mm/slub.c:5033 [inline] __kmalloc_cache_noprof+0x278/0x6d0 mm/slub.c:5676 _kmalloc_noprof include/linux/slab.h:991 [inline] _kzalloc_noprof include/linux/slab.h:1312 [inline] kobject_uevent_env+0x263/0x18b0 lib/kobject_uevent.c:543 device_del+0x605/0x9b0 drivers/base/core.c:3985 cdev_device_del+0x1d/0x110 fs/char_dev.c:579 evdev_disconnect+0x40/0xb0 drivers/input/evdev.c:1410 __input_unregister_device+0x1da/0x4d0 drivers/input/input.c:2259 input_unregister_device+0xc2/0x110 drivers/input/input.c:2499 uinput_destroy_device+0x236/0x2b0 drivers/input/misc/uinput.c:317 uinput_release+0x34/0x50 drivers/input/misc/uinput.c:779 __fput+0x3fb/0xb50 fs/file_table.c:512 fput_close_sync+0x118/0x250 fs/file_table.c:618 filp_close_sync+0x75/0xa0 fs/open.c:1574 Memory state around the buggy address: ffff888014e51d80: 00 00 00 00 00 00 00 fc fc fc fc fc fc fc fc fc ffff888014e51e00: 00 00 00 00 00 00 00 fc fc fc fc fc fc fc fc fc >ffff888014e51e80: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ^ ffff888014e51f00: 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc fc ffff888014e51f80: 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc fc ================================================================== ---------------- Code disassembly (best guess): 0: 89 c5 mov %eax,%ebp 2: 89 c6 mov %eax,%esi 4: e8 e5 7e a5 ff call 0xffa57eee 9: 41 83 fd 01 cmp $0x1,%r13d d: 7f 67 jg 0x76 f: e8 6a 84 a5 ff call 0xffa5847e 14: 49 8d 7c 24 20 lea 0x20(%r12),%rdi 19: 48 b8 00 00 00 00 00 movabs $0xdffffc0000000000,%rax 20: fc ff df 23: 48 89 fa mov %rdi,%rdx 26: 48 c1 ea 03 shr $0x3,%rdx * 2a: 80 3c 02 00 cmpb $0x0,(%rdx,%rax,1) <-- trapping instruction 2e: 75 51 jne 0x81 30: 49 23 5c 24 20 and 0x20(%r12),%rbx 35: 31 ff xor %edi,%edi 37: 48 89 de mov %rbx,%rsi 3a: e8 df 7e a5 ff call 0xffa57f1e 3f: 48 rex.W