All of lore.kernel.org
 help / color / mirror / Atom feed
* [syzbot] BUG: Dentry still in use in unmount
@ 2022-08-26 10:50 syzbot
  2023-12-16 23:19   ` [f2fs-dev] " syzbot
  0 siblings, 1 reply; 15+ messages in thread
From: syzbot @ 2022-08-26 10:50 UTC (permalink / raw)
  To: linux-fsdevel, linux-kernel, syzkaller-bugs, viro

Hello,

syzbot found the following issue on:

HEAD commit:    a41a877bc12d Merge branch 'for-next/fixes' into for-kernelci
git tree:       git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci
console output: https://syzkaller.appspot.com/x/log.txt?x=13901aad080000
kernel config:  https://syzkaller.appspot.com/x/.config?x=5cea15779c42821c
dashboard link: https://syzkaller.appspot.com/bug?extid=8608bb4553edb8c78f41
compiler:       Debian clang version 13.0.1-++20220126092033+75e33f71c2da-1~exp1~20220126212112.63, GNU ld (GNU Binutils for Debian) 2.35.2
userspace arch: arm64
syz repro:      https://syzkaller.appspot.com/x/repro.syz?x=10d75e95080000
C reproducer:   https://syzkaller.appspot.com/x/repro.c?x=15440857080000

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+8608bb4553edb8c78f41@syzkaller.appspotmail.com

BUG: Dentry 00000000133f9b6b{i=0,n=.reiserfs_priv}  still in use (1) [unmount of squashfs loop0]
------------[ cut here ]------------
WARNING: CPU: 1 PID: 3045 at fs/dcache.c:1676 umount_check+0xc0/0xc8 fs/dcache.c:1667
Modules linked in:
CPU: 1 PID: 3045 Comm: syz-executor425 Not tainted 6.0.0-rc2-syzkaller-16455-ga41a877bc12d #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/22/2022
pstate: 60400005 (nZCv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--)
pc : umount_check+0xc0/0xc8 fs/dcache.c:1667
lr : umount_check+0xc0/0xc8 fs/dcache.c:1667
sp : ffff800012ac3bc0
x29: ffff800012ac3bc0 x28: ffff0000c7bb05f8 x27: ffff80000d4e1e20
x26: ffff0000c7bb04e0 x25: 0000000000000001 x24: ffff0000c7bb05f8
x23: ffff0000c7bb0090 x22: ffff0000c7b9d138 x21: ffff8000085edd40
x20: 0000000000000000 x19: ffff0000c7bb0000 x18: 00000000000000c0
x17: 657375206e69206c x16: ffff80000dbb8658 x15: ffff0000c378cf80
x14: 0000000000000000 x13: 00000000ffffffff x12: ffff0000c378cf80
x11: ff808000081c39dc x10: 0000000000000000 x9 : 3f5cf90385ca4900
x8 : 3f5cf90385ca4900 x7 : ffff800008197c8c x6 : 0000000000000000
x5 : 0000000000000080 x4 : 0000000000000001 x3 : 0000000000000000
x2 : ffff0001fefddcd0 x1 : 0000000100000002 x0 : 0000000000000060
Call trace:
 umount_check+0xc0/0xc8 fs/dcache.c:1667
 d_walk+0x13c/0x55c fs/dcache.c:1386
 do_one_tree fs/dcache.c:1683 [inline]
 shrink_dcache_for_umount+0x60/0x140 fs/dcache.c:1699
 generic_shutdown_super+0x30/0x190 fs/super.c:473
 kill_block_super+0x30/0x78 fs/super.c:1427
 deactivate_locked_super+0x70/0xd4 fs/super.c:332
 deactivate_super+0xb8/0xbc fs/super.c:363
 cleanup_mnt+0x1f8/0x234 fs/namespace.c:1186
 __cleanup_mnt+0x20/0x30 fs/namespace.c:1193
 task_work_run+0xc4/0x208 kernel/task_work.c:177
 resume_user_mode_work include/linux/resume_user_mode.h:49 [inline]
 do_notify_resume+0x174/0x1d0 arch/arm64/kernel/signal.c:1127
 prepare_exit_to_user_mode arch/arm64/kernel/entry-common.c:137 [inline]
 exit_to_user_mode arch/arm64/kernel/entry-common.c:142 [inline]
 el0_svc+0x9c/0x150 arch/arm64/kernel/entry-common.c:625
 el0t_64_sync_handler+0x84/0xf0 arch/arm64/kernel/entry-common.c:642
 el0t_64_sync+0x18c/0x190
irq event stamp: 168478
hardirqs last  enabled at (168477): [<ffff8000081c1c48>] __up_console_sem+0xb0/0xfc kernel/printk/printk.c:264
hardirqs last disabled at (168478): [<ffff80000bffe9cc>] el1_dbg+0x24/0x5c arch/arm64/kernel/entry-common.c:395
softirqs last  enabled at (168132): [<ffff80000801c1f4>] local_bh_enable+0x10/0x34 include/linux/bottom_half.h:32
softirqs last disabled at (168130): [<ffff80000801c1c0>] local_bh_disable+0x10/0x34 include/linux/bottom_half.h:19
---[ end trace 0000000000000000 ]---
BUG: Dentry 00000000133f9b6b{i=0,n=.reiserfs_priv}  still in use (1) [unmount of squashfs loop0]
------------[ cut here ]------------
WARNING: CPU: 1 PID: 3045 at fs/dcache.c:1676 umount_check+0xc0/0xc8 fs/dcache.c:1667
Modules linked in:
CPU: 1 PID: 3045 Comm: syz-executor425 Tainted: G        W          6.0.0-rc2-syzkaller-16455-ga41a877bc12d #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/22/2022
pstate: 60400005 (nZCv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--)
pc : umount_check+0xc0/0xc8 fs/dcache.c:1667
lr : umount_check+0xc0/0xc8 fs/dcache.c:1667
sp : ffff800012ac3bc0
x29: ffff800012ac3bc0 x28: ffff0000c7bb05f8 x27: ffff80000d4e1e20
x26: ffff0000c7bb04e0 x25: 0000000000000001 x24: ffff0000c7bb05f8
x23: ffff0000c7bb0090 x22: ffff0000c7b9d138 x21: ffff8000085edd40
x20: 0000000000000000 x19: ffff0000c7bb0000 x18: 00000000000000c0
x17: 657375206e69206c x16: ffff80000dbb8658 x15: ffff0000c378cf80
x14: 0000000000000000 x13: 00000000ffffffff x12: ffff0000c378cf80
x11: ff808000081c39dc x10: 0000000000000000 x9 : 3f5cf90385ca4900
x8 : 3f5cf90385ca4900 x7 : ffff800008197c8c x6 : 0000000000000000
x5 : 0000000000000080 x4 : 0000000000000001 x3 : 0000000000000000
x2 : ffff0001fefddcd0 x1 : 0000000100000003 x0 : 0000000000000060
Call trace:
 umount_check+0xc0/0xc8 fs/dcache.c:1667
 d_walk+0x13c/0x55c fs/dcache.c:1386
 do_one_tree fs/dcache.c:1683 [inline]
 shrink_dcache_for_umount+0x60/0x140 fs/dcache.c:1699
 generic_shutdown_super+0x30/0x190 fs/super.c:473
 kill_block_super+0x30/0x78 fs/super.c:1427
 deactivate_locked_super+0x70/0xd4 fs/super.c:332
 deactivate_super+0xb8/0xbc fs/super.c:363
 cleanup_mnt+0x1f8/0x234 fs/namespace.c:1186
 __cleanup_mnt+0x20/0x30 fs/namespace.c:1193
 task_work_run+0xc4/0x208 kernel/task_work.c:177
 resume_user_mode_work include/linux/resume_user_mode.h:49 [inline]
 do_notify_resume+0x174/0x1d0 arch/arm64/kernel/signal.c:1127
 prepare_exit_to_user_mode arch/arm64/kernel/entry-common.c:137 [inline]
 exit_to_user_mode arch/arm64/kernel/entry-common.c:142 [inline]
 el0_svc+0x9c/0x150 arch/arm64/kernel/entry-common.c:625
 el0t_64_sync_handler+0x84/0xf0 arch/arm64/kernel/entry-common.c:642
 el0t_64_sync+0x18c/0x190
irq event stamp: 168928
hardirqs last  enabled at (168927): [<ffff8000081c1c48>] __up_console_sem+0xb0/0xfc kernel/printk/printk.c:264
hardirqs last disabled at (168928): [<ffff80000bffe9cc>] el1_dbg+0x24/0x5c arch/arm64/kernel/entry-common.c:395
softirqs last  enabled at (168922): [<ffff8000080102e4>] _stext+0x2e4/0x37c
softirqs last disabled at (168635): [<ffff800008104658>] do_softirq_own_stack include/asm-generic/softirq_stack.h:10 [inline]
softirqs last disabled at (168635): [<ffff800008104658>] invoke_softirq+0x70/0xbc kernel/softirq.c:452
---[ end trace 0000000000000000 ]---
VFS: Busy inodes after unmount of loop0. Self-destruct in 5 seconds.  Have a nice day...
BUG: Dentry 000000005431b8af{i=0,n=.reiserfs_priv}  still in use (1) [unmount of squashfs loop0]
------------[ cut here ]------------
WARNING: CPU: 0 PID: 3045 at fs/dcache.c:1676 umount_check+0xc0/0xc8 fs/dcache.c:1667
Modules linked in:
CPU: 0 PID: 3045 Comm: syz-executor425 Tainted: G        W          6.0.0-rc2-syzkaller-16455-ga41a877bc12d #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/22/2022
pstate: 60400005 (nZCv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--)
pc : umount_check+0xc0/0xc8 fs/dcache.c:1667
lr : umount_check+0xc0/0xc8 fs/dcache.c:1667
sp : ffff800012ac3bc0
x29: ffff800012ac3bc0 x28: ffff0000c7b98250 x27: ffff80000d4e1e20
x26: ffff0000c7b98138 x25: 0000000000000001 x24: ffff0000c7b98250
x23: ffff0000cc849570 x22: ffff0000cc99d750 x21: ffff8000085edd40
x20: 0000000000000000 x19: ffff0000cc8494e0 x18: 0000000000000350
x17: 657375206e69206c x16: ffff80000dbb8658 x15: ffff0000c378cf80
x14: 0000000000000000 x13: 00000000ffffffff x12: ffff0000c378cf80
x11: ff808000081c39dc x10: 0000000000000000 x9 : 3f5cf90385ca4900
x8 : 3f5cf90385ca4900 x7 : ffff800008197c8c x6 : 0000000000000000
x5 : 0000000000000080 x4 : 0000000000000001 x3 : 0000000000000000
x2 : ffff0001fefbecd0 x1 : 0000000100000002 x0 : 0000000000000060
Call trace:
 umount_check+0xc0/0xc8 fs/dcache.c:1667
 d_walk+0x13c/0x55c fs/dcache.c:1386
 do_one_tree fs/dcache.c:1683 [inline]
 shrink_dcache_for_umount+0x60/0x140 fs/dcache.c:1699
 generic_shutdown_super+0x30/0x190 fs/super.c:473
 kill_block_super+0x30/0x78 fs/super.c:1427
 deactivate_locked_super+0x70/0xd4 fs/super.c:332
 deactivate_super+0xb8/0xbc fs/super.c:363
 cleanup_mnt+0x1f8/0x234 fs/namespace.c:1186
 __cleanup_mnt+0x20/0x30 fs/namespace.c:1193
 task_work_run+0xc4/0x208 kernel/task_work.c:177
 resume_user_mode_work include/linux/resume_user_mode.h:49 [inline]
 do_notify_resume+0x174/0x1d0 arch/arm64/kernel/signal.c:1127
 prepare_exit_to_user_mode arch/arm64/kernel/entry-common.c:137 [inline]
 exit_to_user_mode arch/arm64/kernel/entry-common.c:142 [inline]
 el0_svc+0x9c/0x150 arch/arm64/kernel/entry-common.c:625
 el0t_64_sync_handler+0x84/0xf0 arch/arm64/kernel/entry-common.c:642
 el0t_64_sync+0x18c/0x190
irq event stamp: 257288
hardirqs last  enabled at (257287): [<ffff8000081c1c48>] __up_console_sem+0xb0/0xfc kernel/printk/printk.c:264
hardirqs last disabled at (257288): [<ffff80000bffe9cc>] el1_dbg+0x24/0x5c arch/arm64/kernel/entry-common.c:395
softirqs last  enabled at (256910): [<ffff80000801c1f4>] local_bh_enable+0x10/0x34 include/linux/bottom_half.h:32
softirqs last disabled at (256908): [<ffff80000801c1c0>] local_bh_disable+0x10/0x34 include/linux/bottom_half.h:19
---[ end trace 0000000000000000 ]---
VFS: Busy inodes after unmount of loop0. Self-destruct in 5 seconds.  Have a nice day...
BUG: Dentry 000000005431b8af{i=0,n=.reiserfs_priv}  still in use (1) [unmount of squashfs loop0]
------------[ cut here ]------------
WARNING: CPU: 1 PID: 3045 at fs/dcache.c:1676 umount_check+0xc0/0xc8 fs/dcache.c:1667
Modules linked in:
CPU: 1 PID: 3045 Comm: syz-executor425 Tainted: G        W          6.0.0-rc2-syzkaller-16455-ga41a877bc12d #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/22/2022
pstate: 60400005 (nZCv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--)
pc : umount_check+0xc0/0xc8 fs/dcache.c:1667
lr : umount_check+0xc0/0xc8 fs/dcache.c:1667
sp : ffff800012ac3bc0
x29: ffff800012ac3bc0 x28: ffff0000c7b98250 x27: ffff80000d4e1e20
x26: ffff0000c7b98138 x25: 0000000000000001 x24: ffff0000c7b98250
x23: ffff0000cc849570 x22: ffff0000cc88d138 x21: ffff8000085edd40
x20: 0000000000000000 x19: ffff0000cc8494e0 x18: 00000000000002ea
x17: 657375206e69206c x16: ffff80000dbb8658 x15: ffff0000c378cf80
x14: 0000000000000000 x13: 00000000ffffffff x12: ffff0000c378cf80
x11: ff808000081c39dc x10: 0000000000000000 x9 : 3f5cf90385ca4900
x8 : 3f5cf90385ca4900 x7 : ffff800008197c8c x6 : 0000000000000000
x5 : 0000000000000080 x4 : 0000000000000001 x3 : 0000000000000000
x2 : ffff0001fefddcd0 x1 : 0000000100000002 x0 : 0000000000000060
Call trace:
 umount_check+0xc0/0xc8 fs/dcache.c:1667
 d_walk+0x13c/0x55c fs/dcache.c:1386
 do_one_tree fs/dcache.c:1683 [inline]
 shrink_dcache_for_umount+0x60/0x140 fs/dcache.c:1699
 generic_shutdown_super+0x30/0x190 fs/super.c:473
 kill_block_super+0x30/0x78 fs/super.c:1427
 deactivate_locked_super+0x70/0xd4 fs/super.c:332
 deactivate_super+0xb8/0xbc fs/super.c:363
 cleanup_mnt+0x1f8/0x234 fs/namespace.c:1186
 __cleanup_mnt+0x20/0x30 fs/namespace.c:1193
 task_work_run+0xc4/0x208 kernel/task_work.c:177
 resume_user_mode_work include/linux/resume_user_mode.h:49 [inline]
 do_notify_resume+0x174/0x1d0 arch/arm64/kernel/signal.c:1127
 prepare_exit_to_user_mode arch/arm64/kernel/entry-common.c:137 [inline]
 exit_to_user_mode arch/arm64/kernel/entry-common.c:142 [inline]
 el0_svc+0x9c/0x150 arch/arm64/kernel/entry-common.c:625
 el0t_64_sync_handler+0x84/0xf0 arch/arm64/kernel/entry-common.c:642
 el0t_64_sync+0x18c/0x190
irq event stamp: 283828
hardirqs last  enabled at (283827): [<ffff8000081c1c48>] __up_console_sem+0xb0/0xfc kernel/printk/printk.c:264
hardirqs last disabled at (283828): [<ffff80000bffe9cc>] el1_dbg+0x24/0x5c arch/arm64/kernel/entry-common.c:395
softirqs last  enabled at (283438): [<ffff80000801c1f4>] local_bh_enable+0x10/0x34 include/linux/bottom_half.h:32
softirqs last disabled at (283436): [<ffff80000801c1c0>] local_bh_disable+0x10/0x34 include/linux/bottom_half.h:19
---[ end trace 0000000000000000 ]---
VFS: Busy inodes after unmount of loop0. Self-destruct in 5 seconds.  Have a nice day...
BUG: Dentry 000000005431b8af{i=0,n=.reiserfs_priv}  still in use (1) [unmount of squashfs loop0]
------------[ cut here ]------------
WARNING: CPU: 1 PID: 3045 at fs/dcache.c:1676 umount_check+0xc0/0xc8 fs/dcache.c:1667
Modules linked in:
CPU: 1 PID: 3045 Comm: syz-executor425 Tainted: G        W          6.0.0-rc2-syzkaller-16455-ga41a877bc12d #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/22/2022
pstate: 60400005 (nZCv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--)
pc : umount_check+0xc0/0xc8 fs/dcache.c:1667
lr : umount_check+0xc0/0xc8 fs/dcache.c:1667
sp : ffff800012ac3bc0
x29: ffff800012ac3bc0 x28: ffff0000c7b98250 x27: ffff80000d4e1e20
x26: ffff0000c7b98138 x25: 0000000000000001 x24: ffff0000c7b98250
x23: ffff0000cc849570 x22: ffff0000cc88dc30 x21: ffff8000085edd40
x20: 0000000000000000 x19: ffff0000cc8494e0 x18: 0000000000000109
x17: 657375206e69206c x16: ffff80000dbb8658 x15: ffff0000c378cf80
x14: 0000000000000000 x13: 00000000ffffffff x12: ffff0000c378cf80
x11: ff808000081c39dc x10: 0000000000000000 x9 : 3f5cf90385ca4900
x8 : 3f5cf90385ca4900 x7 : ffff800008197c8c x6 : 0000000000000000
x5 : 0000000000000080 x4 : 0000000000000001 x3 : 0000000000000000
x2 : ffff0001fefddcd0 x1 : 0000000000000002 x0 : 0000000000000060
Call trace:
 umount_check+0xc0/0xc8 fs/dcache.c:1667
 d_walk+0x13c/0x55c fs/dcache.c:1386
 do_one_tree fs/dcache.c:1683 [inline]
 shrink_dcache_for_umount+0x60/0x140 fs/dcache.c:1699
 generic_shutdown_super+0x30/0x190 fs/super.c:473
 kill_block_super+0x30/0x78 fs/super.c:1427
 deactivate_locked_super+0x70/0xd4 fs/super.c:332
 deactivate_super+0xb8/0xbc fs/super.c:363
 cleanup_mnt+0x1f8/0x234 fs/namespace.c:1186
 __cleanup_mnt+0x20/0x30 fs/namespace.c:1193
 task_work_run+0xc4/0x208 kernel/task_work.c:177
 resume_user_mode_work include/linux/resume_user_mode.h:49 [inline]
 do_notify_resume+0x174/0x1d0 arch/arm64/kernel/signal.c:1127
 prepare_exit_to_user_mode arch/arm64/kernel/entry-common.c:137 [inline]
 exit_to_user_mode arch/arm64/kernel/entry-common.c:142 [inline]
 el0_svc+0x9c/0x150 arch/arm64/kernel/entry-common.c:625
 el0t_64_sync_handler+0x84/0xf0 arch/arm64/kernel/entry-common.c:642
 el0t_64_sync+0x18c/0x190
irq event stamp: 335826
hardirqs last  enabled at (335825): [<ffff8000081c1c48>] __up_console_sem+0xb0/0xfc kernel/printk/printk.c:264
hardirqs last disabled at (335826): [<ffff80000bffe9cc>] el1_dbg+0x24/0x5c arch/arm64/kernel/entry-common.c:395
softirqs last  enabled at (335820): [<ffff8000080102e4>] _stext+0x2e4/0x37c
softirqs last disabled at (335803): [<ffff800008104658>] do_softirq_own_stack include/asm-generic/softirq_stack.h:10 [inline]
softirqs last disabled at (335803): [<ffff800008104658>] invoke_softirq+0x70/0xbc kernel/softirq.c:452
---[ end trace 0000000000000000 ]---
VFS: Busy inodes after unmount of loop0. Self-destruct in 5 seconds.  Have a nice day...
 loop0: unable to read partition table
loop0: partition table beyond EOD, truncated
BUG: Dentry 00000000cd442007{i=0,n=.reiserfs_priv}  still in use (1) [unmount of squashfs loop0]
------------[ cut here ]------------
WARNING: CPU: 1 PID: 3045 at fs/dcache.c:1676 umount_check+0xc0/0xc8 fs/dcache.c:1667
Modules linked in:
CPU: 1 PID: 3045 Comm: syz-executor425 Tainted: G        W          6.0.0-rc2-syzkaller-16455-ga41a877bc12d #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/22/2022
pstate: 60400005 (nZCv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--)
pc : umount_check+0xc0/0xc8 fs/dcache.c:1667
lr : umount_check+0xc0/0xc8 fs/dcache.c:1667
sp : ffff800012ac3bc0
x29: ffff800012ac3bc0 x28: ffff0000cc88d5f8 x27: ffff80000d4e1e20
x26: ffff0000cc88d4e0 x25: 0000000000000001 x24: ffff0000cc88d5f8
x23: ffff0000cc88d438 x22: ffff0000ca0579c0 x21: ffff8000085edd40
x20: 0000000000000000 x19: ffff0000cc88d3a8 x18: 000000000000009d
x17: 657375206e69206c x16: ffff80000dbb8658 x15: ffff0000c378cf80
x14: 0000000000000000 x13: 00000000ffffffff x12: ffff0000c378cf80
x11: ff808000081c39dc x10: 0000000000000000 x9 : 3f5cf90385ca4900
x8 : 3f5cf90385ca4900 x7 : ffff800008197c8c x6 : 0000000000000000
x5 : 0000000000000080 x4 : 0000000000000001 x3 : 0000000000000000
x2 : ffff0001fefddcd0 x1 : 0000000100000002 x0 : 0000000000000060
Call trace:
 umount_check+0xc0/0xc8 fs/dcache.c:1667
 d_walk+0x13c/0x55c fs/dcache.c:1386
 do_one_tree fs/dcache.c:1683 [inline]
 shrink_dcache_for_umount+0x60/0x140 fs/dcache.c:1699
 generic_shutdown_super+0x30/0x190 fs/super.c:473
 kill_block_super+0x30/0x78 fs/super.c:1427
 deactivate_locked_super+0x70/0xd4 fs/super.c:332
 deactivate_super+0xb8/0xbc fs/super.c:363
 cleanup_mnt+0x1f8/0x234 fs/namespace.c:1186
 __cleanup_mnt+0x20/0x30 fs/namespace.c:1193
 task_work_run+0xc4/0x208 kernel/task_work.c:177
 resume_user_mode_work include/linux/resume_user_mode.h:49 [inline]
 do_notify_resume+0x174/0x1d0 arch/arm64/kernel/signal.c:1127
 prepare_exit_to_user_mode arch/arm64/kernel/entry-common.c:137 [inline]
 exit_to_user_mode arch/arm64/kernel/entry-common.c:142 [inline]
 el0_svc+0x9c/0x150 arch/arm64/kernel/entry-common.c:625
 el0t_64_sync_handler+0x84/0xf0 arch/arm64/kernel/entry-common.c:642
 el0t_64_sync+0x18c/0x190
irq event stamp: 366714
hardirqs last  enabled at (366713): [<ffff8000081c1c48>] __up_console_sem+0xb0/0xfc kernel/printk/printk.c:264
hardirqs last disabled at (366714): [<ffff80000bffe9cc>] el1_dbg+0x24/0x5c arch/arm64/kernel/entry-common.c:395
softirqs last  enabled at (366346): [<ffff80000801c1f4>] local_bh_enable+0x10/0x34 include/linux/bottom_half.h:32
softirqs last disabled at (366344): [<ffff80000801c1c0>] local_bh_disable+0x10/0x34 include/linux/bottom_half.h:19
---[ end trace 0000000000000000 ]---
VFS: Busy inodes after unmount of loop0. Self-destruct in 5 seconds.  Have a nice day...
 loop0: unable to read partition table
loop0: partition table beyond EOD, truncated


---
This report is generated by a bot. It may contain errors.
See https://goo.gl/tpsmEJ for more information about syzbot.
syzbot engineers can be reached at syzkaller@googlegroups.com.

syzbot will keep track of this issue. See:
https://goo.gl/tpsmEJ#status for how to communicate with syzbot.
syzbot can test patches for this issue, for details see:
https://goo.gl/tpsmEJ#testing-patches

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [syzbot] [reiserfs?] [squashfs?] BUG: Dentry still in use in unmount
  2022-08-26 10:50 [syzbot] BUG: Dentry still in use in unmount syzbot
@ 2023-12-16 23:19   ` syzbot
  0 siblings, 0 replies; 15+ messages in thread
