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: <20250725155610.GP2672022@frogsfrogsfrogs>
Date: Fri, 25 Jul 2025 08:56:10 -0700
From: "Darrick J. Wong" <djwong@...nel.org>
To: tytso@....edu
Cc: linux-ext4@...r.kernel.org
Subject: [PATCH 19/8] fuse2fs: don't record every errno in the superblock as
 an fs failure

From: Darrick J. Wong <djwong@...nel.org>

fstests just blew up because somewhere in the fuse iomap code we
returned an ESTALE, which was then passed to translate_error.  That
function decided it was a Serious Error and wrote it to the superblock,
so every subsequent mount attempt failed.

I should go figure out why the iomap cache upsert operation returned
ESTALE, but that's not a sign that the *ondisk* filesystem is corrupt.
Prior to commit 71f046a788adba we wouldn't have written that to the
superblock either.

Fix this by isolating the handful of errno that usually mean corruption
problems in filesystems and writing those to the superblock; the other
errno are merely operational errors that can be passed back to the
kernel and up to userspace.

I'm not sure why e2fsck doesn't flag when s_error_count > 0.  That might
be an error on its own.

Cc: <linux-ext4@...r.kernel.org> # v1.47.3
Fixes: 71f046a788adba ("fuse2fs: correctly handle system errno values in __translate_error()")
Signed-off-by: "Darrick J. Wong" <djwong@...nel.org>
---
 misc/fuse2fs.c |   18 ++++++++++++++++--
 1 file changed, 16 insertions(+), 2 deletions(-)

diff --git a/misc/fuse2fs.c b/misc/fuse2fs.c
index 242bbfd221eb3a..18d8f426a5eb43 100644
--- a/misc/fuse2fs.c
+++ b/misc/fuse2fs.c
@@ -4969,9 +4969,23 @@ static int __translate_error(ext2_filsys fs, ext2_ino_t ino, errcode_t err,
 		is_err = 1;
 		ret = -EUCLEAN;
 		break;
-	default:
+	case EIO:
+#ifdef EILSEQ
+	case EILSEQ:
+#endif
+	case EUCLEAN:
+		/* these errnos usually denote corruption or persistence fail */
 		is_err = 1;
-		ret = (err < 256) ? -err : -EIO;
+		ret = -err;
+		break;
+	default:
+		if (err < 256) {
+			/* other errno are usually operational errors */
+			ret = -err;
+		} else {
+			is_err = 1;
+			ret = -EIO;
+		}
 		break;
 	}
 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