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-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <de61a54dcf5f7240d971150cb51faf0038d3d835.1739363803.git.nirjhar.roy.lists@gmail.com>
Date: Wed, 12 Feb 2025 12:39:58 +0000
From: "Nirjhar Roy (IBM)" <nirjhar.roy.lists@...il.com>
To: fstests@...r.kernel.org
Cc: linux-ext4@...r.kernel.org,
	linux-xfs@...r.kernel.org,
	ritesh.list@...il.com,
	ojaswin@...ux.ibm.com,
	djwong@...nel.org,
	zlang@...nel.org,
	nirjhar.roy.lists@...il.com
Subject: [PATCH v1 3/3] xfs: Add a testcase to check remount with noattr2 on a v5 xfs

This testcase reproduces the following bug:
Bug:
mount -o remount,noattr2 <device> <mount_point> succeeds
unexpectedly on a v5 xfs when CONFIG_XFS_SUPPORT_V4 is set.

Ideally the above mount command should always fail with a v5 xfs
filesystem irrespective of whether CONFIG_XFS_SUPPORT_V4 is set
or not.

Signed-off-by: Nirjhar Roy (IBM) <nirjhar.roy.lists@...il.com>
---
 tests/xfs/634     | 35 +++++++++++++++++++++++++++++++++++
 tests/xfs/634.out |  3 +++
 2 files changed, 38 insertions(+)
 create mode 100755 tests/xfs/634
 create mode 100644 tests/xfs/634.out

diff --git a/tests/xfs/634 b/tests/xfs/634
new file mode 100755
index 00000000..dc153047
--- /dev/null
+++ b/tests/xfs/634
@@ -0,0 +1,35 @@
+#! /bin/bash
+# SPDX-License-Identifier: GPL-2.0
+# Copyright (c) 2025 Nirjhar Roy (IBM) <nirjhar.roy.lists@...il.com>.  All Rights Reserved.
+#
+# FS QA Test 634
+#
+# This test checks that mounting and remounting a v5 xfs filesystem with
+# noattr2 fails. Currently, this test will pass with CONFIG_XFS_SUPPORT_V4=n but
+# with CONFIG_XFS_SUPPORT_V4=y, this will fail i.e, mount -o remount,noattr2
+# command succeeds incorrectly.
+#
+. ./common/preamble
+. ./common/filter
+
+_begin_fstest auto quick mount
+_require_scratch
+# Import common functions.
+
+_fixed_by_kernel_commit xxxx \
+	""
+_require_scratch_xfs_v5
+_scratch_mkfs -m crc=1 > $seqres.full 2>&1 ||
+	_notrun "need an xfs v5 filesystem"
+_scratch_mount "-o noattr2" |& grep -iq "fail" && \
+	echo "mount failed successfully"
+_scratch_mount
+! _scratch_remount noattr2 >> $seqres.full 2>&1 && \
+	echo "remount failed successfully"
+_scratch_unmount
+
+# success, all done
+status=0
+exit
+status=0
+exit
diff --git a/tests/xfs/634.out b/tests/xfs/634.out
new file mode 100644
index 00000000..8a98c05c
--- /dev/null
+++ b/tests/xfs/634.out
@@ -0,0 +1,3 @@
+QA output created by 634
+mount failed successfully
+remount failed successfully
-- 
2.34.1


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