From: syzbot @ 2023-12-16 23:19 UTC (permalink / raw)
  To: amir73il, chao, jaegeuk, linux-f2fs-devel, linux-fsdevel,
	linux-kernel, phillip, reiserfs-devel, squashfs-devel,
	syzkaller-bugs, terrelln, viro

syzbot has bisected this issue to:

commit c63e56a4a6523fcb1358e1878607d77a40b534bb
Author: Amir Goldstein <amir73il@gmail.com>
Date:   Wed Aug 16 09:42:18 2023 +0000

    ovl: do not open/llseek lower file with upper sb_writers held

bisection log:  https://syzkaller.appspot.com/x/bisect.txt?x=13723c01e80000
start commit:   3bd7d7488169 Merge tag 'io_uring-6.7-2023-12-15' of git://..
git tree:       upstream
final oops:     https://syzkaller.appspot.com/x/report.txt?x=10f23c01e80000
console output: https://syzkaller.appspot.com/x/log.txt?x=17723c01e80000
kernel config:  https://syzkaller.appspot.com/x/.config?x=53ec3da1d259132f
dashboard link: https://syzkaller.appspot.com/bug?extid=8608bb4553edb8c78f41
syz repro:      https://syzkaller.appspot.com/x/repro.syz?x=17b8b6e1e80000
C reproducer:   https://syzkaller.appspot.com/x/repro.c?x=16ec773ae80000

