From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 79FA82E737E for ; Thu, 17 Sep 2026 00:19:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789604364; cv=none; b=rQ9cYt+Dy9o1S1YteYyRTYu8ExC4jDV3jiduyRJIdSRg+SjQivgqwkBDlTi1+vWcQ2/7BrodOlgvVrIuKRTlP8m9I73cKYuvpbRXX/ScZWICnImQOK+muM8BsIOqTXAtpl7mLAcXXbo+IQHQwh6zSsm/tYKSgd4BTrvWDi3bhm8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789604364; c=relaxed/simple; bh=viKG1W2+Wxq17N0+TlvxgZfJXt1LkztezdMfqaP/reM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=R3SlbSQSX3oETXi09MAEO9ul5tl6eVZWzTyhy0MjBWdoigKsr9AhhiZTjWwAsxhnJl1/hpIMjMUgB6z9IRVe9ROccu090qQDu+tOrHbXFaTmB5zvNYwgK9rq0YYGZKr6yUITBl+KN/0bvaN6rl0rx5m8QVHtRPIkJtslKdXliyo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=hiL9Gd3a; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="hiL9Gd3a" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 05F911F00898; Thu, 17 Sep 2026 00:19:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1789604363; bh=lL/+lv4KL24uFmURpVzTDHE3IUvPREfx4bmTwe5XVoA=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=hiL9Gd3as/45ifk5J6TP16/rNOn018vBlSI5vbLHgIZWaL93T+rA93bqXKfSDfRRS TYGa+vtDMByk9aFkluF03AyfnEmBNNbZkZqkZIhYOjr0dssMGVdB6DBHAzFuukoCgR I4Z8ataY+eIKHVDMOFpbUP5eTLR1HcnGH6brbpvb+eAOYj2ZdsUVgJY+3W92xu/pUU dDSk/BV9whKA74G2z5PMQnENBR6b9ZQaVCkIcZUZRtgkNB55hGQ/taQlhYlQChVSPf LXE3hgxSipWeZ1uEiFOIF2ndnw/3iXMZs1lMKl+E6er404Gg/hRs3k0DnbjK+c7a8Y /eY64Xv8YcG9w== From: Sasha Levin To: stable@vger.kernel.org Cc: Gao Xiang , Sasha Levin Subject: [PATCH 6.18.y 1/2] erofs: separate plain and compressed filesystems formally Date: Wed, 16 Sep 2026 20:19:20 -0400 Message-ID: <20260917001921.3361341-1-sashal@kernel.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <2026091649-edging-stroller-a208@gregkh> References: <2026091649-edging-stroller-a208@gregkh> Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Gao Xiang [ Upstream commit 7cef3c8341940febf75db6c25199cd83fb74d52f ] The EROFS on-disk format uses a tiny, plain metadata design that prioritizes performance and minimizes complex inconsistencies against common writable disk filesystems (almost all serious metadata inconsistency cannot happen in well-designed immutable filesystems like EROFS). EROFS deliberately avoids artificial design flaws to eliminate serious security risks from untrusted remote sources by design, although human-made implementation bugs can still happen sometimes. Currently, there is no strict check to prevent compressed inodes, especially LZ4-compressed inodes, from being read in plain filesystems. Starting with erofs-utils 1.0 and Linux 5.3, LZ4_0PADDING sb feature is automatically enabled for LZ4-compressed EROFS images to support in-place decompression. Furthermore, since Linux 5.4 LTS is no longer supported, we no longer need to handle ancient LZ4-compressed EROFS images generated by erofs-utils prior to 1.0. To formally distinguish different filesystem types for improved security: - Use the presence of LZ4_0PADDING or a non-zero `dsb->u1.lz4_max_distance` as a marker for compressed filesystems containing LZ4-compressed inodes only; - For other algorithms, use `dsb->u1.available_compr_algs` bitmap. Note: LZ4_0PADDING has been supported since Linux 5.4 (the first formal kernel version), so exposing it via sysfs is no longer necessary and is now deprecated (but remain it for five more years until 2031): `dsb->u1` has been strictly non-zero for all EROFS images containing compressed inodes starting with erofs-utils v1.3 and it is actually a much better marker for compressed filesystems. Signed-off-by: Gao Xiang Backport dependency note for Linux 6.18: Retain only the zero_padding sysfs feature removal and the corresponding feature-list documentation update. The documentation layout is required for target 839f075aabdf5c21048f9801b87c0b841dd3d064 ("erofs: add sysfs feature entry for xattr prefixes") to apply without modification, and the sysfs removal keeps that list consistent with the attributes exposed. Drop the decompressor, inode, superblock, and internal-header changes. Those changes are unrelated to the target, and the decompressor hunks assume upstream's newer string-based error reporting instead of this stable branch's integer-return implementation. Leave the existing compression behavior intact; no functions are added by this dependency. [ sashal: Reduced backport -- upstream 7cef3c8341940 touches 7 file(s), this backport carries 2. Not backported here: fs/erofs/decompressor.c fs/erofs/erofs_fs.h fs/erofs/inode.c fs/erofs/internal.h fs/erofs/super.c This note is generated from the file lists only; see the resolution record for the reasoning. ] Stable-dep-of: 839f075aabdf ("erofs: add sysfs feature entry for xattr prefixes") Signed-off-by: Sasha Levin --- Documentation/ABI/testing/sysfs-fs-erofs | 6 +++--- fs/erofs/sysfs.c | 2 -- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/Documentation/ABI/testing/sysfs-fs-erofs b/Documentation/ABI/testing/sysfs-fs-erofs index b9243c7f28d71..e4cf6fc6a1066 100644 --- a/Documentation/ABI/testing/sysfs-fs-erofs +++ b/Documentation/ABI/testing/sysfs-fs-erofs @@ -3,9 +3,9 @@ Date: November 2021 Contact: "Huang Jianan" Description: Shows all enabled kernel features. Supported features: - zero_padding, compr_cfgs, big_pcluster, chunked_file, - device_table, compr_head2, sb_chksum, ztailpacking, - dedupe, fragments, 48bit, metabox. + compr_cfgs, big_pcluster, chunked_file, device_table, + compr_head2, sb_chksum, ztailpacking, dedupe, fragments, + 48bit, metabox. What: /sys/fs/erofs//sync_decompress Date: November 2021 diff --git a/fs/erofs/sysfs.c b/fs/erofs/sysfs.c index 86b22b9f0c191..3a9a5fa000ae9 100644 --- a/fs/erofs/sysfs.c +++ b/fs/erofs/sysfs.c @@ -86,7 +86,6 @@ static struct attribute *erofs_attrs[] = { ATTRIBUTE_GROUPS(erofs); /* Features this copy of erofs supports */ -EROFS_ATTR_FEATURE(zero_padding); EROFS_ATTR_FEATURE(compr_cfgs); EROFS_ATTR_FEATURE(big_pcluster); EROFS_ATTR_FEATURE(chunked_file); @@ -100,7 +99,6 @@ EROFS_ATTR_FEATURE(48bit); EROFS_ATTR_FEATURE(metabox); static struct attribute *erofs_feat_attrs[] = { - ATTR_LIST(zero_padding), ATTR_LIST(compr_cfgs), ATTR_LIST(big_pcluster), ATTR_LIST(chunked_file), -- 2.53.0