================================================================== BUG: KASAN: use-after-free in atomic64_read include/asm-generic/atomic-instrumented.h:836 [inline] BUG: KASAN: use-after-free in atomic_long_read include/asm-generic/atomic-long.h:28 [inline] BUG: KASAN: use-after-free in filp_close+0x31/0x140 fs/open.c:1164 Read of size 8 at addr ffff8881a8029df8 by task syz-executor.5/1624 CPU: 0 PID: 1624 Comm: syz-executor.5 Not tainted 5.4.88-syzkaller-00116-gc9951e5d80dd #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+0x1dd/0x24e lib/dump_stack.c:118 print_address_description+0x96/0x640 mm/kasan/report.c:374 __kasan_report+0x177/0x1f0 mm/kasan/report.c:506 kasan_report+0x30/0x60 mm/kasan/common.c:634 check_memory_region_inline mm/kasan/generic.c:181 [inline] check_memory_region+0x2b5/0x2f0 mm/kasan/generic.c:191 atomic64_read include/asm-generic/atomic-instrumented.h:836 [inline] atomic_long_read include/asm-generic/atomic-long.h:28 [inline] filp_close+0x31/0x140 fs/open.c:1164 __do_sys_close fs/open.c:1189 [inline] __se_sys_close fs/open.c:1187 [inline] __x64_sys_close+0x62/0xb0 fs/open.c:1187 do_syscall_64+0xcb/0x150 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x44/0xa9 RIP: 0033:0x417b71 Code: 75 14 b8 03 00 00 00 0f 05 48 3d 01 f0 ff ff 0f 83 a4 1a 00 00 c3 48 83 ec 08 e8 0a fc ff ff 48 89 04 24 b8 03 00 00 00 0f 05 <48> 8b 3c 24 48 89 c2 e8 53 fc ff ff 48 89 d0 48 83 c4 08 48 3d 01 RSP: 002b:00007ffebb71b620 EFLAGS: 00000293 ORIG_RAX: 0000000000000003 RAX: ffffffffffffffda RBX: 0000000000000005 RCX: 0000000000417b71 RDX: 0000000000000000 RSI: 0000000000000081 RDI: 0000000000000004 RBP: 0000000000000000 R08: 00000000011a04f8 R09: 0000000000000000 R10: 00007ffebb71b6f0 R11: 0000000000000293 R12: ffffffffffffffff R13: 0000000000000000 R14: 0000000000000005 R15: 000000000119bf8c Allocated by task 1629: save_stack mm/kasan/common.c:69 [inline] set_track mm/kasan/common.c:77 [inline] __kasan_kmalloc+0x129/0x1c0 mm/kasan/common.c:510 slab_post_alloc_hook mm/slab.h:584 [inline] slab_alloc_node mm/slub.c:2803 [inline] slab_alloc mm/slub.c:2811 [inline] kmem_cache_alloc+0x1e0/0x270 mm/slub.c:2816 kmem_cache_zalloc include/linux/slab.h:680 [inline] __alloc_file+0x26/0x390 fs/file_table.c:101 alloc_empty_file+0xa9/0x1b0 fs/file_table.c:151 path_openat+0x11b/0x3c20 fs/namei.c:3601 do_filp_open+0x20a/0x440 fs/namei.c:3642 do_sys_open+0x380/0x7b0 fs/open.c:1093 do_syscall_64+0xcb/0x150 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x44/0xa9 Freed by task 1624: save_stack mm/kasan/common.c:69 [inline] set_track mm/kasan/common.c:77 [inline] kasan_set_free_info mm/kasan/common.c:332 [inline] __kasan_slab_free+0x17e/0x230 mm/kasan/common.c:471 slab_free_hook mm/slub.c:1453 [inline] slab_free_freelist_hook+0xd0/0x150 mm/slub.c:1486 slab_free mm/slub.c:3051 [inline] kfree+0x12c/0x660 mm/slub.c:4017 put_fs_context+0x57c/0x690 fs/fs_context.c:509 fscontext_release+0x61/0x80 fs/fsopen.c:73 __fput+0x27d/0x6c0 fs/file_table.c:281 task_work_run+0x176/0x1a0 kernel/task_work.c:113 tracehook_notify_resume include/linux/tracehook.h:188 [inline] exit_to_usermode_loop arch/x86/entry/common.c:163 [inline] prepare_exit_to_usermode+0x2b0/0x310 arch/x86/entry/common.c:194 entry_SYSCALL_64_after_hwframe+0x44/0xa9 The buggy address belongs to the object at ffff8881a8029dc0 which belongs to the cache filp of size 256 The buggy address is located 56 bytes inside of 256-byte region [ffff8881a8029dc0, ffff8881a8029ec0) The buggy address belongs to the page: page:ffffea0006a00a40 refcount:1 mapcount:0 mapping:ffff8881f60fa500 index:0x0 flags: 0x8000000000000200(slab) raw: 8000000000000200 dead000000000100 dead000000000122 ffff8881f60fa500 raw: 0000000000000000 00000000000c000c 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff8881a8029c80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff8881a8029d00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff8881a8029d80: fc fc fc fc fc fc fc fc fb fb fb fb fb fb fb fb ^ ffff8881a8029e00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8881a8029e80: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ==================================================================