Reported-by: syzbot+8608bb4553edb8c78f41@syzkaller.appspotmail.com
Fixes: c63e56a4a652 ("ovl: do not open/llseek lower file with upper sb_writers held")

For information about bisection process see: https://goo.gl/tpsmEJ#bisection

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [f2fs-dev] [syzbot] [reiserfs?] [squashfs?] BUG: Dentry still in use in unmount
@ 2023-12-16 23:19   ` syzbot
  0 siblings, 0 replies; 15+ messages in thread
From: syzbot @ 2023-12-16 23:19 UTC (permalink / raw)
  To: amir73il, chao, jaegeuk, linux-f2fs-devel, linux-fsdevel,
	linux-kernel, phillip, reiserfs-devel, squashfs-devel,
	syzkaller-bugs, terrelln, viro

syzbot has bisected this issue to:

commit c63e56a4a6523fcb1358e1878607d77a40b534bb
Author: Amir Goldstein <amir73il@gmail.com>
Date:   Wed Aug 16 09:42:18 2023 +0000

    ovl: do not open/llseek lower file with upper sb_writers held

bisection log:  https://syzkaller.appspot.com/x/bisect.txt?x=13723c01e80000
start commit:   3bd7d7488169 Merge tag 'io_uring-6.7-2023-12-15' of git://..
git tree:       upstream
final oops:     https://syzkaller.appspot.com/x/report.txt?x=10f23c01e80000
console output: https://syzkaller.appspot.com/x/log.txt?x=17723c01e80000
kernel config:  https://syzkaller.appspot.com/x/.config?x=53ec3da1d259132f
dashboard link: https://syzkaller.appspot.com/bug?extid=8608bb4553edb8c78f41
syz repro:      https://syzkaller.appspot.com/x/repro.syz?x=17b8b6e1e80000
C reproducer:   https://syzkaller.appspot.com/x/repro.c?x=16ec773ae80000

Reported-by: syzbot+8608bb4553edb8c78f41@syzkaller.appspotmail.com
Fixes: c63e56a4a652 ("ovl: do not open/llseek lower file with upper sb_writers held")

For information about bisection process see: https://goo.gl/tpsmEJ#bisection


_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [reiserfs?] [squashfs?] BUG: Dentry still in use in unmount
  2023-12-16 23:19   ` [f2fs-dev] " syzbot
  (?)
