lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20211221123214.2410593-1-yebin10@huawei.com>
Date:   Tue, 21 Dec 2021 20:32:14 +0800
From:   Ye Bin <yebin10@...wei.com>
To:     <tytso@....edu>, <adilger.kernel@...ger.ca>,
        <linux-ext4@...r.kernel.org>
CC:     <linux-kernel@...r.kernel.org>, <jack@...e.cz>,
        Ye Bin <yebin10@...wei.com>
Subject: [PATCH -next] ext4: Fix remount with 'abort' option isn't effective

We test remount with 'abort' option as follows:
[root@...alhost home]# mount  /dev/sda test
[root@...alhost home]# mount | grep test
/dev/sda on /home/test type ext4 (rw,relatime)
[root@...alhost home]# mount -o remount,abort test
[root@...alhost home]# mount | grep test
/dev/sda on /home/test type ext4 (rw,relatime)

Obviously, remount 'abort' option isn't effective.
After 6e47a3cc68fc commit we process abort option with 'ctx_set_mount_flags':
static inline void ctx_set_mount_flags(struct ext4_fs_context *ctx, int flag)
{
	ctx->mask_s_mount_flags |= flag;
	ctx->vals_s_mount_flags |= flag;
}

But we test 'abort' option with 'ext4_test_mount_flag':
static inline int ext4_test_mount_flag(struct super_block *sb, int bit)
{
        return test_bit(bit, &EXT4_SB(sb)->s_mount_flags);
}

To solve this issue, pass (1 <<  EXT4_MF_FS_ABORTED) to 'ctx_set_mount_flags'.

Fixes:6e47a3cc68fc("ext4: get rid of super block and sbi from handle_mount_ops()")
Signed-off-by: Ye Bin <yebin10@...wei.com>
---
 fs/ext4/super.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/ext4/super.c b/fs/ext4/super.c
index b72d989b77fb..071b7b3c5678 100644
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -2236,7 +2236,7 @@ static int ext4_parse_param(struct fs_context *fc, struct fs_parameter *param)
 			 param->key);
 		return 0;
 	case Opt_abort:
-		ctx_set_mount_flags(ctx, EXT4_MF_FS_ABORTED);
+		ctx_set_mount_flags(ctx, 1 << EXT4_MF_FS_ABORTED);
 		return 0;
 	case Opt_i_version:
 		ctx_set_flags(ctx, SB_I_VERSION);
-- 
2.31.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