R13: 00000000004caabe R14: 00000000004e3ce8 R15: 0000000000000003 ================================================================== BUG: KASAN: use-after-free in kobject_cleanup lib/kobject.c:646 [inline] BUG: KASAN: use-after-free in kobject_release lib/kobject.c:691 [inline] BUG: KASAN: use-after-free in kref_put include/linux/kref.h:70 [inline] BUG: KASAN: use-after-free in kobject_put.cold+0x2d4/0x2e6 lib/kobject.c:708 Read of size 1 at addr ffff88805ebb386c by task syz-executor.0/20668 CPU: 1 PID: 20668 Comm: syz-executor.0 Not tainted 4.19.87-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.cold+0x7c/0x20d mm/kasan/report.c:256 kasan_report_error mm/kasan/report.c:354 [inline] kasan_report mm/kasan/report.c:412 [inline] kasan_report.cold+0x8c/0x2ba mm/kasan/report.c:396 __asan_report_load1_noabort+0x14/0x20 mm/kasan/report.c:430 kobject_cleanup lib/kobject.c:646 [inline] kobject_release lib/kobject.c:691 [inline] kref_put include/linux/kref.h:70 [inline] kobject_put.cold+0x2d4/0x2e6 lib/kobject.c:708 cdev_put.part.0+0x39/0x50 fs/char_dev.c:374 cdev_put+0x20/0x30 fs/char_dev.c:372 __fput+0x758/0x8b0 fs/file_table.c:281 ____fput+0x16/0x20 fs/file_table.c:309 task_work_run+0x145/0x1c0 kernel/task_work.c:113 tracehook_notify_resume include/linux/tracehook.h:193 [inline] exit_to_usermode_loop+0x273/0x2c0 arch/x86/entry/common.c:167 prepare_exit_to_usermode arch/x86/entry/common.c:198 [inline] syscall_return_slowpath arch/x86/entry/common.c:271 [inline] do_syscall_64+0x53d/0x620 arch/x86/entry/common.c:296 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x45a679 Code: ad b6 fb ff c3 66 2e 0f 1f 84 00 00 00 00 00 66 90 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 0f 83 7b b6 fb ff c3 66 2e 0f 1f 84 00 00 00 00 RSP: 002b:00007f1fc8355c78 EFLAGS: 00000246 ORIG_RAX: 0000000000000021 RAX: 0000000000000004 RBX: 0000000000000002 RCX: 000000000045a679 RDX: 0000000000000000 RSI: 0000000000000004 RDI: 0000000000000003 RBP: 000000000075bfc8 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 00007f1fc83566d4 R13: 00000000004c0f40 R14: 00000000004d4aa8 R15: 00000000ffffffff Allocated by task 20663: save_stack+0x45/0xd0 mm/kasan/kasan.c:448 set_track mm/kasan/kasan.c:460 [inline] kasan_kmalloc mm/kasan/kasan.c:553 [inline] kasan_kmalloc+0xce/0xf0 mm/kasan/kasan.c:531 kmem_cache_alloc_trace+0x152/0x760 mm/slab.c:3625 kmalloc include/linux/slab.h:515 [inline] kzalloc include/linux/slab.h:709 [inline] evdev_connect+0x83/0x4d0 drivers/input/evdev.c:1388 input_attach_handler+0x1a0/0x210 drivers/input/input.c:1004 input_register_device.cold+0xda/0x22b drivers/input/input.c:2159 uinput_create_device drivers/input/misc/uinput.c:373 [inline] uinput_ioctl_handler.isra.0+0x1035/0x1c50 drivers/input/misc/uinput.c:878 uinput_ioctl+0x4a/0x60 drivers/input/misc/uinput.c:1049 vfs_ioctl fs/ioctl.c:46 [inline] file_ioctl fs/ioctl.c:501 [inline] do_vfs_ioctl+0xd5f/0x1380 fs/ioctl.c:688 ksys_ioctl+0xab/0xd0 fs/ioctl.c:705 __do_sys_ioctl fs/ioctl.c:712 [inline] __se_sys_ioctl fs/ioctl.c:710 [inline] __x64_sys_ioctl+0x73/0xb0 fs/ioctl.c:710 do_syscall_64+0xfd/0x620 arch/x86/entry/common.c:293 entry_SYSCALL_64_after_hwframe+0x49/0xbe Freed by task 20680: save_stack+0x45/0xd0 mm/kasan/kasan.c:448 set_track mm/kasan/kasan.c:460 [inline] __kasan_slab_free+0x102/0x150 mm/kasan/kasan.c:521 kasan_slab_free+0xe/0x10 mm/kasan/kasan.c:528 __cache_free mm/slab.c:3503 [inline] kfree+0xcf/0x220 mm/slab.c:3822 evdev_free+0x5e/0x70 drivers/input/evdev.c:370 device_release+0x7b/0x210 drivers/base/core.c:892 kobject_cleanup lib/kobject.c:662 [inline] kobject_release lib/kobject.c:691 [inline] kref_put include/linux/kref.h:70 [inline] kobject_put.cold+0x289/0x2e6 lib/kobject.c:708 cdev_default_release+0x41/0x50 fs/char_dev.c:613 kobject_cleanup lib/kobject.c:662 [inline] kobject_release lib/kobject.c:691 [inline] kref_put include/linux/kref.h:70 [inline] kobject_put.cold+0x289/0x2e6 lib/kobject.c:708 cdev_put.part.0+0x39/0x50 fs/char_dev.c:374 cdev_put fs/char_dev.c:372 [inline] chrdev_open+0x2c1/0x6b0 fs/char_dev.c:431 do_dentry_open+0x4c3/0x1210 fs/open.c:796 vfs_open+0xa0/0xd0 fs/open.c:905 do_last fs/namei.c:3418 [inline] path_openat+0x10d7/0x45e0 fs/namei.c:3534 do_filp_open+0x1a1/0x280 fs/namei.c:3564 do_sys_open+0x3fe/0x550 fs/open.c:1088 __do_sys_open fs/open.c:1106 [inline] __se_sys_open fs/open.c:1101 [inline] __x64_sys_open+0x7e/0xc0 fs/open.c:1101 do_syscall_64+0xfd/0x620 arch/x86/entry/common.c:293 entry_SYSCALL_64_after_hwframe+0x49/0xbe The buggy address belongs to the object at ffff88805ebb3280 which belongs to the cache kmalloc-2048 of size 2048 The buggy address is located 1516 bytes inside of 2048-byte region [ffff88805ebb3280, ffff88805ebb3a80) The buggy address belongs to the page: page:ffffea00017aec80 count:1 mapcount:0 mapping:ffff88812c31cc40 index:0x0 compound_mapcount: 0 flags: 0xfffe0000008100(slab|head) raw: 00fffe0000008100 ffffea00017af108 ffffea000179f488 ffff88812c31cc40 raw: 0000000000000000 ffff88805ebb2180 0000000100000003 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff88805ebb3700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88805ebb3780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff88805ebb3800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88805ebb3880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88805ebb3900: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ================================================================== FAULT_INJECTION: forcing a failure. name fail_page_alloc, interval 1, probability 0, space 0, times 1