@ 2023-12-17  3:39   ` Edward Adam Davis
  2023-12-17  4:04     ` [syzbot] " syzbot
  -1 siblings, 1 reply; 15+ messages in thread
From: Edward Adam Davis @ 2023-12-17  3:39 UTC (permalink / raw)
  To: syzbot+8608bb4553edb8c78f41; +Cc: linux-kernel, syzkaller-bugs

please test BUG: Dentry still in use in unmount

#syz test https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 3bd7d7488169
diff --git a/fs/overlayfs/copy_up.c b/fs/overlayfs/copy_up.c
index 4382881b0709..c366b0c6fad2 100644
--- a/fs/overlayfs/copy_up.c
+++ b/fs/overlayfs/copy_up.c
@@ -808,6 +808,7 @@ static int ovl_copy_up_workdir(struct ovl_copy_up_ctx *c)
 	return err;
 
 cleanup:
+	ovl_end_write(c->dentry);
 	ovl_cleanup(ofs, wdir, temp);
 	dput(temp);
 	goto unlock;


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* Re: [syzbot] [reiserfs?] [squashfs?] BUG: Dentry still in use in unmount
  2023-12-17  3:39   ` Edward Adam Davis
@ 2023-12-17  4:04     ` syzbot
  0 siblings, 0 replies; 15+ messages in thread
From: syzbot @ 2023-12-17  4:04 UTC (permalink / raw)
  To: eadavis, linux-kernel, syzkaller-bugs

Hello,

syzbot has tested the proposed patch but the reproducer is still triggering an issue:
BUG: Dentry still in use in unmount

