bisecting cause commit starting from 234d53d2bb60a9436a6d4d55bef1712613b79014 building syzkaller on c1132b49314d96788d6467f64e567faa31e8e063 testing commit 234d53d2bb60a9436a6d4d55bef1712613b79014 compiler: gcc (GCC) 10.2.1 20210217, GNU ld (GNU Binutils for Debian) 2.35.2 kernel signature: e0d639db0fe75edace8c258a9d897b63e2f00cd1206b629c5a082e046e986c50 all runs: crashed: KASAN: use-after-free Write in ext4_stop_mmpd testing release v5.10.75 testing commit 3a9842b42e421f6496a78a42a123639cf6d7ed31 compiler: gcc (GCC) 10.2.1 20210217, GNU ld (GNU Binutils for Debian) 2.35.2 kernel signature: 35140925c370dd65821e5a88729bd7e6b914ae258afe42d5c334e23864d61a89 all runs: crashed: KASAN: use-after-free Write in ext4_stop_mmpd testing release v5.10.74 testing commit 77434fe5a077f05f0851931d6a71d1098b6004f8 compiler: gcc (GCC) 10.2.1 20210217, GNU ld (GNU Binutils for Debian) 2.35.2 kernel signature: 29b1bd05223853d02669cb591c2031ae7743ef9ac42ad78483df6dfd65de9d7c all runs: crashed: KASAN: use-after-free Write in ext4_stop_mmpd testing release v5.10.73 testing commit 0268aa579b1f741b12300bc7f084ffe990cfde5f compiler: gcc (GCC) 10.2.1 20210217, GNU ld (GNU Binutils for Debian) 2.35.2 kernel signature: 8a6e1878f33722bf5586bc2cd03bc208ba800027e9b8e3086c26b5c692ec675b all runs: crashed: KASAN: use-after-free Write in ext4_stop_mmpd testing release v5.10.72 testing commit 5aa003b38148d584f20455ecac85c51187d0b71e compiler: gcc (GCC) 10.2.1 20210217, GNU ld (GNU Binutils for Debian) 2.35.2 kernel signature: e58d99391157444023b7e1a4d8941fb355c18695f9e5d2ba0b73c0fd00624c28 all runs: crashed: KASAN: use-after-free Write in ext4_stop_mmpd testing release v5.10.71 testing commit 5cd40b137cba45a5a3d0b9a8554f779a3e0e93b4 compiler: gcc (GCC) 10.2.1 20210217, GNU ld (GNU Binutils for Debian) 2.35.2 kernel signature: a522f88acb2c25d1cfc3d9e13622fc810365ba5b7955f14728faf5e7b02f42eb all runs: crashed: KASAN: use-after-free Write in ext4_stop_mmpd testing release v5.10.70 testing commit f93026b28e2afe5060a493b0bbcee19d12961b7e compiler: gcc (GCC) 10.2.1 20210217, GNU ld (GNU Binutils for Debian) 2.35.2 kernel signature: 1c5b8585a7dfd865f703cb4fc05c1cc16b57f2352c1b7c3fcb7bfaed97586c1e all runs: crashed: KASAN: use-after-free Write in ext4_stop_mmpd testing release v5.10.69 testing commit 5f4196eaa90c139ac470111b8e2deabf5f283baa compiler: gcc (GCC) 10.2.1 20210217, GNU ld (GNU Binutils for Debian) 2.35.2 kernel signature: f83bd172fe4bd9008ed2c67364f45f2c45cdbd1396edcecae55d4990f9ced276 all runs: crashed: KASAN: use-after-free Write in ext4_stop_mmpd testing release v5.10.68 testing commit 4d8524048a35c03ff04c25ca1bcdf569f9aeb14a compiler: gcc (GCC) 10.2.1 20210217, GNU ld (GNU Binutils for Debian) 2.35.2 kernel signature: 13d48c49d5d9407cb79a357a6c5338d58e122c3fac824561597fbf159faae5c6 all runs: crashed: KASAN: use-after-free Write in ext4_stop_mmpd testing release v5.10.67 testing commit faf816b0f8d0fa8ea24f579fb6a51e5ed3efd750 compiler: gcc (GCC) 10.2.1 20210217, GNU ld (GNU Binutils for Debian) 2.35.2 kernel signature: a80928640138db05b31acd81c53b25fde521c5b5da953974d95e8d5eda1644d8 all runs: crashed: KASAN: use-after-free Write in ext4_stop_mmpd testing release v5.10.66 testing commit 44a32dcb2fb5598dc8b61645852df0ea829aeace compiler: gcc (GCC) 10.2.1 20210217, GNU ld (GNU Binutils for Debian) 2.35.2 kernel signature: 93f1ebde7b7f63c887b96f34a0f946d16438266a398e602c764323afc2eb66b5 all runs: crashed: KASAN: use-after-free Write in ext4_stop_mmpd testing release v5.10.65 testing commit c31c2cca229aa5280d108618bb264c713840a4c2 compiler: gcc (GCC) 10.2.1 20210217, GNU ld (GNU Binutils for Debian) 2.35.2 kernel signature: d3bc1fc39c0509de06c40bcc791ea7241e4450e4ae38645519c26c20e85092a0 all runs: crashed: KASAN: use-after-free Write in ext4_stop_mmpd testing release v5.10.64 testing commit cb83afdc0b865d7c8a74d2b2a1f7dd393e1d196d compiler: gcc (GCC) 10.2.1 20210217, GNU ld (GNU Binutils for Debian) 2.35.2 kernel signature: 78c64bee24c56a2c41086110914b3638a56024e5d0b27a2314fffa1b873b1983 all runs: crashed: KASAN: use-after-free Write in ext4_stop_mmpd testing release v5.10.63 testing commit e07f317d5a289f06b7eb9025d2ada744cf22c940 compiler: gcc (GCC) 10.2.1 20210217, GNU ld (GNU Binutils for Debian) 2.35.2 kernel signature: 8b10d39b0a916c6c4fdd9b38edae1d697903940963f1c3030acef379e89f1f95 all runs: crashed: KASAN: use-after-free Write in ext4_stop_mmpd testing release v5.10.62 testing commit f6dd002450bf7b9143aff3af42ad1e12efe9a4f8 compiler: gcc (GCC) 10.2.1 20210217, GNU ld (GNU Binutils for Debian) 2.35.2 kernel signature: ece56ad533c5a7b1f44ba9601fdd6ae576c46c0b363a9b3155c480110cd18156 all runs: crashed: KASAN: use-after-free Write in ext4_stop_mmpd testing release v5.10.61 testing commit 452ea6a15ed2ac74789b7b3513777cc94ea3b751 compiler: gcc (GCC) 10.2.1 20210217, GNU ld (GNU Binutils for Debian) 2.35.2 kernel signature: 1c3a7100f3ac7e2a57941a86da8d45dd99175e262aa5fdf5d429f4a7bb9d1ca0 all runs: crashed: KASAN: use-after-free Write in ext4_stop_mmpd testing release v5.10.60 testing commit 2c5bd949b1df3f9fb109107b3d766e2ebabd7238 compiler: gcc (GCC) 10.2.1 20210217, GNU ld (GNU Binutils for Debian) 2.35.2 kernel signature: 8f8109b6fa020e0dcf5749aef6c7164c2ea4748c0d1d9b469641433fe390f38c all runs: crashed: KASAN: use-after-free Write in ext4_stop_mmpd testing release v5.10.59 testing commit 5805e5eec901e830c7741d4916270d0b9cfd6743 compiler: gcc (GCC) 10.2.1 20210217, GNU ld (GNU Binutils for Debian) 2.35.2 kernel signature: 09dc5abf73308ca9a9cb4e07513440ac21e60ecf2e541eb83a4b6140258946fd all runs: crashed: KASAN: use-after-free Write in ext4_stop_mmpd testing release v5.10.58 testing commit 132a8267adabd645476b542b3b132c1b91988fe8 compiler: gcc (GCC) 10.2.1 20210217, GNU ld (GNU Binutils for Debian) 2.35.2 kernel signature: 78739f50eb891a1913225823442a05a1778b364413d8456e85a699b15d6f4b01 all runs: crashed: KASAN: use-after-free Write in ext4_stop_mmpd testing release v5.10.57 testing commit 1cd6e30b83d741562b55bf5b7763b1238a91150c compiler: gcc (GCC) 10.2.1 20210217, GNU ld (GNU Binutils for Debian) 2.35.2 kernel signature: 7a6d4d8657f26ded2e0a46a38da2a970af6155114330976820447cb36a8894af all runs: crashed: KASAN: use-after-free Write in ext4_stop_mmpd testing release v5.10.56 testing commit 9746c25334cb364ab6651ee6dfd4cab3218d0c06 compiler: gcc (GCC) 10.2.1 20210217, GNU ld (GNU Binutils for Debian) 2.35.2 kernel signature: b84bdee972c63648afa444bf48e61be12d3a3e44f693c7b492c6042e12cc4916 all runs: crashed: KASAN: use-after-free Write in ext4_stop_mmpd testing release v5.10.55 testing commit 11fe69a17195cf58eff523f26f90de50660d0100 compiler: gcc (GCC) 10.2.1 20210217, GNU ld (GNU Binutils for Debian) 2.35.2 kernel signature: 6e22e8614429ae572f7324bf52bcb76627d3341c365ef54e7dedf1dd83ae295f all runs: crashed: KASAN: use-after-free Write in ext4_stop_mmpd testing release v5.10.54 testing commit 08277b9dde633e1447e96b8cb89da2b40f96ae69 compiler: gcc (GCC) 10.2.1 20210217, GNU ld (GNU Binutils for Debian) 2.35.2 kernel signature: 4723812ea9e4a194edb776d6d5360edde7fac386688ab6a1f13d4ca81b3499e5 all runs: crashed: KASAN: use-after-free Write in ext4_stop_mmpd testing release v5.10.53 testing commit 71046eac2db9aeccf10763d034a1a123911c9a81 compiler: gcc (GCC) 10.2.1 20210217, GNU ld (GNU Binutils for Debian) 2.35.2 kernel signature: f99c11de13540267db3ca65bc08200d835a95afb9f6d8263fbf2f5ef08435a0d all runs: crashed: KASAN: use-after-free Write in ext4_stop_mmpd testing release v5.10.52 testing commit 2cd5fe24a7f025448f19d98c4f4c45ff79ce0784 compiler: gcc (GCC) 10.2.1 20210217, GNU ld (GNU Binutils for Debian) 2.35.2 kernel signature: 8b90efa65da33f8128b56a36dc9aab3be41f28b75a95a5bdda3265479f6e206d all runs: crashed: KASAN: use-after-free Write in ext4_stop_mmpd testing release v5.10.51 testing commit f68261346518c970aea06e6fb3eb031247340400 compiler: gcc (GCC) 10.2.1 20210217, GNU ld (GNU Binutils for Debian) 2.35.2 kernel signature: 8dd40e9d77d96445791809f39a6c16f75d6deb0cff33bb73ee75e5fb0770db65 all runs: crashed: KASAN: use-after-free Write in ext4_stop_mmpd testing release v5.10.50 testing commit 43b0742ef44c30f202afbf8355e9326710af9ca1 compiler: gcc (GCC) 10.2.1 20210217, GNU ld (GNU Binutils for Debian) 2.35.2 kernel signature: 7fc46326443f68043671d3046483285eb0abce4a8dbb9d6afb55a859def7fee5 all runs: OK # git bisect start f68261346518c970aea06e6fb3eb031247340400 43b0742ef44c30f202afbf8355e9326710af9ca1 Bisecting: 106 revisions left to test after this (roughly 7 steps) [1013dc896d99b4bb7ae8b9a65f78f8be96f17386] sfc: avoid double pci_remove of VFs testing commit 1013dc896d99b4bb7ae8b9a65f78f8be96f17386 compiler: gcc (GCC) 10.2.1 20210217, GNU ld (GNU Binutils for Debian) 2.35.2 kernel signature: 778407e931949275d0adfc038a1b06a381692fdf755fc539bc2ce133ab009a65 all runs: OK # git bisect good 1013dc896d99b4bb7ae8b9a65f78f8be96f17386 Bisecting: 53 revisions left to test after this (roughly 6 steps) [c6016936171a7b179b2c478ceb7fbd092ee4f9f8] drm/amd/display: Reject non-zero src_y and src_x for video planes testing commit c6016936171a7b179b2c478ceb7fbd092ee4f9f8 compiler: gcc (GCC) 10.2.1 20210217, GNU ld (GNU Binutils for Debian) 2.35.2 kernel signature: 8d17cd1212f6ffd27109e0eaf03fb7b1a8cb406087537889f71c083d8855c554 all runs: OK # git bisect good c6016936171a7b179b2c478ceb7fbd092ee4f9f8 Bisecting: 26 revisions left to test after this (roughly 5 steps) [f9fb4986f4d81182f938d16beb4f983fe71212aa] seq_buf: Fix overflow in seq_buf_putmem_hex() testing commit f9fb4986f4d81182f938d16beb4f983fe71212aa compiler: gcc (GCC) 10.2.1 20210217, GNU ld (GNU Binutils for Debian) 2.35.2 kernel signature: 3975755fe02119149c6f1beebc72f1458c7b711511b3ebe5ad2aa5bed6d3429a all runs: OK # git bisect good f9fb4986f4d81182f938d16beb4f983fe71212aa Bisecting: 13 revisions left to test after this (roughly 4 steps) [db317a37229b2dd338c4b9348310ca47e462ca67] media: subdev: disallow ioctl for saa6588/davinci testing commit db317a37229b2dd338c4b9348310ca47e462ca67 compiler: gcc (GCC) 10.2.1 20210217, GNU ld (GNU Binutils for Debian) 2.35.2 kernel signature: b7b871665484b14ada36465bc8bf1e15d029c672a45bfa7a9d51302168bb42b5 all runs: OK # git bisect good db317a37229b2dd338c4b9348310ca47e462ca67 Bisecting: 6 revisions left to test after this (roughly 3 steps) [b716ccffbc8dc8f14773d4ae7daadbca6167da2d] dm writecache: write at least 4k when committing testing commit b716ccffbc8dc8f14773d4ae7daadbca6167da2d compiler: gcc (GCC) 10.2.1 20210217, GNU ld (GNU Binutils for Debian) 2.35.2 kernel signature: dac986324ccf836e16cee15349b293c4e2a967e249b70151e8974e04dcfa0c54 all runs: OK # git bisect good b716ccffbc8dc8f14773d4ae7daadbca6167da2d Bisecting: 3 revisions left to test after this (roughly 2 steps) [8018936950360f1c503bb385e158cfc5e4945d18] jfs: fix GPF in diFree testing commit 8018936950360f1c503bb385e158cfc5e4945d18 compiler: gcc (GCC) 10.2.1 20210217, GNU ld (GNU Binutils for Debian) 2.35.2 kernel signature: a7943b2e1f4dd557668899870edaae3b3108660e3886bc1b2e1496d909d1e8e1 all runs: OK # git bisect good 8018936950360f1c503bb385e158cfc5e4945d18 Bisecting: 1 revision left to test after this (roughly 1 step) [5e4f5138bd8522ebe231a137682d3857209a2c07] ext4: fix memory leak in ext4_fill_super testing commit 5e4f5138bd8522ebe231a137682d3857209a2c07 compiler: gcc (GCC) 10.2.1 20210217, GNU ld (GNU Binutils for Debian) 2.35.2 kernel signature: e37a21de4993e8bb452f78bae3426913d6043de01271e986814fa4ddb5afd48b all runs: crashed: KASAN: use-after-free Write in ext4_stop_mmpd # git bisect bad 5e4f5138bd8522ebe231a137682d3857209a2c07 Bisecting: 0 revisions left to test after this (roughly 0 steps) [3780348c1a0e14ffefcaf1fc521f815bcaac94b0] smackfs: restrict bytes count in smk_set_cipso() testing commit 3780348c1a0e14ffefcaf1fc521f815bcaac94b0 compiler: gcc (GCC) 10.2.1 20210217, GNU ld (GNU Binutils for Debian) 2.35.2 kernel signature: ac44711e5ee9ac473b34fa27b249277fdc9cf6887bf85482d28d80dc2c8ea255 all runs: OK # git bisect good 3780348c1a0e14ffefcaf1fc521f815bcaac94b0 5e4f5138bd8522ebe231a137682d3857209a2c07 is the first bad commit commit 5e4f5138bd8522ebe231a137682d3857209a2c07 Author: Pavel Skripkin Date: Fri Apr 30 21:50:46 2021 +0300 ext4: fix memory leak in ext4_fill_super commit 618f003199c6188e01472b03cdbba227f1dc5f24 upstream. static int kthread(void *_create) will return -ENOMEM or -EINTR in case of internal failure or kthread_stop() call happens before threadfn call. To prevent fancy error checking and make code more straightforward we moved all cleanup code out of kmmpd threadfn. Also, dropped struct mmpd_data at all. Now struct super_block is a threadfn data and struct buffer_head embedded into struct ext4_sb_info. Reported-by: syzbot+d9e482e303930fa4f6ff@syzkaller.appspotmail.com Signed-off-by: Pavel Skripkin Link: https://lore.kernel.org/r/20210430185046.15742-1-paskripkin@gmail.com Signed-off-by: Theodore Ts'o Signed-off-by: Greg Kroah-Hartman fs/ext4/ext4.h | 4 ++++ fs/ext4/mmp.c | 28 +++++++++++++--------------- fs/ext4/super.c | 10 ++++------ 3 files changed, 21 insertions(+), 21 deletions(-) culprit signature: e37a21de4993e8bb452f78bae3426913d6043de01271e986814fa4ddb5afd48b parent signature: ac44711e5ee9ac473b34fa27b249277fdc9cf6887bf85482d28d80dc2c8ea255 revisions tested: 35, total time: 5h38m54.807262628s (build: 2h57m50.047871308s, test: 2h37m27.353108994s) first bad commit: 5e4f5138bd8522ebe231a137682d3857209a2c07 ext4: fix memory leak in ext4_fill_super recipients (to): ["gregkh@linuxfoundation.org" "paskripkin@gmail.com" "tytso@mit.edu"] recipients (cc): [] crash: KASAN: use-after-free Write in ext4_stop_mmpd ================================================================== BUG: KASAN: use-after-free in instrument_atomic_read_write include/linux/instrumented.h:101 [inline] BUG: KASAN: use-after-free in atomic_fetch_add_relaxed include/asm-generic/atomic-instrumented.h:142 [inline] BUG: KASAN: use-after-free in __refcount_add include/linux/refcount.h:193 [inline] BUG: KASAN: use-after-free in __refcount_inc include/linux/refcount.h:250 [inline] BUG: KASAN: use-after-free in refcount_inc include/linux/refcount.h:267 [inline] BUG: KASAN: use-after-free in get_task_struct include/linux/sched/task.h:104 [inline] BUG: KASAN: use-after-free in kthread_stop+0x25/0x330 kernel/kthread.c:616 Write of size 4 at addr ffff88811d828f20 by task syz-executor.4/416 CPU: 0 PID: 416 Comm: syz-executor.4 Not tainted 5.10.50-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+0x84/0xad lib/dump_stack.c:118 print_address_description.constprop.0+0x21/0x220 mm/kasan/report.c:385 __kasan_report mm/kasan/report.c:545 [inline] kasan_report.cold+0x20/0x37 mm/kasan/report.c:562 check_memory_region_inline mm/kasan/generic.c:186 [inline] check_memory_region+0x148/0x190 mm/kasan/generic.c:192 __kasan_check_write+0x14/0x20 mm/kasan/common.c:77 instrument_atomic_read_write include/linux/instrumented.h:101 [inline] atomic_fetch_add_relaxed include/asm-generic/atomic-instrumented.h:142 [inline] __refcount_add include/linux/refcount.h:193 [inline] __refcount_inc include/linux/refcount.h:250 [inline] refcount_inc include/linux/refcount.h:267 [inline] get_task_struct include/linux/sched/task.h:104 [inline] kthread_stop+0x25/0x330 kernel/kthread.c:616 ext4_stop_mmpd+0x39/0xb0 fs/ext4/mmp.c:254 ext4_put_super+0x70d/0xc80 fs/ext4/super.c:1263 generic_shutdown_super+0x12d/0x330 fs/super.c:464 kill_block_super+0x97/0xe0 fs/super.c:1446 deactivate_locked_super+0x8b/0x130 fs/super.c:335 deactivate_super+0x71/0x80 fs/super.c:366 cleanup_mnt+0x33a/0x4e0 fs/namespace.c:1118 __cleanup_mnt+0xd/0x10 fs/namespace.c:1125 task_work_run+0xc2/0x140 kernel/task_work.c:151 tracehook_notify_resume include/linux/tracehook.h:188 [inline] exit_to_user_mode_loop kernel/entry/common.c:164 [inline] exit_to_user_mode_prepare+0xd9/0xe0 kernel/entry/common.c:191 syscall_exit_to_user_mode+0x27/0x160 kernel/entry/common.c:266 do_syscall_64+0x3f/0x80 arch/x86/entry/common.c:56 entry_SYSCALL_64_after_hwframe+0x44/0xa9 RIP: 0033:0x7f0f8ad5cea7 Code: ff ff ff f7 d8 64 89 01 48 83 c8 ff c3 66 0f 1f 44 00 00 31 f6 e9 09 00 00 00 66 0f 1f 84 00 00 00 00 00 b8 a6 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 bc ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007ffde5617ba8 EFLAGS: 00000246 ORIG_RAX: 00000000000000a6 RAX: 0000000000000000 RBX: 0000000000000000 RCX: 00007f0f8ad5cea7 RDX: 00007ffde5617c7a RSI: 0000000000000002 RDI: 00007ffde5617c70 RBP: 00007ffde5617c70 R08: 00000000ffffffff R09: 00007ffde5617a40 R10: 000055555648db83 R11: 0000000000000246 R12: 00007f0f8adb5035 R13: 00007ffde5618d30 R14: 000055555648db00 R15: 00007ffde5618d70 Allocated by task 2: kasan_save_stack+0x23/0x50 mm/kasan/common.c:48 kasan_set_track mm/kasan/common.c:56 [inline] __kasan_kmalloc.constprop.0+0xcf/0xe0 mm/kasan/common.c:461 kasan_slab_alloc+0xe/0x10 mm/kasan/common.c:469 slab_post_alloc_hook mm/slab.h:532 [inline] slab_alloc_node mm/slub.c:2889 [inline] slab_alloc mm/slub.c:2897 [inline] kmem_cache_alloc+0x154/0x490 mm/slub.c:2902 kmem_cache_alloc_node include/linux/slab.h:423 [inline] alloc_task_struct_node kernel/fork.c:170 [inline] dup_task_struct kernel/fork.c:860 [inline] copy_process+0x45e/0x5e30 kernel/fork.c:1947 kernel_clone+0xc1/0x890 kernel/fork.c:2465 kernel_thread+0xba/0xf0 kernel/fork.c:2517 create_kthread kernel/kthread.c:315 [inline] kthreadd+0x353/0x4e0 kernel/kthread.c:658 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:296 Freed by task 0: kasan_save_stack+0x23/0x50 mm/kasan/common.c:48 kasan_set_track+0x20/0x30 mm/kasan/common.c:56 kasan_set_free_info+0x1f/0x40 mm/kasan/generic.c:355 __kasan_slab_free+0x117/0x170 mm/kasan/common.c:422 kasan_slab_free+0xe/0x10 mm/kasan/common.c:431 slab_free_hook mm/slub.c:1542 [inline] slab_free_freelist_hook+0x6d/0x120 mm/slub.c:1575 slab_free mm/slub.c:3140 [inline] kmem_cache_free+0xfe/0x450 mm/slub.c:3156 free_task_struct kernel/fork.c:175 [inline] free_task+0x9b/0xc0 kernel/fork.c:464 __put_task_struct+0x1ef/0x4b0 kernel/fork.c:741 put_task_struct include/linux/sched/task.h:113 [inline] delayed_put_task_struct+0xfb/0x130 kernel/exit.c:173 rcu_do_batch+0x3d7/0xac0 kernel/rcu/tree.c:2484 rcu_core+0x46a/0xaa0 kernel/rcu/tree.c:2719 rcu_core_si+0x9/0x10 kernel/rcu/tree.c:2732 __do_softirq+0x1b2/0x653 kernel/softirq.c:298 Last call_rcu(): kasan_save_stack+0x23/0x50 mm/kasan/common.c:48 kasan_record_aux_stack+0xb1/0xc0 mm/kasan/generic.c:346 __call_rcu kernel/rcu/tree.c:2960 [inline] call_rcu+0xf7/0x1310 kernel/rcu/tree.c:3034 put_task_struct_rcu_user+0x48/0x60 kernel/exit.c:179 finish_task_switch+0x4ee/0x720 kernel/sched/core.c:3649 context_switch kernel/sched/core.c:3779 [inline] __schedule+0x6e7/0x1890 kernel/sched/core.c:4525 schedule+0xdb/0x280 kernel/sched/core.c:4603 kthread_worker_fn+0x3bc/0x640 kernel/kthread.c:735 loop_kthread_worker_fn+0x4c/0x60 drivers/block/loop.c:938 kthread+0x345/0x420 kernel/kthread.c:292 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:296 The buggy address belongs to the object at ffff88811d828f00 which belongs to the cache task_struct of size 3712 The buggy address is located 32 bytes inside of 3712-byte region [ffff88811d828f00, ffff88811d829d80) The buggy address belongs to the page: page:0000000070272a95 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x11d828 head:0000000070272a95 order:3 compound_mapcount:0 compound_pincount:0 flags: 0x8000000000010200(slab|head) raw: 8000000000010200 dead000000000100 dead000000000122 ffff888100131780 raw: 0000000000000000 0000000000080008 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 3, migratetype Unmovable, gfp_mask 0x1d20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC|__GFP_HARDWALL) set_page_owner include/linux/page_owner.h:31 [inline] post_alloc_hook mm/page_alloc.c:2279 [inline] prep_new_page+0xf6/0x140 mm/page_alloc.c:2285 get_page_from_freelist+0x2f3a/0x5100 mm/page_alloc.c:3909 __alloc_pages_nodemask+0x26c/0x5d0 mm/page_alloc.c:4951 __alloc_pages include/linux/gfp.h:511 [inline] __alloc_pages_node include/linux/gfp.h:524 [inline] alloc_pages_node include/linux/gfp.h:538 [inline] alloc_pages include/linux/gfp.h:557 [inline] alloc_slab_page mm/slub.c:1613 [inline] allocate_slab+0x327/0x460 mm/slub.c:1756 new_slab mm/slub.c:1817 [inline] new_slab_objects mm/slub.c:2576 [inline] ___slab_alloc.constprop.0+0x339/0x750 mm/slub.c:2739 __slab_alloc mm/slub.c:2779 [inline] slab_alloc_node mm/slub.c:2854 [inline] slab_alloc mm/slub.c:2897 [inline] kmem_cache_alloc+0x43b/0x490 mm/slub.c:2902 kmem_cache_alloc_node include/linux/slab.h:423 [inline] alloc_task_struct_node kernel/fork.c:170 [inline] dup_task_struct kernel/fork.c:860 [inline] copy_process+0x45e/0x5e30 kernel/fork.c:1947 kernel_clone+0xc1/0x890 kernel/fork.c:2465 kernel_thread+0xba/0xf0 kernel/fork.c:2517 create_kthread kernel/kthread.c:315 [inline] kthreadd+0x353/0x4e0 kernel/kthread.c:658 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:296 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1258 [inline] __free_pages_ok+0x3ee/0x7a0 mm/page_alloc.c:1521 free_the_page mm/page_alloc.c:5012 [inline] __free_pages+0xab/0xd0 mm/page_alloc.c:5018 __free_slab+0xdd/0x1d0 mm/slub.c:1842 free_slab mm/slub.c:1857 [inline] discard_slab+0x2b/0x40 mm/slub.c:1863 unfreeze_partials+0x1e1/0x240 mm/slub.c:2357 put_cpu_partial+0xdb/0x160 mm/slub.c:2393 __slab_free+0x3a9/0x530 mm/slub.c:3034 do_slab_free mm/slub.c:3128 [inline] ___cache_free+0x235/0x280 mm/slub.c:3147 qlink_free mm/kasan/quarantine.c:151 [inline] qlist_free_all+0x5a/0xd0 mm/kasan/quarantine.c:170 quarantine_reduce+0x15f/0x1d0 mm/kasan/quarantine.c:267 __kasan_kmalloc.constprop.0+0xa3/0xe0 mm/kasan/common.c:442 kasan_slab_alloc+0xe/0x10 mm/kasan/common.c:469 slab_post_alloc_hook mm/slab.h:532 [inline] slab_alloc_node mm/slub.c:2889 [inline] slab_alloc mm/slub.c:2897 [inline] kmem_cache_alloc_trace+0x15e/0x490 mm/slub.c:2914 kmalloc include/linux/slab.h:552 [inline] kzalloc include/linux/slab.h:664 [inline] kobject_uevent_env+0x1c3/0x1070 lib/kobject_uevent.c:524 kobject_uevent+0xb/0x10 lib/kobject_uevent.c:642 __loop_clr_fd+0x5fa/0xe90 drivers/block/loop.c:1261 Memory state around the buggy address: ffff88811d828e00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff88811d828e80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff88811d828f00: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88811d828f80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88811d829000: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ================================================================== ------------[ cut here ]------------ refcount_t: addition on 0; use-after-free. WARNING: CPU: 1 PID: 416 at lib/refcount.c:25 refcount_warn_saturate+0xe7/0x140 lib/refcount.c:25 Modules linked in: CPU: 1 PID: 416 Comm: syz-executor.4 Tainted: G B 5.10.50-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 RIP: 0010:refcount_warn_saturate+0xe7/0x140 lib/refcount.c:25 Code: f8 df ab 03 01 e8 8d af cf 01 0f 0b eb 9b 80 3d e7 df ab 03 00 75 92 48 c7 c7 80 90 9e 84 c6 05 d7 df ab 03 01 e8 6d af cf 01 <0f> 0b e9 78 ff ff ff 80 3d c1 df ab 03 00 0f 85 6b ff ff ff 48 c7 RSP: 0018:ffffc900008c7ce0 EFLAGS: 00010286 RAX: 0000000000000000 RBX: ffff88811d828f20 RCX: 0000000000000000 RDX: 0000000000000001 RSI: ffffffff849eae60 RDI: fffff52000118f8e RBP: ffffc900008c7cf0 R08: 0000000000000001 R09: ffff8881f734ae67 R10: ffffed103ee695cc R11: 746e756f63666572 R12: 0000000000000002 R13: ffff88811d828f20 R14: 0000000000000000 R15: ffff88811d705278 FS: 000055555648c400(0000) GS:ffff8881f7200000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007fffdf6a6ca8 CR3: 0000000117bc6000 CR4: 00000000003506b0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: __refcount_add include/linux/refcount.h:199 [inline] __refcount_inc include/linux/refcount.h:250 [inline] refcount_inc include/linux/refcount.h:267 [inline] get_task_struct include/linux/sched/task.h:104 [inline] kthread_stop+0x2c6/0x330 kernel/kthread.c:616 ext4_stop_mmpd+0x39/0xb0 fs/ext4/mmp.c:254 ext4_put_super+0x70d/0xc80 fs/ext4/super.c:1263 generic_shutdown_super+0x12d/0x330 fs/super.c:464 kill_block_super+0x97/0xe0 fs/super.c:1446 deactivate_locked_super+0x8b/0x130 fs/super.c:335 deactivate_super+0x71/0x80 fs/super.c:366 cleanup_mnt+0x33a/0x4e0 fs/namespace.c:1118 __cleanup_mnt+0xd/0x10 fs/namespace.c:1125 task_work_run+0xc2/0x140 kernel/task_work.c:151 tracehook_notify_resume include/linux/tracehook.h:188 [inline] exit_to_user_mode_loop kernel/entry/common.c:164 [inline] exit_to_user_mode_prepare+0xd9/0xe0 kernel/entry/common.c:191 syscall_exit_to_user_mode+0x27/0x160 kernel/entry/common.c:266 do_syscall_64+0x3f/0x80 arch/x86/entry/common.c:56 entry_SYSCALL_64_after_hwframe+0x44/0xa9 RIP: 0033:0x7f0f8ad5cea7 Code: ff ff ff f7 d8 64 89 01 48 83 c8 ff c3 66 0f 1f 44 00 00 31 f6 e9 09 00 00 00 66 0f 1f 84 00 00 00 00 00 b8 a6 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 bc ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007ffde5617ba8 EFLAGS: 00000246 ORIG_RAX: 00000000000000a6 RAX: 0000000000000000 RBX: 0000000000000000 RCX: 00007f0f8ad5cea7 RDX: 00007ffde5617c7a RSI: 0000000000000002 RDI: 00007ffde5617c70 RBP: 00007ffde5617c70 R08: 00000000ffffffff R09: 00007ffde5617a40 R10: 000055555648db83 R11: 0000000000000246 R12: 00007f0f8adb5035 R13: 00007ffde5618d30 R14: 000055555648db00 R15: 00007ffde5618d70 ---[ end trace 7fef31c98e9ae4d0 ]--- ------------[ cut here ]------------ refcount_t: underflow; use-after-free. WARNING: CPU: 0 PID: 416 at lib/refcount.c:28 refcount_warn_saturate+0x135/0x140 lib/refcount.c:28 Modules linked in: CPU: 0 PID: 416 Comm: syz-executor.4 Tainted: G B W 5.10.50-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 RIP: 0010:refcount_warn_saturate+0x135/0x140 lib/refcount.c:28 Code: af cf 01 0f 0b e9 51 ff ff ff 48 89 df e8 43 1a 71 ff e9 1f ff ff ff 48 c7 c7 e0 90 9e 84 c6 05 88 df ab 03 01 e8 1f af cf 01 <0f> 0b e9 2a ff ff ff 0f 1f 40 00 55 be 04 00 00 00 48 89 e5 41 57 RSP: 0018:ffffc900008c7ce0 EFLAGS: 00010286 RAX: 0000000000000000 RBX: ffff88811d828f20 RCX: 0000000000000000 RDX: 0000000000000001 RSI: 0000000000000008 RDI: fffff52000118f8e RBP: ffffc900008c7cf0 R08: 0000000000000000 R09: ffffc900008c78ef R10: fffff52000118f1d R11: 0000000063666572 R12: 0000000000000003 R13: ffff88811d828f20 R14: 0000000000000000 R15: ffff88811d705278 FS: 000055555648c400(0000) GS:ffff8881f7200000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007f40b32b9fe8 CR3: 0000000117bc6000 CR4: 00000000003506b0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: __refcount_sub_and_test include/linux/refcount.h:283 [inline] __refcount_dec_and_test include/linux/refcount.h:315 [inline] refcount_dec_and_test include/linux/refcount.h:333 [inline] put_task_struct include/linux/sched/task.h:112 [inline] kthread_stop+0x2b4/0x330 kernel/kthread.c:623 ext4_stop_mmpd+0x39/0xb0 fs/ext4/mmp.c:254 ext4_put_super+0x70d/0xc80 fs/ext4/super.c:1263 generic_shutdown_super+0x12d/0x330 fs/super.c:464 kill_block_super+0x97/0xe0 fs/super.c:1446 deactivate_locked_super+0x8b/0x130 fs/super.c:335 deactivate_super+0x71/0x80 fs/super.c:366 cleanup_mnt+0x33a/0x4e0 fs/namespace.c:1118 __cleanup_mnt+0xd/0x10 fs/namespace.c:1125 task_work_run+0xc2/0x140 kernel/task_work.c:151 tracehook_notify_resume include/linux/tracehook.h:188 [inline] exit_to_user_mode_loop kernel/entry/common.c:164 [inline] exit_to_user_mode_prepare+0xd9/0xe0 kernel/entry/common.c:191 syscall_exit_to_user_mode+0x27/0x160 kernel/entry/common.c:266 do_syscall_64+0x3f/0x80 arch/x86/entry/common.c:56 entry_SYSCALL_64_after_hwframe+0x44/0xa9 RIP: 0033:0x7f0f8ad5cea7 Code: ff ff ff f7 d8 64 89 01 48 83 c8 ff c3 66 0f 1f 44 00 00 31 f6 e9 09 00 00 00 66 0f 1f 84 00 00 00 00 00 b8 a6 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 bc ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007ffde5617ba8 EFLAGS: 00000246 ORIG_RAX: 00000000000000a6 RAX: 0000000000000000 RBX: 0000000000000000 RCX: 00007f0f8ad5cea7 RDX: 00007ffde5617c7a RSI: 0000000000000002 RDI: 00007ffde5617c70 RBP: 00007ffde5617c70 R08: 00000000ffffffff R09: 00007ffde5617a40 R10: 000055555648db83 R11: 0000000000000246 R12: 00007f0f8adb5035 R13: 00007ffde5618d30 R14: 000055555648db00 R15: 00007ffde5618d70 ---[ end trace 7fef31c98e9ae4d1 ]---