Edward Adam Davis
4f234d5fcd
gfs2: fix kernel BUG in gfs2_quota_cleanup
...
[ Upstream commit 71733b4922007500ae259af9e96017080f5d36d9 ]
[Syz report]
kernel BUG at fs/gfs2/quota.c:1508!
invalid opcode: 0000 [#1 ] PREEMPT SMP KASAN
CPU: 0 PID: 5060 Comm: syz-executor505 Not tainted 6.7.0-rc3-syzkaller-00134-g994d5c58e50e #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 11/10/2023
RIP: 0010:gfs2_quota_cleanup+0x6b5/0x6c0 fs/gfs2/quota.c:1508
Code: fe e9 cf fd ff ff 44 89 e9 80 e1 07 80 c1 03 38 c1 0f 8c 2d fe ff ff 4c 89 ef e8 b6 19 23 fe e9 20 fe ff ff e8 ec 11 c7 fd 90 <0f> 0b e8 84 9c 4f 07 0f 1f 40 00 66 0f 1f 00 55 41 57 41 56 41 54
RSP: 0018:ffffc9000409f9e0 EFLAGS: 00010293
RAX: ffffffff83c76854 RBX: 0000000000000002 RCX: ffff888026001dc0
RDX: 0000000000000000 RSI: 0000000000000002 RDI: 0000000000000000
RBP: ffffc9000409fb00 R08: ffffffff83c762b0 R09: 1ffff1100fd38015
R10: dffffc0000000000 R11: ffffed100fd38016 R12: dffffc0000000000
R13: ffff88807e9c0828 R14: ffff888014693580 R15: ffff88807e9c0000
FS: 0000000000000000(0000) GS:ffff8880b9800000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f16d1bd70f8 CR3: 0000000027199000 CR4: 00000000003506f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
<TASK>
gfs2_put_super+0x2e1/0x940 fs/gfs2/super.c:611
generic_shutdown_super+0x13a/0x2c0 fs/super.c:696
kill_block_super+0x44/0x90 fs/super.c:1667
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
exit_task_work include/linux/task_work.h:38 [inline]
do_exit+0xa34/0x2750 kernel/exit.c:871
do_group_exit+0x206/0x2c0 kernel/exit.c:1021
__do_sys_exit_group kernel/exit.c:1032 [inline]
__se_sys_exit_group kernel/exit.c:1030 [inline]
__x64_sys_exit_group+0x3f/0x40 kernel/exit.c:1030
do_syscall_x64 arch/x86/entry/common.c:51 [inline]
do_syscall_64+0x45/0x110 arch/x86/entry/common.c:82
entry_SYSCALL_64_after_hwframe+0x63/0x6b
...
[pid 5060] fsconfig(4, FSCONFIG_CMD_RECONFIGURE, NULL, NULL, 0) = 0
[pid 5060] exit_group(1) = ?
...
[Analysis]
When the task exits, it will execute cleanup_mnt() to recycle the mounted gfs2
file system, but it performs a system call fsconfig(4, FSCONFIG_CMD_RECONFIGURE,
NULL, NULL, 0) before executing the task exit operation.
This will execute the following kernel path to complete the setting of
SDF_JOURNAL_LIVE for sd_flags:
SYSCALL_DEFINE5(fsconfig, ..)->
vfs_fsconfig_locked()->
vfs_cmd_reconfigure()->
gfs2_reconfigure()->
gfs2_make_fs_rw()->
set_bit(SDF_JOURNAL_LIVE, &sdp->sd_flags);
[Fix]
Add SDF_NORECOVERY check in gfs2_quota_cleanup() to avoid checking
SDF_JOURNAL_LIVE on the path where gfs2 is being unmounted.
Reported-and-tested-by: syzbot+3b6e67ac2b646da57862@syzkaller.appspotmail.com
Fixes: f66af88e3321 ("gfs2: Stop using gfs2_make_fs_ro for withdraw")
Signed-off-by: Edward Adam Davis <eadavis@qq.com>
Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-01-25 15:35:17 -08:00
..
2023-11-28 17:19:46 +00:00
2023-08-29 20:21:42 -07:00
2023-08-29 20:21:42 -07:00
2024-01-01 12:42:34 +00:00
2023-08-28 11:39:14 -07:00
2023-08-29 20:21:42 -07:00
2023-08-29 20:21:42 -07:00
2024-01-01 12:42:24 +00:00
2023-08-29 14:25:26 -07:00
2023-10-27 16:44:58 -10:00
2023-08-28 09:31:32 -07:00
2023-07-13 10:28:05 +02:00
2023-08-28 11:04:18 -07:00
2024-01-20 11:51:37 +01:00
2023-08-28 10:17:14 -07:00
2023-11-20 11:59:37 +01:00
2023-12-03 07:33:03 +01:00
2024-01-25 15:35:15 -08:00
2023-08-29 20:21:42 -07:00
2024-01-25 15:35:17 -08:00
2023-11-28 17:19:44 +00:00
2023-08-29 17:45:22 -04:00
2023-12-08 08:52:19 +01:00
2023-12-20 17:02:01 +01:00
2024-01-20 11:51:37 +01:00
2023-08-29 20:21:42 -07:00
2023-08-29 20:21:42 -07:00
2023-12-20 17:01:52 +01:00
2024-01-25 15:35:17 -08:00
2023-08-29 20:21:42 -07:00
2023-08-29 20:21:42 -07:00
2023-07-24 10:30:00 +02:00
2023-08-29 20:21:42 -07:00
2023-11-28 17:20:05 +00:00
2023-10-19 09:41:36 -07:00
2023-08-29 20:21:42 -07:00
2024-01-20 11:51:43 +01:00
2023-07-24 10:30:01 +02:00
2023-11-28 17:19:43 +00:00
2023-09-01 09:43:18 -07:00
2023-08-29 17:45:22 -04:00
2023-08-29 20:21:42 -07:00
2023-09-18 12:03:46 -07:00
2023-11-28 17:19:49 +00:00
2024-01-15 18:57:06 +01:00
2023-12-13 18:45:22 +01:00
2023-08-31 12:07:34 -05:00
2023-10-19 16:19:20 +02:00
2023-08-29 20:21:42 -07:00
2023-10-19 09:10:18 -07:00
2023-08-31 15:18:15 -07:00
2023-08-29 20:21:42 -07:00
2023-07-24 10:30:03 +02:00
2023-08-11 09:04:57 +02:00
2023-12-03 07:33:03 +01:00
2023-11-28 17:19:57 +00:00
2024-01-25 15:35:17 -08:00
2023-08-29 20:21:42 -07:00
2023-08-29 20:21:42 -07:00
2023-11-28 17:20:04 +00:00
2023-07-24 10:30:04 +02:00
2023-09-11 14:07:46 +02:00
2023-08-29 20:21:42 -07:00
2024-01-20 11:51:48 +01:00
2023-07-24 10:30:05 +02:00
2023-08-29 20:21:42 -07:00
2023-12-20 17:02:00 +01:00
2023-08-11 09:04:57 +02:00
2023-08-30 12:10:50 -07:00
2023-08-29 20:21:42 -07:00
2023-08-28 09:31:32 -07:00
2023-08-20 10:33:43 -07:00
2023-11-28 17:20:09 +00:00
2023-08-28 11:59:52 -07:00
2023-09-20 14:22:01 +02:00
2023-08-28 10:17:14 -07:00
2023-08-11 09:04:57 +02:00
2023-09-29 17:20:45 -07:00
2023-06-28 20:35:21 -07:00
2023-07-13 10:28:04 +02:00
2023-09-25 08:55:00 -07:00
2023-06-26 09:50:21 -07:00
2024-01-10 17:16:53 +01:00
2023-08-19 13:41:11 +02:00
2023-06-28 10:28:11 -07:00
2023-08-18 10:12:11 -07:00
2023-07-11 11:41:34 +02:00
2023-07-26 14:56:07 +02:00
2023-08-29 14:53:51 -07:00
2023-07-10 14:36:11 +02:00
2023-08-08 19:36:51 +02:00
2023-08-28 10:17:14 -07:00
2023-10-12 18:53:36 +03:00
2023-08-21 13:46:25 -07:00
2023-11-20 11:58:52 +01:00
2023-08-14 18:48:02 +02:00
2023-12-03 07:33:03 +01:00
2023-08-29 20:21:42 -07:00
2023-08-28 11:04:18 -07:00
2023-08-29 20:21:42 -07:00
2023-08-23 14:17:43 -07:00
2023-08-19 12:12:12 +02:00
2024-01-05 15:19:40 +01:00
2023-08-31 15:32:18 -07:00
2023-08-02 09:13:09 -06:00
2023-10-13 18:34:46 +02:00
2024-01-25 15:35:17 -08:00
2023-07-13 10:28:04 +02:00
2023-12-20 17:01:51 +01:00
2023-09-20 14:22:01 +02:00
2023-07-13 10:28:04 +02:00
2023-08-15 08:32:45 +02:00
2023-08-06 15:08:35 +02:00
2023-08-29 14:25:26 -07:00
2023-07-13 10:28:04 +02:00
2023-12-03 07:33:03 +01:00
2023-08-31 12:47:15 +02:00
2023-08-24 16:20:27 -07:00
2023-08-22 10:57:46 +02:00