================================================================== BUG: KASAN: use-after-free in percpu_ref_call_confirm_rcu lib/percpu-refcount.c:126 [inline] BUG: KASAN: use-after-free in percpu_ref_switch_to_atomic_rcu+0x4a3/0x540 lib/percpu-refcount.c:165 Read of size 1 at addr ffff8880987a7430 by task udevd/10225 CPU: 1 PID: 10225 Comm: udevd Not tainted 5.6.0-rc2-next-20200217-syzkaller #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+0x197/0x210 lib/dump_stack.c:118 print_address_description.constprop.0.cold+0xd4/0x30b mm/kasan/report.c:374 __kasan_report.cold+0x1b/0x32 mm/kasan/report.c:506 kasan_report+0x12/0x20 mm/kasan/common.c:641 __asan_report_load1_noabort+0x14/0x20 mm/kasan/generic_report.c:132 percpu_ref_call_confirm_rcu lib/percpu-refcount.c:126 [inline] percpu_ref_switch_to_atomic_rcu+0x4a3/0x540 lib/percpu-refcount.c:165 rcu_do_batch kernel/rcu/tree.c:2189 [inline] rcu_core+0x5e3/0x1440 kernel/rcu/tree.c:2416 rcu_core_si+0x9/0x10 kernel/rcu/tree.c:2425 __do_softirq+0x262/0x98c kernel/softirq.c:292 invoke_softirq kernel/softirq.c:373 [inline] irq_exit+0x19b/0x1e0 kernel/softirq.c:413 exiting_irq arch/x86/include/asm/apic.h:546 [inline] smp_apic_timer_interrupt+0x1a3/0x610 arch/x86/kernel/apic/apic.c:1146 apic_timer_interrupt+0xf/0x20 arch/x86/entry/entry_64.S:829 RIP: 0010:__sanitizer_cov_trace_const_cmp1+0x0/0x20 kernel/kcov.c:259 Code: 5d c3 0f 1f 84 00 00 00 00 00 55 48 89 f2 48 89 fe bf 06 00 00 00 48 89 e5 48 8b 4d 08 e8 18 ff ff ff 5d c3 66 0f 1f 44 00 00 <55> 40 0f b6 d6 40 0f b6 f7 bf 01 00 00 00 48 89 e5 48 8b 4d 08 e8 RSP: 0018:ffffc900088478a8 EFLAGS: 00000206 ORIG_RAX: ffffffffffffff13 RAX: ffff88809601e040 RBX: 0000000000000006 RCX: ffffffff836d3042 RDX: 0000000000000000 RSI: 0000000000000006 RDI: 0000000000000010 RBP: ffffc900088478f0 R08: ffff88809601e040 R09: fffffbfff174549d R10: fffffbfff174549c R11: ffffffff8ba2a4e7 R12: ffff88809ed74300 R13: 0000000000000001 R14: 00000000000002de R15: 0000000000000000 tomoyo_supervisor+0x286/0xe60 security/tomoyo/common.c:2089 tomoyo_audit_path_log security/tomoyo/file.c:168 [inline] tomoyo_path_permission security/tomoyo/file.c:587 [inline] tomoyo_path_permission+0x263/0x360 security/tomoyo/file.c:573 tomoyo_path_perm+0x374/0x430 security/tomoyo/file.c:838 tomoyo_path_symlink+0xaa/0xf0 security/tomoyo/tomoyo.c:206 security_path_symlink+0x10a/0x170 security/security.c:1085 do_symlinkat+0x137/0x290 fs/namei.c:4226 __do_sys_symlink fs/namei.c:4247 [inline] __se_sys_symlink fs/namei.c:4245 [inline] __x64_sys_symlink+0x59/0x80 fs/namei.c:4245 do_syscall_64+0xfa/0x790 arch/x86/entry/common.c:294 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x7fd772f98517 Code: 09 01 00 00 0f 05 48 3d 00 f0 ff ff 77 02 f3 c3 48 8b 15 14 39 2b 00 f7 d8 64 89 02 83 c8 ff c3 90 90 90 b8 58 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d f1 38 2b 00 31 d2 48 29 c2 64 RSP: 002b:00007ffcbfca0c58 EFLAGS: 00000202 ORIG_RAX: 0000000000000058 RAX: ffffffffffffffda RBX: 00000000008e4250 RCX: 00007fd772f98517 RDX: 0000000000000002 RSI: 00007ffcbfca0c80 RDI: 00000000008ea2f0 RBP: 00000000008ea7f0 R08: 00007ffcbfca0830 R09: 00007fd772fed1a0 R10: 0000000000000000 R11: 0000000000000202 R12: 000000000000065b R13: 00000000008ec120 R14: 00000000008e4250 R15: 000000000000000b Allocated by task 15956: save_stack+0x23/0x90 mm/kasan/common.c:72 set_track mm/kasan/common.c:80 [inline] __kasan_kmalloc mm/kasan/common.c:515 [inline] __kasan_kmalloc.constprop.0+0xcf/0xe0 mm/kasan/common.c:488 kasan_kmalloc+0x9/0x10 mm/kasan/common.c:529 __do_kmalloc mm/slab.c:3656 [inline] __kmalloc+0x163/0x770 mm/slab.c:3665 kmalloc include/linux/slab.h:560 [inline] kzalloc.constprop.0+0x1b/0x20 include/linux/slab.h:669 io_sqe_files_register fs/io_uring.c:5712 [inline] __io_uring_register+0xa8b/0x2e80 fs/io_uring.c:7174 __do_sys_io_uring_register fs/io_uring.c:7254 [inline] __se_sys_io_uring_register fs/io_uring.c:7236 [inline] __x64_sys_io_uring_register+0x1a1/0x560 fs/io_uring.c:7236 do_syscall_64+0xfa/0x790 arch/x86/entry/common.c:294 entry_SYSCALL_64_after_hwframe+0x49/0xbe Freed by task 15941: save_stack+0x23/0x90 mm/kasan/common.c:72 set_track mm/kasan/common.c:80 [inline] kasan_set_free_info mm/kasan/common.c:337 [inline] __kasan_slab_free+0x102/0x150 mm/kasan/common.c:476 kasan_slab_free+0xe/0x10 mm/kasan/common.c:485 __cache_free mm/slab.c:3426 [inline] kfree+0x10a/0x2c0 mm/slab.c:3757 io_sqe_files_unregister+0x203/0x2f0 fs/io_uring.c:5424 io_ring_ctx_free fs/io_uring.c:6413 [inline] io_ring_ctx_wait_and_kill+0x4ed/0xa60 fs/io_uring.c:6504 io_uring_release+0x42/0x50 fs/io_uring.c:6512 __fput+0x2ff/0x890 fs/file_table.c:280 ____fput+0x16/0x20 fs/file_table.c:313 task_work_run+0x145/0x1c0 kernel/task_work.c:113 tracehook_notify_resume include/linux/tracehook.h:188 [inline] exit_to_usermode_loop+0x316/0x380 arch/x86/entry/common.c:164 prepare_exit_to_usermode arch/x86/entry/common.c:195 [inline] syscall_return_slowpath arch/x86/entry/common.c:278 [inline] do_syscall_64+0x676/0x790 arch/x86/entry/common.c:304 entry_SYSCALL_64_after_hwframe+0x49/0xbe The buggy address belongs to the object at ffff8880987a7400 which belongs to the cache kmalloc-256 of size 256 The buggy address is located 48 bytes inside of 256-byte region [ffff8880987a7400, ffff8880987a7500) The buggy address belongs to the page: page:ffffea000261e9c0 refcount:1 mapcount:0 mapping:00000000973d12cc index:0x0 flags: 0xfffe0000000200(slab) raw: 00fffe0000000200 ffffea0002484f08 ffffea00029b1f88 ffff8880aa4008c0 raw: 0000000000000000 ffff8880987a7000 0000000100000008 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff8880987a7300: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff8880987a7380: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff8880987a7400: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff8880987a7480: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8880987a7500: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ==================================================================