------------[ cut here ]------------
BUG: Dentry ffff88807d684a48{i=1a,n=#3}  still in use (1) [unmount of f2fs loop0]
WARNING: CPU: 0 PID: 5411 at fs/dcache.c:1675 umount_check+0x189/0x1e0 fs/dcache.c:1667
Modules linked in:
CPU: 0 PID: 5411 Comm: syz-executor.0 Not tainted 6.7.0-rc5-syzkaller-00200-g3bd7d7488169-dirty #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 11/17/2023
RIP: 0010:umount_check+0x189/0x1e0 fs/dcache.c:1667
Code: e8 ff 4c 8b 0b 48 81 c5 60 06 00 00 48 c7 c7 c0 c7 77 8b 4c 89 fe 4c 89 f2 4c 89 f9 45 89 e8 55 e8 8c c8 52 ff 48 83 c4 08 90 <0f> 0b 90 90 31 c0 5b 41 5c 41 5d 41 5e 41 5f 5d c3 89 f9 80 e1 07
RSP: 0018:ffffc90005247af8 EFLAGS: 00010282
RAX: 6b1a0fb562407300 RBX: ffffffff8dec05e0 RCX: ffff88807882bb80
RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000
RBP: ffff88807eda4660 R08: ffffffff81545d52 R09: 1ffff92000a48eb0
R10: dffffc0000000000 R11: fffff52000a48eb1 R12: dffffc0000000000
R13: 0000000000000001 R14: 000000000000001a R15: ffff88807d684a48
FS:  0000555556544480(0000) GS:ffff8880b9800000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f3d029a6440 CR3: 000000002acc0000 CR4: 00000000003506f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 <TASK>
 d_walk+0x1f6/0x6e0 fs/dcache.c:1386
 do_one_tree+0x35/0xe0 fs/dcache.c:1682
 shrink_dcache_for_umount+0x7d/0x130 fs/dcache.c:1698
 generic_shutdown_super+0x6a/0x2c0 fs/super.c:668
 kill_block_super+0x44/0x90 fs/super.c:1667
 kill_f2fs_super+0x303/0x3b0 fs/f2fs/super.c:4933
 deactivate_locked_super+0xc1/0x130 fs/super.c:484
 cleanup_mnt+0x426/0x4c0 fs/namespace.c:1256
 task_work_run+0x24a/0x300 kernel/task_work.c:180
 resume_user_mode_work include/linux/resume_user_mode.h:49 [inline]
 exit_to_user_mode_loop+0xde/0x100 kernel/entry/common.c:171
 exit_to_user_mode_prepare+0xb1/0x150 kernel/entry/common.c:204
 __syscall_exit_to_user_mode_work kernel/entry/common.c:285 [inline]
 syscall_exit_to_user_mode+0x69/0x2a0 kernel/entry/common.c:296
 do_syscall_64+0x52/0x110 arch/x86/entry/common.c:89
 entry_SYSCALL_64_after_hwframe+0x63/0x6b
RIP: 0033:0x7f5ed4c7ded7
Code: b0 ff ff ff f7 d8 64 89 01 48 83 c8 ff c3 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 00 f0 ff ff 77 01 c3 48 c7 c2 b0 ff ff ff f7 d8 64 89 02 b8
RSP: 002b:00007ffdf73a1ae8 EFLAGS: 00000246 ORIG_RAX: 00000000000000a6
RAX: 0000000000000000 RBX: 0000000000000000 RCX: 00007f5ed4c7ded7
RDX: 0000000000000000 RSI: 000000000000000a RDI: 00007ffdf73a1ba0
RBP: 00007ffdf73a1ba0 R08: 0000000000000000 R09: 0000000000000000
R10: 00000000ffffffff R11: 0000000000000246 R12: 00007ffdf73a2c60
R13: 00007f5ed4cc73b9 R14: 0000000000015340 R15: 000000000000000d
 </TASK>


Tested on:

commit:         3bd7d748 Merge tag 'io_uring-6.7-2023-12-15' of git://..
git tree:       https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
console output: https://syzkaller.appspot.com/x/log.txt?x=169fe8f1e80000
kernel config:  https://syzkaller.appspot.com/x/.config?x=53ec3da1d259132f
dashboard link: https://syzkaller.appspot.com/bug?extid=8608bb4553edb8c78f41
compiler:       Debian clang version 15.0.6, GNU ld (GNU Binutils for Debian) 2.40
patch:          https://syzkaller.appspot.com/x/patch.diff?x=171fe8f1e80000


^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [reiserfs?] [squashfs?] BUG: Dentry still in use in unmount
  2023-12-16 23:19   ` [f2fs-dev] " syzbot
  (?)
  (?)
@ 2023-12-17  5:43   ` Edward Adam Davis
  2023-12-17  6:09     ` [syzbot] " syzbot
  -1 siblings, 1 reply; 15+ messages in thread
From: Edward Adam Davis @ 2023-12-17  5:43 UTC (permalink / raw)
  To: syzbot+8608bb4553edb8c78f41; +Cc: linux-kernel, syzkaller-bugs

please test BUG: Dentry still in use in unmount

#syz test https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 3bd7d7488169

diff --git a/fs/overlayfs/copy_up.c b/fs/overlayfs/copy_up.c
index 4382881b0709..0348ff4374fa 100644
--- a/fs/overlayfs/copy_up.c
+++ b/fs/overlayfs/copy_up.c
@@ -731,10 +731,13 @@ static int ovl_copy_up_workdir(struct ovl_copy_up_ctx *c)
 		.rdev = c->stat.rdev,
 		.link = c->link
 	};
+	err = -EIO;
+	if (lock_rename(c->workdir, c->destdir) != NULL)
+		goto unlock;
 
 	err = ovl_prep_cu_creds(c->dentry, &cc);
 	if (err)
-		return err;
+		goto unlock;
 
 	ovl_start_write(c->dentry);
 	inode_lock(wdir);
@@ -743,8 +746,9 @@ static int ovl_copy_up_workdir(struct ovl_copy_up_ctx *c)
 	ovl_end_write(c->dentry);
 	ovl_revert_cu_creds(&cc);
 
+	err = PTR_ERR(temp);
 	if (IS_ERR(temp))
-		return PTR_ERR(temp);
+		goto unlock;
 
 	/*
 	 * Copy up data first and then xattrs. Writing data after
@@ -760,10 +764,9 @@ static int ovl_copy_up_workdir(struct ovl_copy_up_ctx *c)
 	 * If temp was moved, abort without the cleanup.
 	 */
 	ovl_start_write(c->dentry);
-	if (lock_rename(c->workdir, c->destdir) != NULL ||
-	    temp->d_parent != c->workdir) {
+	if (temp->d_parent != c->workdir) {
 		err = -EIO;
-		goto unlock;
+		goto unlockcd;
 	} else if (err) {
 		goto cleanup;
 	}
@@ -801,16 +804,18 @@ static int ovl_copy_up_workdir(struct ovl_copy_up_ctx *c)
 	ovl_inode_update(inode, temp);
 	if (S_ISDIR(inode->i_mode))
 		ovl_set_flag(OVL_WHITEOUTS, inode);
+
+unlockcd:
+	ovl_end_write(c->dentry);
 unlock:
 	unlock_rename(c->workdir, c->destdir);
-	ovl_end_write(c->dentry);
 
 	return err;
 
 cleanup:
 	ovl_cleanup(ofs, wdir, temp);
 	dput(temp);
-	goto unlock;
+	goto unlockcd;
 }
 
 /* Copyup using O_TMPFILE which does not require cross dir locking */


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* Re: [syzbot] [reiserfs?] [squashfs?] BUG: Dentry still in use in unmount
  2023-12-17  5:43   ` Edward Adam Davis
@ 2023-12-17  6:09     ` syzbot
  0 siblings, 0 replies; 15+ messages in thread
From: syzbot @ 2023-12-17  6:09 UTC (permalink / raw)
  To: eadavis, linux-kernel, syzkaller-bugs

Hello,

syzbot has tested the proposed patch and the reproducer did not trigger any issue:

Reported-and-tested-by: syzbot+8608bb4553edb8c78f41@syzkaller.appspotmail.com

Tested on:

commit:         3bd7d748 Merge tag 'io_uring-6.7-2023-12-15' of git://..
git tree:       https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
console output: https://syzkaller.appspot.com/x/log.txt?x=17c50eaee80000
kernel config:  https://syzkaller.appspot.com/x/.config?x=53ec3da1d259132f
dashboard link: https://syzkaller.appspot.com/bug?extid=8608bb4553edb8c78f41
compiler:       Debian clang version 15.0.6, GNU ld (GNU Binutils for Debian) 2.40
patch:          https://syzkaller.appspot.com/x/patch.diff?x=16559206e80000

Note: testing is done by a robot and is best-effort only.

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [f2fs-dev] [PATCH] ovl: fix BUG: Dentry still in use in unmount
  2023-12-16 23:19   ` [f2fs-dev] " syzbot
@ 2023-12-17  8:11     ` Edward Adam Davis
  -1 siblings, 0 replies; 15+ messages in thread
From: Edward Adam Davis via Linux-f2fs-devel @ 2023-12-17  8:11 UTC (permalink / raw)
  To: syzbot+8608bb4553edb8c78f41
  Cc: squashfs-devel, reiserfs-devel, amir73il, syzkaller-bugs,
	linux-kernel, linux-f2fs-devel, terrelln, viro, phillip,
	linux-fsdevel, jaegeuk

workdir and destdir could be the same when copying up to indexdir.

Fixes: c63e56a4a652 ("ovl: do not open/llseek lower file with upper sb_writers held")
Reported-and-tested-by: syzbot+8608bb4553edb8c78f41@syzkaller.appspotmail.com
Signed-off-by: Edward Adam Davis <eadavis@qq.com>
---
 fs/overlayfs/copy_up.c | 20 +++++++++++++-------
 1 file changed, 13 insertions(+), 7 deletions(-)

diff --git a/fs/overlayfs/copy_up.c b/fs/overlayfs/copy_up.c
index 4382881b0709..ae5eb442025d 100644
--- a/fs/overlayfs/copy_up.c
+++ b/fs/overlayfs/copy_up.c
@@ -731,10 +731,14 @@ static int ovl_copy_up_workdir(struct ovl_copy_up_ctx *c)
 		.rdev = c->stat.rdev,
 		.link = c->link
 	};
+	err = -EIO;
+	/* workdir and destdir could be the same when copying up to indexdir */
+	if (lock_rename(c->workdir, c->destdir) != NULL)
+		goto unlock;
 
 	err = ovl_prep_cu_creds(c->dentry, &cc);
 	if (err)
-		return err;
+		goto unlock;
 
 	ovl_start_write(c->dentry);
 	inode_lock(wdir);
@@ -743,8 +747,9 @@ static int ovl_copy_up_workdir(struct ovl_copy_up_ctx *c)
 	ovl_end_write(c->dentry);
 	ovl_revert_cu_creds(&cc);
 
+	err = PTR_ERR(temp);
 	if (IS_ERR(temp))
-		return PTR_ERR(temp);
+		goto unlock;
 
 	/*
 	 * Copy up data first and then xattrs. Writing data after
@@ -760,10 +765,9 @@ static int ovl_copy_up_workdir(struct ovl_copy_up_ctx *c)
 	 * If temp was moved, abort without the cleanup.
 	 */
 	ovl_start_write(c->dentry);
-	if (lock_rename(c->workdir, c->destdir) != NULL ||
-	    temp->d_parent != c->workdir) {
+	if (temp->d_parent != c->workdir) {
 		err = -EIO;
-		goto unlock;
+		goto unlockcd;
 	} else if (err) {
 		goto cleanup;
 	}
@@ -801,16 +805,18 @@ static int ovl_copy_up_workdir(struct ovl_copy_up_ctx *c)
 	ovl_inode_update(inode, temp);
 	if (S_ISDIR(inode->i_mode))
 		ovl_set_flag(OVL_WHITEOUTS, inode);
+
+unlockcd:
+	ovl_end_write(c->dentry);
 unlock:
 	unlock_rename(c->workdir, c->destdir);
-	ovl_end_write(c->dentry);
 
 	return err;
 
 cleanup:
 	ovl_cleanup(ofs, wdir, temp);
 	dput(temp);
-	goto unlock;
+	goto unlockcd;
 }
 
 /* Copyup using O_TMPFILE which does not require cross dir locking */
-- 
2.43.0



_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH] ovl: fix BUG: Dentry still in use in unmount
@ 2023-12-17  8:11     ` Edward Adam Davis
  0 siblings, 0 replies; 15+ messages in thread
From: Edward Adam Davis @ 2023-12-17  8:11 UTC (permalink / raw)
  To: syzbot+8608bb4553edb8c78f41
  Cc: amir73il, chao, jaegeuk, linux-f2fs-devel, linux-fsdevel,
	linux-kernel, phillip, reiserfs-devel, squashfs-devel,
	syzkaller-bugs, terrelln, viro

workdir and destdir could be the same when copying up to indexdir.

Fixes: c63e56a4a652 ("ovl: do not open/llseek lower file with upper sb_writers held")
Reported-and-tested-by: syzbot+8608bb4553edb8c78f41@syzkaller.appspotmail.com
Signed-off-by: Edward Adam Davis <eadavis@qq.com>
---
 fs/overlayfs/copy_up.c | 20 +++++++++++++-------
 1 file changed, 13 insertions(+), 7 deletions(-)

diff --git a/fs/overlayfs/copy_up.c b/fs/overlayfs/copy_up.c
index 4382881b0709..ae5eb442025d 100644
--- a/fs/overlayfs/copy_up.c
+++ b/fs/overlayfs/copy_up.c
@@ -731,10 +731,14 @@ static int ovl_copy_up_workdir(struct ovl_copy_up_ctx *c)
 		.rdev = c->stat.rdev,
 		.link = c->link
 	};
