ci2 starts bisection 2023-06-27 15:34:59.042057249 +0000 UTC m=+89318.132405084 bisecting cause commit starting from 1ef6663a587ba3e57dc5065a477db1c64481eedd building syzkaller on 4cd5bb25a2752a9a5b25597d1da34656681f07a6 ensuring issue is reproducible on original commit 1ef6663a587ba3e57dc5065a477db1c64481eedd testing commit 1ef6663a587ba3e57dc5065a477db1c64481eedd gcc compiler: Debian clang version 15.0.7, GNU ld (GNU Binutils for Debian) 2.35.2 kernel signature: 71cf7c5382593eaa25e98ba922c52a6f3751b7e3bc9254b052ec2b2f5e8378bd all runs: crashed: KASAN: invalid-free in init_file testing release v6.4 testing commit 6995e2de6891c724bfeb2db33d7b87775f913ad1 gcc compiler: Debian clang version 15.0.7, GNU ld (GNU Binutils for Debian) 2.35.2 kernel signature: 1df8226651c95ed8237d18c9d15df9f91d16c54499999db4657e5fb6a67ce8ee all runs: OK too many neither good nor bad results, skipping this commit # git bisect start 1ef6663a587ba3e57dc5065a477db1c64481eedd 6995e2de6891c724bfeb2db33d7b87775f913ad1 Bisecting: 525 revisions left to test after this (roughly 9 steps) [a0433f8cae3ac51f59b4b1863032822aaa2d8164] Merge tag 'for-6.5/block-2023-06-23' of git://git.kernel.dk/linux testing commit a0433f8cae3ac51f59b4b1863032822aaa2d8164 gcc compiler: Debian clang version 15.0.7, GNU ld (GNU Binutils for Debian) 2.35.2 kernel signature: f4ab5b85279a5a8529149cdc9918c95ac48bb86d491fd426bcec207703774dcc all runs: crashed: KASAN: invalid-free in init_file # git bisect bad a0433f8cae3ac51f59b4b1863032822aaa2d8164 Bisecting: 341 revisions left to test after this (roughly 9 steps) [cc423f6337d0a5ff1906f3b3d465d28c0d1705f6] Merge tag 'for-6.5-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux testing commit cc423f6337d0a5ff1906f3b3d465d28c0d1705f6 gcc compiler: Debian clang version 15.0.7, GNU ld (GNU Binutils for Debian) 2.35.2 kernel signature: f77c1aca1af6c7e13ab5a8ffbaf02fd17e578af7cc63b091ecf810e35e9fdbb5 all runs: crashed: KASAN: invalid-free in init_file # git bisect bad cc423f6337d0a5ff1906f3b3d465d28c0d1705f6 Bisecting: 177 revisions left to test after this (roughly 8 steps) [50b5d1fc41da21a4ecf219f37fbca23c79020b08] btrfs: do not BUG_ON() on tree mod log failures at insert_ptr() testing commit 50b5d1fc41da21a4ecf219f37fbca23c79020b08 gcc compiler: Debian clang version 15.0.7, GNU ld (GNU Binutils for Debian) 2.35.2 kernel signature: b2f690304918bef91af3903c5e9c584d2c2656fb89478d3428b34b13c42fb4ef all runs: OK too many neither good nor bad results, skipping this commit # git bisect good 50b5d1fc41da21a4ecf219f37fbca23c79020b08 Bisecting: 95 revisions left to test after this (roughly 7 steps) [c0a572d9d32fe1e95672f24e860776dba0750a38] Merge tag 'v6.5/vfs.mount' of git://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs testing commit c0a572d9d32fe1e95672f24e860776dba0750a38 gcc compiler: Debian clang version 15.0.7, GNU ld (GNU Binutils for Debian) 2.35.2 kernel signature: e24ce7217e5d23fd9dd7e8787a5733bd66015cc771a66ed1680a2b8db26f639b all runs: crashed: KASAN: invalid-free in init_file # git bisect bad c0a572d9d32fe1e95672f24e860776dba0750a38 Bisecting: 45 revisions left to test after this (roughly 5 steps) [5c1c88cddb79d3ed3fb1d02a3eaf529eded76f05] Merge tag 'v6.5/fs.ntfs' of git://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs testing commit 5c1c88cddb79d3ed3fb1d02a3eaf529eded76f05 gcc compiler: Debian clang version 15.0.7, GNU ld (GNU Binutils for Debian) 2.35.2 kernel signature: 38a60c60f8e7f33e05ee65284da4507aeee8461ad1cb8b41034fd865c6db3625 all runs: OK too many neither good nor bad results, skipping this commit # git bisect good 5c1c88cddb79d3ed3fb1d02a3eaf529eded76f05 Bisecting: 22 revisions left to test after this (roughly 5 steps) [797a1d894d7b7586f422cabf8d7807cd39d0b5aa] autofs: set ctime as well when mtime changes on a dir testing commit 797a1d894d7b7586f422cabf8d7807cd39d0b5aa gcc compiler: Debian clang version 15.0.7, GNU ld (GNU Binutils for Debian) 2.35.2 kernel signature: 56d2e8fcabc6c58418f48a2ad9eb797844596d48a4d025d4ce83bf80a6ebc1da all runs: OK too many neither good nor bad results, skipping this commit # git bisect good 797a1d894d7b7586f422cabf8d7807cd39d0b5aa Bisecting: 10 revisions left to test after this (roughly 4 steps) [2eedfa9e27ed7b22d9c06d8d072ad2dbce4fd635] Merge tag 'v6.5/vfs.rename.locking' of git://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs testing commit 2eedfa9e27ed7b22d9c06d8d072ad2dbce4fd635 gcc compiler: Debian clang version 15.0.7, GNU ld (GNU Binutils for Debian) 2.35.2 kernel signature: 8da9949231592339250aca569431782af96f6ceb04a97a8049719fc6bdbf7e74 all runs: OK too many neither good nor bad results, skipping this commit # git bisect good 2eedfa9e27ed7b22d9c06d8d072ad2dbce4fd635 Bisecting: 5 revisions left to test after this (roughly 3 steps) [bc2473c90fca55bf95b2ab6af1dacee26a4f92f6] ovl: enable fsnotify events on underlying real files testing commit bc2473c90fca55bf95b2ab6af1dacee26a4f92f6 gcc compiler: Debian clang version 15.0.7, GNU ld (GNU Binutils for Debian) 2.35.2 kernel signature: eedf7b7f0762e4525dd2e513c26da7b0357d78b2c38a81b02a2153357cc0694a all runs: crashed: KASAN: invalid-free in init_file # git bisect bad bc2473c90fca55bf95b2ab6af1dacee26a4f92f6 Bisecting: 2 revisions left to test after this (roughly 1 step) [cbb0b9d4bbcfa96e7872808a63be03202536f1bc] fs: use a helper for opening kernel internal files testing commit cbb0b9d4bbcfa96e7872808a63be03202536f1bc gcc compiler: Debian clang version 15.0.7, GNU ld (GNU Binutils for Debian) 2.35.2 kernel signature: 42aa71235a66c2933e9c327c3fdd63e9594385c973167ea6962a02e79c6ecebd all runs: OK too many neither good nor bad results, skipping this commit # git bisect good cbb0b9d4bbcfa96e7872808a63be03202536f1bc Bisecting: 0 revisions left to test after this (roughly 1 step) [62d53c4a1dfe347bd87ede46ffad38c9a3870338] fs: use backing_file container for internal files with "fake" f_path testing commit 62d53c4a1dfe347bd87ede46ffad38c9a3870338 gcc compiler: Debian clang version 15.0.7, GNU ld (GNU Binutils for Debian) 2.35.2 kernel signature: c90649eeac6575ad1fd71a24e4f6fd958f4e69a3f0a94145838e9a60beb5d3c4 all runs: crashed: KASAN: invalid-free in init_file # git bisect bad 62d53c4a1dfe347bd87ede46ffad38c9a3870338 Bisecting: 0 revisions left to test after this (roughly 0 steps) [8a05a8c31d06c5d0d67b273a4a00f87269adde82] fs: move kmem_cache_zalloc() into alloc_empty_file*() helpers testing commit 8a05a8c31d06c5d0d67b273a4a00f87269adde82 gcc compiler: Debian clang version 15.0.7, GNU ld (GNU Binutils for Debian) 2.35.2 kernel signature: 040f65bb81b27e92f9b716f04df44796553e6faa850c53a70aaa5bad7f0ff234 all runs: OK too many neither good nor bad results, skipping this commit # git bisect good 8a05a8c31d06c5d0d67b273a4a00f87269adde82 62d53c4a1dfe347bd87ede46ffad38c9a3870338 is the first bad commit commit 62d53c4a1dfe347bd87ede46ffad38c9a3870338 Author: Amir Goldstein Date: Thu Jun 15 14:22:28 2023 +0300 fs: use backing_file container for internal files with "fake" f_path Overlayfs uses open_with_fake_path() to allocate internal kernel files, with a "fake" path - whose f_path is not on the same fs as f_inode. Allocate a container struct backing_file for those internal files, that is used to hold the "fake" ovl path along with the real path. backing_file_real_path() can be used to access the stored real path. Signed-off-by: Amir Goldstein Message-Id: <20230615112229.2143178-5-amir73il@gmail.com> Signed-off-by: Christian Brauner fs/file_table.c | 50 ++++++++++++++++++++++++++++++++++++++++++++++++-- fs/internal.h | 5 +++-- fs/open.c | 45 +++++++++++++++++++++++++++++++++------------ fs/overlayfs/file.c | 4 ++-- include/linux/fs.h | 33 ++++++++++++++++++++++++++++----- 5 files changed, 114 insertions(+), 23 deletions(-) culprit signature: c90649eeac6575ad1fd71a24e4f6fd958f4e69a3f0a94145838e9a60beb5d3c4 parent signature: 040f65bb81b27e92f9b716f04df44796553e6faa850c53a70aaa5bad7f0ff234 revisions tested: 13, total time: 10h4m41.980871109s (build: 8h31m6.508616832s, test: 1h25m22.451731933s) first bad commit: 62d53c4a1dfe347bd87ede46ffad38c9a3870338 fs: use backing_file container for internal files with "fake" f_path recipients (to): ["amir73il@gmail.com" "brauner@kernel.org"] recipients (cc): [] crash: KASAN: invalid-free in init_file RSP: 002b:00007f96b0b68168 EFLAGS: 00000246 ORIG_RAX: 0000000000000028 RAX: ffffffffffffffda RBX: 00007f96affabf80 RCX: 00007f96afe8c389 RDX: 0000000000000000 RSI: 0000000000000004 RDI: 0000000000000005 RBP: 00007f96b0b681d0 R08: 0000000000000000 R09: 0000000000000000 R10: 000000007ffff000 R11: 0000000000000246 R12: 0000000000000001 R13: 00007fff31153f5f R14: 00007f96b0b68300 R15: 0000000000022000 ================================================================== BUG: KASAN: invalid-free in init_file+0x16d/0x1d0 fs/file_table.c:163 Free of addr ffff8880254e0400 by task syz-executor.0/5484 CPU: 1 PID: 5484 Comm: syz-executor.0 Not tainted 6.4.0-rc2-syzkaller #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+0x167/0x220 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+0x16d/0x1d0 fs/file_table.c:163 alloc_empty_backing_file+0x62/0xb0 fs/file_table.c:267 backing_file_open+0x1b/0xd0 fs/open.c:1174 ovl_open_realfile+0x1d4/0x310 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_read_iter+0xaa7/0xcf0 fs/overlayfs/file.c:307 call_read_iter include/linux/fs.h:1868 [inline] generic_file_splice_read+0x23a/0x5b0 fs/splice.c:419 do_splice_to fs/splice.c:902 [inline] splice_direct_to_actor+0x39c/0xa60 fs/splice.c:973 do_splice_direct+0x268/0x3a0 fs/splice.c:1082 do_sendfile+0x4f5/0xc20 fs/read_write.c:1254 __do_sys_sendfile64 fs/read_write.c:1322 [inline] __se_sys_sendfile64+0x143/0x190 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:0x7f96afe8c389 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:00007f96b0b68168 EFLAGS: 00000246 ORIG_RAX: 0000000000000028 RAX: ffffffffffffffda RBX: 00007f96affabf80 RCX: 00007f96afe8c389 RDX: 0000000000000000 RSI: 0000000000000004 RDI: 0000000000000005 RBP: 00007f96b0b681d0 R08: 0000000000000000 R09: 0000000000000000 R10: 000000007ffff000 R11: 0000000000000246 R12: 0000000000000001 R13: 00007fff31153f5f R14: 00007f96b0b68300 R15: 0000000000022000 Allocated by task 5484: 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+0x4d/0xb0 fs/file_table.c:263 backing_file_open+0x1b/0xd0 fs/open.c:1174 ovl_open_realfile+0x1d4/0x310 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_read_iter+0xaa7/0xcf0 fs/overlayfs/file.c:307 call_read_iter include/linux/fs.h:1868 [inline] generic_file_splice_read+0x23a/0x5b0 fs/splice.c:419 do_splice_to fs/splice.c:902 [inline] splice_direct_to_actor+0x39c/0xa60 fs/splice.c:973 do_splice_direct+0x268/0x3a0 fs/splice.c:1082 do_sendfile+0x4f5/0xc20 fs/read_write.c:1254 __do_sys_sendfile64 fs/read_write.c:1322 [inline] __se_sys_sendfile64+0x143/0x190 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 kvfree_call_rcu+0x109/0x8d0 kernel/rcu/tree.c:3332 drop_sysctl_table+0x2d2/0x400 fs/proc/proc_sysctl.c:1695 drop_sysctl_table+0x2df/0x400 fs/proc/proc_sysctl.c:1698 unregister_sysctl_table+0x71/0x110 fs/proc/proc_sysctl.c:1733 mpls_dev_sysctl_unregister+0x7f/0xb0 net/mpls/af_mpls.c:1445 mpls_dev_notify+0x457/0x510 net/mpls/af_mpls.c:1657 notifier_call_chain+0x120/0x260 kernel/notifier.c:93 call_netdevice_notifiers_info net/core/dev.c:1935 [inline] call_netdevice_notifiers_extack net/core/dev.c:1973 [inline] call_netdevice_notifiers net/core/dev.c:1987 [inline] unregister_netdevice_many_notify+0xbd4/0x14d0 net/core/dev.c:10882 unregister_netdevice_many net/core/dev.c:10938 [inline] default_device_exit_batch+0x3da/0x540 net/core/dev.c:11391 ops_exit_list net/core/net_namespace.c:175 [inline] cleanup_net+0x6d4/0xa30 net/core/net_namespace.c:614 process_one_work+0x797/0xe20 kernel/workqueue.c:2405 worker_thread+0x8c9/0xfd0 kernel/workqueue.c:2552 kthread+0x27c/0x2f0 kernel/kthread.c:379 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:308 The buggy address belongs to the object at ffff8880254e0400 which belongs to the cache kmalloc-512 of size 512 The buggy address is located 0 bytes inside of 472-byte region [ffff8880254e0400, ffff8880254e05d8) The buggy address belongs to the physical page: page:ffffea0000953800 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x254e0 head:ffffea0000953800 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 ffff888011041c80 dead000000000100 dead000000000122 raw: 0000000000000000 0000000080100010 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 2300, tgid 2300 (kworker/u4:3), ts 7895328649, free_ts 0 set_page_owner include/linux/page_owner.h:31 [inline] post_alloc_hook+0x1e6/0x210 mm/page_alloc.c:1731 prep_new_page mm/page_alloc.c:1738 [inline] get_page_from_freelist+0x321c/0x33a0 mm/page_alloc.c:3502 __alloc_pages+0x255/0x670 mm/page_alloc.c:4768 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] alloc_bprm+0x52/0x7c0 fs/exec.c:1512 kernel_execve+0x76/0x820 fs/exec.c:1987 call_usermodehelper_exec_async+0x200/0x310 kernel/umh.c:110 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:308 page_owner free stack trace missing Memory state around the buggy address: ffff8880254e0300: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff8880254e0380: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff8880254e0400: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ^ ffff8880254e0480: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff8880254e0500: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ==================================================================