input: s as /devices/virtual/input/input77 input: s as /devices/virtual/input/input78 input: s as /devices/virtual/input/input79 input: s as /devices/virtual/input/input80 ================================================================== BUG: KASAN: use-after-free in cdev_put.part.0+0x4c/0x50 fs/char_dev.c:373 Read of size 8 at addr ffff8880a4c4efb0 by task syz-executor.0/8021 CPU: 1 PID: 8021 Comm: syz-executor.0 Not tainted 4.19.86-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_load8_noabort+0x14/0x20 mm/kasan/report.c:433 cdev_put.part.0+0x4c/0x50 fs/char_dev.c:373 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 RIP: 0033:0x414411 Code: 75 14 b8 02 00 00 00 0f 05 48 3d 01 f0 ff ff 0f 83 04 19 00 00 c3 48 83 ec 08 e8 0a fa ff ff 48 89 04 24 b8 02 00 00 00 0f 05 <48> 8b 3c 24 48 89 c2 e8 53 fa ff ff 48 89 d0 48 83 c4 08 48 3d 01 RSP: 002b:00007f76b35597a0 EFLAGS: 00000293 ORIG_RAX: 0000000000000002 RAX: ffffffffffffffda RBX: 6666666666666667 RCX: 0000000000414411 RDX: 0000000000000000 RSI: 0100000000000000 RDI: 00007f76b3559850 RBP: 000000000075bf20 R08: 000000000000000f R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000293 R12: 00007f76b355a6d4 R13: 00000000004ca395 R14: 00000000004e2a10 R15: 00000000ffffffff Allocated by task 8001: 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 8019: 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 ffff8880a4c4e9c0 which belongs to the cache kmalloc-2048 of size 2048 The buggy address is located 1520 bytes inside of 2048-byte region [ffff8880a4c4e9c0, ffff8880a4c4f1c0) The buggy address belongs to the page: page:ffffea0002931380 count:1 mapcount:0 mapping:ffff88812c31cc40 index:0x0 compound_mapcount: 0 flags: 0xfffe0000008100(slab|head) raw: 00fffe0000008100 ffffea0001fc7788 ffffea00029ab888 ffff88812c31cc40 raw: 0000000000000000 ffff8880a4c4e140 0000000100000003 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff8880a4c4ee80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8880a4c4ef00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff8880a4c4ef80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff8880a4c4f000: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8880a4c4f080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ================================================================== input: s as /devices/virtual/input/input82 input: s as /devices/virtual/input/input83 input: s as /devices/virtual/input/input84