+	err = -EIO;
+	/* workdir and destdir could be the same when copying up to indexdir */
+	if (lock_rename(c->workdir, c->destdir) != NULL)
+		goto unlock;
 
 	err = ovl_prep_cu_creds(c->dentry, &cc);
 	if (err)
-		return err;
+		goto unlock;
 
 	ovl_start_write(c->dentry);
 	inode_lock(wdir);
@@ -743,8 +747,9 @@ static int ovl_copy_up_workdir(struct ovl_copy_up_ctx *c)
 	ovl_end_write(c->dentry);
 	ovl_revert_cu_creds(&cc);
 
+	err = PTR_ERR(temp);
 	if (IS_ERR(temp))
-		return PTR_ERR(temp);
+		goto unlock;
 
 	/*
 	 * Copy up data first and then xattrs. Writing data after
@@ -760,10 +765,9 @@ static int ovl_copy_up_workdir(struct ovl_copy_up_ctx *c)
 	 * If temp was moved, abort without the cleanup.
 	 */
 	ovl_start_write(c->dentry);
-	if (lock_rename(c->workdir, c->destdir) != NULL ||
-	    temp->d_parent != c->workdir) {
+	if (temp->d_parent != c->workdir) {
 		err = -EIO;
-		goto unlock;
+		goto unlockcd;
 	} else if (err) {
 		goto cleanup;
 	}
@@ -801,16 +805,18 @@ static int ovl_copy_up_workdir(struct ovl_copy_up_ctx *c)
 	ovl_inode_update(inode, temp);
 	if (S_ISDIR(inode->i_mode))
 		ovl_set_flag(OVL_WHITEOUTS, inode);
+
+unlockcd:
+	ovl_end_write(c->dentry);
 unlock:
 	unlock_rename(c->workdir, c->destdir);
-	ovl_end_write(c->dentry);
 
 	return err;
 
 cleanup:
 	ovl_cleanup(ofs, wdir, temp);
 	dput(temp);
-	goto unlock;
+	goto unlockcd;
 }
 
 /* Copyup using O_TMPFILE which does not require cross dir locking */
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* Re: [syzbot] [reiserfs?] [squashfs?] BUG: Dentry still in use in unmount
  2023-12-16 23:19   ` [f2fs-dev] " syzbot
@ 2023-12-17  9:16     ` Amir Goldstein
  -1 siblings, 0 replies; 15+ messages in thread
