================================================================== BUG: KASAN: use-after-free in drm_getunique+0x1cc/0x260 drivers/gpu/drm/drm_ioctl.c:118 Read of size 4 at addr ffff8880a5087098 by task syz-executor.1/19896 CPU: 0 PID: 19896 Comm: syz-executor.1 Not tainted 4.19.162-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+0x1fc/0x2fe lib/dump_stack.c:118 print_address_description.cold+0x54/0x219 mm/kasan/report.c:256 kasan_report_error.cold+0x8a/0x1c7 mm/kasan/report.c:354 kasan_report mm/kasan/report.c:412 [inline] __asan_report_load4_noabort+0x88/0x90 mm/kasan/report.c:432 drm_getunique+0x1cc/0x260 drivers/gpu/drm/drm_ioctl.c:118 drm_ioctl_kernel+0x208/0x2a0 drivers/gpu/drm/drm_ioctl.c:757 drm_ioctl+0x507/0x9c0 drivers/gpu/drm/drm_ioctl.c:857 vfs_ioctl fs/ioctl.c:46 [inline] file_ioctl fs/ioctl.c:501 [inline] do_vfs_ioctl+0xcdb/0x12e0 fs/ioctl.c:688 ksys_ioctl+0x9b/0xc0 fs/ioctl.c:705 __do_sys_ioctl fs/ioctl.c:712 [inline] __se_sys_ioctl fs/ioctl.c:710 [inline] __x64_sys_ioctl+0x6f/0xb0 fs/ioctl.c:710 do_syscall_64+0xf9/0x620 arch/x86/entry/common.c:293 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x45e0f9 Code: 0d b4 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 db b3 fb ff c3 66 2e 0f 1f 84 00 00 00 00 RSP: 002b:00007f0037c67c68 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 RAX: ffffffffffffffda RBX: 0000000000000003 RCX: 000000000045e0f9 RDX: 0000000020000180 RSI: 00000000c0145401 RDI: 0000000000000003 RBP: 000000000119c068 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 000000000119c034 R13: 00007ffebdaa2c3f R14: 00007f0037c689c0 R15: 000000000119c034 Allocated by task 19890: kmem_cache_alloc_trace+0x12f/0x380 mm/slab.c:3625 kmalloc include/linux/slab.h:515 [inline] kzalloc include/linux/slab.h:709 [inline] drm_master_create+0x40/0x590 drivers/gpu/drm/drm_auth.c:101 drm_new_set_master+0x11c/0x4a0 drivers/gpu/drm/drm_auth.c:147 drm_master_open+0xee/0x120 drivers/gpu/drm/drm_auth.c:257 drm_open_helper drivers/gpu/drm/drm_file.c:376 [inline] drm_open+0x4e5/0x810 drivers/gpu/drm/drm_file.c:316 drm_stub_open+0x290/0x410 drivers/gpu/drm/drm_drv.c:950 chrdev_open+0x266/0x770 fs/char_dev.c:423 do_dentry_open+0x4aa/0x1160 fs/open.c:796 do_last fs/namei.c:3421 [inline] path_openat+0x793/0x2df0 fs/namei.c:3537 do_filp_open+0x18c/0x3f0 fs/namei.c:3567 do_sys_open+0x3b3/0x520 fs/open.c:1085 do_syscall_64+0xf9/0x620 arch/x86/entry/common.c:293 entry_SYSCALL_64_after_hwframe+0x49/0xbe Freed by task 19890: __cache_free mm/slab.c:3503 [inline] kfree+0xcc/0x210 mm/slab.c:3822 drm_master_destroy drivers/gpu/drm/drm_auth.c:356 [inline] kref_put include/linux/kref.h:70 [inline] drm_master_put+0x1b5/0x240 drivers/gpu/drm/drm_auth.c:367 drm_new_set_master+0x2cd/0x4a0 drivers/gpu/drm/drm_auth.c:166 drm_setmaster_ioctl+0x291/0x3a0 drivers/gpu/drm/drm_auth.c:199 drm_ioctl_kernel+0x208/0x2a0 drivers/gpu/drm/drm_ioctl.c:757 drm_ioctl+0x507/0x9c0 drivers/gpu/drm/drm_ioctl.c:857 vfs_ioctl fs/ioctl.c:46 [inline] file_ioctl fs/ioctl.c:501 [inline] do_vfs_ioctl+0xcdb/0x12e0 fs/ioctl.c:688 ksys_ioctl+0x9b/0xc0 fs/ioctl.c:705 __do_sys_ioctl fs/ioctl.c:712 [inline] __se_sys_ioctl fs/ioctl.c:710 [inline] __x64_sys_ioctl+0x6f/0xb0 fs/ioctl.c:710 do_syscall_64+0xf9/0x620 arch/x86/entry/common.c:293 entry_SYSCALL_64_after_hwframe+0x49/0xbe The buggy address belongs to the object at ffff8880a5087080 which belongs to the cache kmalloc-512 of size 512 The buggy address is located 24 bytes inside of 512-byte region [ffff8880a5087080, ffff8880a5087280) The buggy address belongs to the page: page:ffffea00029421c0 count:1 mapcount:0 mapping:ffff88813bff0940 index:0xffff8880a5087580 flags: 0xfff00000000100(slab) raw: 00fff00000000100 ffffea000274b248 ffffea000273b248 ffff88813bff0940 raw: ffff8880a5087580 ffff8880a5087080 0000000100000005 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff8880a5086f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff8880a5087000: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff8880a5087080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff8880a5087100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8880a5087180: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ================================================================== UDF-fs: warning (device loop2): udf_load_vrs: No VRS found UDF-fs: Scanning with blocksize 512 failed UDF-fs: warning (device loop2): udf_load_vrs: No VRS found UDF-fs: Scanning with blocksize 1024 failed UDF-fs: warning (device loop2): udf_load_vrs: No VRS found UDF-fs: Scanning with blocksize 2048 failed UDF-fs: warning (device loop2): udf_load_vrs: No VRS found UDF-fs: Scanning with blocksize 4096 failed overlayfs: missing 'lowerdir' UDF-fs: warning (device loop2): udf_load_vrs: No VRS found UDF-fs: Scanning with blocksize 512 failed UDF-fs: warning (device loop2): udf_load_vrs: No VRS found UDF-fs: Scanning with blocksize 1024 failed UDF-fs: warning (device loop2): udf_load_vrs: No VRS found UDF-fs: Scanning with blocksize 2048 failed UDF-fs: warning (device loop2): udf_load_vrs: No VRS found UDF-fs: Scanning with blocksize 4096 failed