RBP: 00007f0e3648f1d0 R08: 0000000000000000 R09: 0000000000000000 R10: 000000007ffff000 R11: 0000000000000246 R12: 0000000000000001 R13: 00007ffd5ef9a49f R14: 00007f0e3648f300 R15: 0000000000022000 ================================================================== BUG: KASAN: invalid-free in init_file+0x195/0x200 fs/file_table.c:163 Free of addr ffff8880167b0800 by task syz-executor.3/23217 CPU: 0 PID: 23217 Comm: syz-executor.3 Not tainted 6.4.0-syzkaller-01224-g1ef6663a587b #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/27/2023 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x1e7/0x2d0 lib/dump_stack.c:106 print_address_description mm/kasan/report.c:351 [inline] print_report+0x163/0x540 mm/kasan/report.c:462 kasan_report_invalid_free+0xeb/0x100 mm/kasan/report.c:537 ____kasan_slab_free+0xfb/0x120 kasan_slab_free include/linux/kasan.h:162 [inline] slab_free_hook mm/slub.c:1781 [inline] slab_free_freelist_hook mm/slub.c:1807 [inline] slab_free mm/slub.c:3786 [inline] kmem_cache_free+0x297/0x520 mm/slub.c:3808 init_file+0x195/0x200 fs/file_table.c:163 alloc_empty_backing_file+0x67/0xd0 fs/file_table.c:267 backing_file_open+0x26/0x100 fs/open.c:1166 ovl_open_realfile+0x1f6/0x350 fs/overlayfs/file.c:64 ovl_real_fdget_meta fs/overlayfs/file.c:122 [inline] ovl_real_fdget fs/overlayfs/file.c:143 [inline] ovl_splice_read+0x7cc/0x8c0 fs/overlayfs/file.c:430 splice_direct_to_actor+0x2a8/0x9a0 fs/splice.c:961 do_splice_direct+0x286/0x3d0 fs/splice.c:1070 do_sendfile+0x623/0x1070 fs/read_write.c:1254 __do_sys_sendfile64 fs/read_write.c:1322 [inline] __se_sys_sendfile64+0x17c/0x1e0 fs/read_write.c:1308 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x41/0xc0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd RIP: 0033:0x7f0e3568c389 Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 f1 19 00 00 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 73 01 c3 48 c7 c1 b8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f0e3648f168 EFLAGS: 00000246 ORIG_RAX: 0000000000000028 RAX: ffffffffffffffda RBX: 00007f0e357abf80 RCX: 00007f0e3568c389 RDX: 0000000000000000 RSI: 0000000000000004 RDI: 0000000000000005 RBP: 00007f0e3648f1d0 R08: 0000000000000000 R09: 0000000000000000 R10: 000000007ffff000 R11: 0000000000000246 R12: 0000000000000001 R13: 00007ffd5ef9a49f R14: 00007f0e3648f300 R15: 0000000000022000 Allocated by task 23217: kasan_save_stack mm/kasan/common.c:45 [inline] kasan_set_track+0x4f/0x70 mm/kasan/common.c:52 ____kasan_kmalloc mm/kasan/common.c:374 [inline] __kasan_kmalloc+0x98/0xb0 mm/kasan/common.c:383 kmalloc include/linux/slab.h:559 [inline] kzalloc include/linux/slab.h:680 [inline] alloc_empty_backing_file+0x52/0xd0 fs/file_table.c:263 backing_file_open+0x26/0x100 fs/open.c:1166 ovl_open_realfile+0x1f6/0x350 fs/overlayfs/file.c:64 ovl_real_fdget_meta fs/overlayfs/file.c:122 [inline] ovl_real_fdget fs/overlayfs/file.c:143 [inline] ovl_splice_read+0x7cc/0x8c0 fs/overlayfs/file.c:430 splice_direct_to_actor+0x2a8/0x9a0 fs/splice.c:961 do_splice_direct+0x286/0x3d0 fs/splice.c:1070 do_sendfile+0x623/0x1070 fs/read_write.c:1254 __do_sys_sendfile64 fs/read_write.c:1322 [inline] __se_sys_sendfile64+0x17c/0x1e0 fs/read_write.c:1308 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x41/0xc0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd Last potentially related work creation: kasan_save_stack+0x3f/0x60 mm/kasan/common.c:45 __kasan_record_aux_stack+0xb0/0xc0 mm/kasan/generic.c:491 insert_work+0x54/0x3d0 kernel/workqueue.c:1368 __queue_work+0xb37/0xf10 kernel/workqueue.c:1529 call_timer_fn+0x178/0x580 kernel/time/timer.c:1700 expire_timers kernel/time/timer.c:1746 [inline] __run_timers+0x67a/0x860 kernel/time/timer.c:2022 run_timer_softirq+0x67/0xf0 kernel/time/timer.c:2035 __do_softirq+0x2ab/0x908 kernel/softirq.c:553 Second to last potentially related work creation: kasan_save_stack+0x3f/0x60 mm/kasan/common.c:45 __kasan_record_aux_stack+0xb0/0xc0 mm/kasan/generic.c:491 insert_work+0x54/0x3d0 kernel/workqueue.c:1368 __queue_work+0xb37/0xf10 kernel/workqueue.c:1529 call_timer_fn+0x178/0x580 kernel/time/timer.c:1700 expire_timers kernel/time/timer.c:1746 [inline] __run_timers+0x67a/0x860 kernel/time/timer.c:2022 run_timer_softirq+0x67/0xf0 kernel/time/timer.c:2035 __do_softirq+0x2ab/0x908 kernel/softirq.c:553 The buggy address belongs to the object at ffff8880167b0800 which belongs to the cache kmalloc-512 of size 512 The buggy address is located 0 bytes inside of 480-byte region [ffff8880167b0800, ffff8880167b09e0) The buggy address belongs to the physical page: page:ffffea000059ec00 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x167b0 head:ffffea000059ec00 order:2 entire_mapcount:0 nr_pages_mapped:0 pincount:0 flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff) page_type: 0xffffffff() raw: 00fff00000010200 ffff888012441c80 dead000000000100 dead000000000122 raw: 0000000000000000 0000000000100010 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 2, migratetype Unmovable, gfp_mask 0xd20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 1, tgid 1 (swapper/0), ts 5960237197, free_ts 0 set_page_owner include/linux/page_owner.h:31 [inline] post_alloc_hook+0x1e6/0x210 mm/page_alloc.c:1744 prep_new_page mm/page_alloc.c:1751 [inline] get_page_from_freelist+0x320e/0x3390 mm/page_alloc.c:3523 __alloc_pages+0x255/0x670 mm/page_alloc.c:4794 alloc_page_interleave+0x22/0x1d0 mm/mempolicy.c:2112 alloc_slab_page+0x6a/0x160 mm/slub.c:1851 allocate_slab mm/slub.c:1998 [inline] new_slab+0x84/0x2f0 mm/slub.c:2051 ___slab_alloc+0xa85/0x10a0 mm/slub.c:3192 __slab_alloc mm/slub.c:3291 [inline] __slab_alloc_node mm/slub.c:3344 [inline] slab_alloc_node mm/slub.c:3441 [inline] __kmem_cache_alloc_node+0x1b8/0x290 mm/slub.c:3490 kmalloc_trace+0x2a/0xe0 mm/slab_common.c:1057 kmalloc include/linux/slab.h:559 [inline] kzalloc include/linux/slab.h:680 [inline] device_private_init drivers/base/core.c:3471 [inline] device_add+0xc1/0xf60 drivers/base/core.c:3522 tty_register_device_attr+0x437/0x960 drivers/tty/tty_io.c:3249 tty_register_device drivers/tty/tty_io.c:3184 [inline] tty_register_driver+0x5f6/0xc30 drivers/tty/tty_io.c:3447 legacy_pty_init+0x3ac/0x610 drivers/tty/pty.c:579 pty_init+0xe/0x20 drivers/tty/pty.c:943 do_one_initcall+0x23d/0x7d0 init/main.c:1232 do_initcall_level+0x157/0x210 init/main.c:1305 page_owner free stack trace missing Memory state around the buggy address: ffff8880167b0700: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff8880167b0780: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff8880167b0800: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ^ ffff8880167b0880: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff8880167b0900: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ==================================================================