From: Amir Goldstein @ 2023-12-17  9:16 UTC (permalink / raw)
  To: syzbot
  Cc: chao, jaegeuk, linux-f2fs-devel, linux-fsdevel, linux-kernel,
	phillip, reiserfs-devel, squashfs-devel, syzkaller-bugs,
	terrelln, viro

On Sun, Dec 17, 2023 at 1:19 AM syzbot
<syzbot+8608bb4553edb8c78f41@syzkaller.appspotmail.com> wrote:
>
> syzbot has bisected this issue to:
>
> commit c63e56a4a6523fcb1358e1878607d77a40b534bb
> Author: Amir Goldstein <amir73il@gmail.com>
> Date:   Wed Aug 16 09:42:18 2023 +0000
>
>     ovl: do not open/llseek lower file with upper sb_writers held
>
> bisection log:  https://syzkaller.appspot.com/x/bisect.txt?x=13723c01e80000
> start commit:   3bd7d7488169 Merge tag 'io_uring-6.7-2023-12-15' of git://..
> git tree:       upstream
> final oops:     https://syzkaller.appspot.com/x/report.txt?x=10f23c01e80000
> console output: https://syzkaller.appspot.com/x/log.txt?x=17723c01e80000
> kernel config:  https://syzkaller.appspot.com/x/.config?x=53ec3da1d259132f
> dashboard link: https://syzkaller.appspot.com/bug?extid=8608bb4553edb8c78f41
> syz repro:      https://syzkaller.appspot.com/x/repro.syz?x=17b8b6e1e80000
> C reproducer:   https://syzkaller.appspot.com/x/repro.c?x=16ec773ae80000
>
> Reported-by: syzbot+8608bb4553edb8c78f41@syzkaller.appspotmail.com
> Fixes: c63e56a4a652 ("ovl: do not open/llseek lower file with upper sb_writers held")
>

#syz test: https://github.com/amir73il/linux ovl-fixes

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [f2fs-dev] [syzbot] [reiserfs?] [squashfs?] BUG: Dentry still in use in unmount
@ 2023-12-17  9:16     ` Amir Goldstein
  0 siblings, 0 replies; 15+ messages in thread
From: Amir Goldstein @ 2023-12-17  9:16 UTC (permalink / raw)
  To: syzbot
  Cc: squashfs-devel, reiserfs-devel, syzkaller-bugs, linux-kernel,
	linux-f2fs-devel, terrelln, viro, phillip, linux-fsdevel,
	jaegeuk

On Sun, Dec 17, 2023 at 1:19 AM syzbot
<syzbot+8608bb4553edb8c78f41@syzkaller.appspotmail.com> wrote:
>
> syzbot has bisected this issue to:
>
> commit c63e56a4a6523fcb1358e1878607d77a40b534bb
> Author: Amir Goldstein <amir73il@gmail.com>
> Date:   Wed Aug 16 09:42:18 2023 +0000
>
>     ovl: do not open/llseek lower file with upper sb_writers held
>
> bisection log:  https://syzkaller.appspot.com/x/bisect.txt?x=13723c01e80000
> start commit:   3bd7d7488169 Merge tag 'io_uring-6.7-2023-12-15' of git://..
> git tree:       upstream
> final oops:     https://syzkaller.appspot.com/x/report.txt?x=10f23c01e80000
> console output: https://syzkaller.appspot.com/x/log.txt?x=17723c01e80000
> kernel config:  https://syzkaller.appspot.com/x/.config?x=53ec3da1d259132f
> dashboard link: https://syzkaller.appspot.com/bug?extid=8608bb4553edb8c78f41
> syz repro:      https://syzkaller.appspot.com/x/repro.syz?x=17b8b6e1e80000
> C reproducer:   https://syzkaller.appspot.com/x/repro.c?x=16ec773ae80000
>
> Reported-by: syzbot+8608bb4553edb8c78f41@syzkaller.appspotmail.com
> Fixes: c63e56a4a652 ("ovl: do not open/llseek lower file with upper sb_writers held")
>

#syz test: https://github.com/amir73il/linux ovl-fixes


_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH] ovl: fix BUG: Dentry still in use in unmount
  2023-12-17  8:11     ` Edward Adam Davis
@ 2023-12-17  9:32       ` Amir Goldstein
  -1 siblings, 0 replies; 15+ messages in thread
From: Amir Goldstein @ 2023-12-17  9:32 UTC (permalink / raw)
  To: Edward Adam Davis, viro
  Cc: syzbot+8608bb4553edb8c78f41, chao, jaegeuk, linux-f2fs-devel,
	linux-fsdevel, linux-kernel, phillip, reiserfs-devel,
	squashfs-devel, syzkaller-bugs, terrelln, overlayfs,
	Miklos Szeredi

Hi Edward,

Thanks for the quick fix, but it is incorrect.

On Sun, Dec 17, 2023 at 10:11 AM Edward Adam Davis <eadavis@qq.com> wrote:
>
> workdir and destdir could be the same when copying up to indexdir.

This is not the reason for the bug, the reason is:

    syzbot exercised the forbidden practice of moving the workdir under
    lowerdir while overlayfs is mounted and tripped a dentry reference leak.

>
> Fixes: c63e56a4a652 ("ovl: do not open/llseek lower file with upper sb_writers held")
> Reported-and-tested-by: syzbot+8608bb4553edb8c78f41@syzkaller.appspotmail.com
> Signed-off-by: Edward Adam Davis <eadavis@qq.com>
> ---
>  fs/overlayfs/copy_up.c | 20 +++++++++++++-------
>  1 file changed, 13 insertions(+), 7 deletions(-)
>
> diff --git a/fs/overlayfs/copy_up.c b/fs/overlayfs/copy_up.c
> index 4382881b0709..ae5eb442025d 100644
> --- a/fs/overlayfs/copy_up.c
> +++ b/fs/overlayfs/copy_up.c
> @@ -731,10 +731,14 @@ static int ovl_copy_up_workdir(struct ovl_copy_up_ctx *c)
>                 .rdev = c->stat.rdev,
>                 .link = c->link
>         };
> +       err = -EIO;
> +       /* workdir and destdir could be the same when copying up to indexdir */
> +       if (lock_rename(c->workdir, c->destdir) != NULL)
> +               goto unlock;

You can't do that. See comment below ovl_copy_up_data().

>
>         err = ovl_prep_cu_creds(c->dentry, &cc);
>         if (err)
> -               return err;
> +               goto unlock;
>
>         ovl_start_write(c->dentry);
>         inode_lock(wdir);
> @@ -743,8 +747,9 @@ static int ovl_copy_up_workdir(struct ovl_copy_up_ctx *c)
>         ovl_end_write(c->dentry);
>         ovl_revert_cu_creds(&cc);
>
> +       err = PTR_ERR(temp);
>         if (IS_ERR(temp))
> -               return PTR_ERR(temp);
> +               goto unlock;
>
>         /*
>          * Copy up data first and then xattrs. Writing data after
> @@ -760,10 +765,9 @@ static int ovl_copy_up_workdir(struct ovl_copy_up_ctx *c)
>          * If temp was moved, abort without the cleanup.
>          */
>         ovl_start_write(c->dentry);
> -       if (lock_rename(c->workdir, c->destdir) != NULL ||
> -           temp->d_parent != c->workdir) {
> +       if (temp->d_parent != c->workdir) {

                  dput(temp);

here is all that should be needed to fix the leak.


>                 err = -EIO;
> -               goto unlock;
> +               goto unlockcd;
>         } else if (err) {
>                 goto cleanup;
>         }

See my suggested fix at https://github.com/amir73il/linux/commits/ovl-fixes

Al,

Heads up.
This fix will have a minor conflict with a8b0026847b8 ("rename(): avoid
a deadlock in the case of parents having no common ancestor")
on your work.rename branch.

I plan to push my fix to linux-next soon, but I see that work.rename
is not in linux-next yet.

Thanks,
Amir.

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [f2fs-dev] [PATCH] ovl: fix BUG: Dentry still in use in unmount
@ 2023-12-17  9:32       ` Amir Goldstein
  0 siblings, 0 replies; 15+ messages in thread
