linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [syzbot] BUG: Dentry still in use in unmount
@ 2022-08-26 10:50 syzbot
  2023-12-16 23:19 ` [syzbot] [reiserfs?] [squashfs?] " syzbot
  0 siblings, 1 reply; 6+ 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] 6+ 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
  2023-12-17  8:11   ` [PATCH] ovl: fix " Edward Adam Davis
  2023-12-17  9:16   ` [syzbot] [reiserfs?] [squashfs?] " Amir Goldstein
  0 siblings, 2 replies; 6+ 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] 6+ messages in thread

* [PATCH] ovl: fix BUG: Dentry still in use in unmount
  2023-12-16 23:19 ` [syzbot] [reiserfs?] [squashfs?] " syzbot
@ 2023-12-17  8:11   ` Edward Adam Davis
  2023-12-17  9:32     ` Amir Goldstein
  2023-12-17  9:16   ` [syzbot] [reiserfs?] [squashfs?] " Amir Goldstein
  1 sibling, 1 reply; 6+ 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] 6+ messages in thread

* Re: [syzbot] [reiserfs?] [squashfs?] BUG: Dentry still in use in unmount
  2023-12-16 23:19 ` [syzbot] [reiserfs?] [squashfs?] " syzbot
  2023-12-17  8:11   ` [PATCH] ovl: fix " Edward Adam Davis
@ 2023-12-17  9:16   ` Amir Goldstein
  2023-12-17  9:36     ` syzbot
  1 sibling, 1 reply; 6+ 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] 6+ messages in thread

* Re: [PATCH] ovl: fix BUG: Dentry still in use in unmount
  2023-12-17  8:11   ` [PATCH] ovl: fix " Edward Adam Davis
@ 2023-12-17  9:32     ` Amir Goldstein
  0 siblings, 0 replies; 6+ 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] 6+ messages in thread

* Re: [syzbot] [reiserfs?] [squashfs?] BUG: Dentry still in use in unmount
  2023-12-17  9:16   ` [syzbot] [reiserfs?] [squashfs?] " Amir Goldstein
@ 2023-12-17  9:36     ` syzbot
  0 siblings, 0 replies; 6+ 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] 6+ messages in thread

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

Thread overview: 6+ 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-17  8:11   ` [PATCH] ovl: fix " Edward Adam Davis
2023-12-17  9:32     ` Amir Goldstein
2023-12-17  9:16   ` [syzbot] [reiserfs?] [squashfs?] " Amir Goldstein
2023-12-17  9:36     ` syzbot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).