From: Amir Goldstein @ 2023-12-17  9:32 UTC (permalink / raw)
  To: Edward Adam Davis, viro
  Cc: squashfs-devel, reiserfs-devel, Miklos Szeredi,
	syzbot+8608bb4553edb8c78f41, syzkaller-bugs, linux-kernel,
	linux-f2fs-devel, terrelln, phillip, linux-fsdevel, jaegeuk,
	overlayfs

Hi Edward,

Thanks for the quick fix, but it is incorrect.

On Sun, Dec 17, 2023 at 10:11 AM Edward Adam Davis <eadavis@qq.com> wrote:
>
> workdir and destdir could be the same when copying up to indexdir.

This is not the reason for the bug, the reason is:

    syzbot exercised the forbidden practice of moving the workdir under
    lowerdir while overlayfs is mounted and tripped a dentry reference leak.

>
> Fixes: c63e56a4a652 ("ovl: do not open/llseek lower file with upper sb_writers held")
> Reported-and-tested-by: syzbot+8608bb4553edb8c78f41@syzkaller.appspotmail.com
> Signed-off-by: Edward Adam Davis <eadavis@qq.com>
> ---
>  fs/overlayfs/copy_up.c | 20 +++++++++++++-------
>  1 file changed, 13 insertions(+), 7 deletions(-)
>
> diff --git a/fs/overlayfs/copy_up.c b/fs/overlayfs/copy_up.c
> index 4382881b0709..ae5eb442025d 100644
> --- a/fs/overlayfs/copy_up.c
> +++ b/fs/overlayfs/copy_up.c
> @@ -731,10 +731,14 @@ static int ovl_copy_up_workdir(struct ovl_copy_up_ctx *c)
>                 .rdev = c->stat.rdev,
>                 .link = c->link
>         };
> +       err = -EIO;
> +       /* workdir and destdir could be the same when copying up to indexdir */
> +       if (lock_rename(c->workdir, c->destdir) != NULL)
> +               goto unlock;

You can't do that. See comment below ovl_copy_up_data().

>
>         err = ovl_prep_cu_creds(c->dentry, &cc);
>         if (err)
> -               return err;
> +               goto unlock;
>
>         ovl_start_write(c->dentry);
>         inode_lock(wdir);
> @@ -743,8 +747,9 @@ static int ovl_copy_up_workdir(struct ovl_copy_up_ctx *c)
>         ovl_end_write(c->dentry);
>         ovl_revert_cu_creds(&cc);
>
> +       err = PTR_ERR(temp);
>         if (IS_ERR(temp))
> -               return PTR_ERR(temp);
> +               goto unlock;
>
>         /*
>          * Copy up data first and then xattrs. Writing data after
> @@ -760,10 +765,9 @@ static int ovl_copy_up_workdir(struct ovl_copy_up_ctx *c)
>          * If temp was moved, abort without the cleanup.
>          */
>         ovl_start_write(c->dentry);
> -       if (lock_rename(c->workdir, c->destdir) != NULL ||
> -           temp->d_parent != c->workdir) {
> +       if (temp->d_parent != c->workdir) {

                  dput(temp);

here is all that should be needed to fix the leak.


>                 err = -EIO;
> -               goto unlock;
> +               goto unlockcd;
>         } else if (err) {
>                 goto cleanup;
>         }

See my suggested fix at https://github.com/amir73il/linux/commits/ovl-fixes

Al,

Heads up.
This fix will have a minor conflict with a8b0026847b8 ("rename(): avoid
a deadlock in the case of parents having no common ancestor")
on your work.rename branch.

I plan to push my fix to linux-next soon, but I see that work.rename
is not in linux-next yet.

Thanks,
Amir.


_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [syzbot] [reiserfs?] [squashfs?] BUG: Dentry still in use in unmount
  2023-12-17  9:16     ` [f2fs-dev] " Amir Goldstein
@ 2023-12-17  9:36       ` syzbot
  -1 siblings, 0 replies; 15+ messages in thread
From: syzbot @ 2023-12-17  9:36 UTC (permalink / raw)
  To: amir73il, chao, jaegeuk, linux-f2fs-devel, linux-fsdevel,
	linux-kernel, phillip, reiserfs-devel, squashfs-devel,
	syzkaller-bugs, terrelln, viro

Hello,

syzbot has tested the proposed patch and the reproducer did not trigger any issue:

Reported-and-tested-by: syzbot+8608bb4553edb8c78f41@syzkaller.appspotmail.com

Tested on:

commit:         79f938ea ovl: fix dentry reference leak after changes ..
git tree:       https://github.com/amir73il/linux ovl-fixes
console output: https://syzkaller.appspot.com/x/log.txt?x=171ae01ae80000
kernel config:  https://syzkaller.appspot.com/x/.config?x=52c9552def2a0fdd
dashboard link: https://syzkaller.appspot.com/bug?extid=8608bb4553edb8c78f41
compiler:       Debian clang version 15.0.6, GNU ld (GNU Binutils for Debian) 2.40

Note: no patches were applied.
Note: testing is done by a robot and is best-effort only.

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [f2fs-dev] [syzbot] [reiserfs?] [squashfs?] BUG: Dentry still in use in unmount
@ 2023-12-17  9:36       ` syzbot
  0 siblings, 0 replies; 15+ messages in thread
From: syzbot @ 2023-12-17  9:36 UTC (permalink / raw)
  To: amir73il, chao, jaegeuk, linux-f2fs-devel, linux-fsdevel,
	linux-kernel, phillip, reiserfs-devel, squashfs-devel,
	syzkaller-bugs, terrelln, viro

Hello,

syzbot has tested the proposed patch and the reproducer did not trigger any issue:

Reported-and-tested-by: syzbot+8608bb4553edb8c78f41@syzkaller.appspotmail.com

Tested on:

commit:         79f938ea ovl: fix dentry reference leak after changes ..
git tree:       https://github.com/amir73il/linux ovl-fixes
console output: https://syzkaller.appspot.com/x/log.txt?x=171ae01ae80000
kernel config:  https://syzkaller.appspot.com/x/.config?x=52c9552def2a0fdd
dashboard link: https://syzkaller.appspot.com/bug?extid=8608bb4553edb8c78f41
compiler:       Debian clang version 15.0.6, GNU ld (GNU Binutils for Debian) 2.40

Note: no patches were applied.
Note: testing is done by a robot and is best-effort only.


_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2023-12-17  9:36 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-26 10:50 [syzbot] BUG: Dentry still in use in unmount syzbot
2023-12-16 23:19 ` [syzbot] [reiserfs?] [squashfs?] " syzbot
2023-12-16 23:19   ` [f2fs-dev] " syzbot
2023-12-17  3:39   ` Edward Adam Davis
2023-12-17  4:04     ` [syzbot] " syzbot
2023-12-17  5:43   ` Edward Adam Davis
2023-12-17  6:09     ` [syzbot] " syzbot
2023-12-17  8:11   ` [f2fs-dev] [PATCH] ovl: fix " Edward Adam Davis via Linux-f2fs-devel
2023-12-17  8:11     ` Edward Adam Davis
2023-12-17  9:32     ` Amir Goldstein
2023-12-17  9:32       ` [f2fs-dev] " Amir Goldstein
2023-12-17  9:16   ` [syzbot] [reiserfs?] [squashfs?] " Amir Goldstein
2023-12-17  9:16     ` [f2fs-dev] " Amir Goldstein
2023-12-17  9:36     ` syzbot
2023-12-17  9:36       ` [f2fs-dev] " syzbot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.