From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796345782; b=1QxwLABavqgwzssTVlic3KWysZJBAYTQgysIjI3IxquqOaXTlqobkIHimrRsjlGE2Swd wICqGClZRL+wdd5/mjc1kCvXzKvBw5c66717YjJ7Kqckh/pAKzsWH9q58RxIM8f/u6Bha 5ssz9oJ4zSJynTVasqPz1xnTUI8RweZT//KUxURrNXb7vYEngjIcSajN6hLabYLBG84ck MoynF4szvUijgMhY4dwevdYsZsIXLIFJ1Nls86m5VIHV/pP6tSZABFDFEPEgvIC4Or9R9 OqpS3I7Cm91HRY57JAo8Uim7QV8IcBi1vLSgfE6BTE7Jv3VMwtn0R2+zz2b1BQII0Gw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796345782; h=Received:DKIM-Signature:Message-ID:From:Subject:Reply-To:To:Cc: In-Reply-To:References:Content-Type:Content-Transfer-Encoding:Date; bh=J4rcQrau78FEHV0WXwiWo505Hr9g6k63DZDSsKFp/bA=; b=H1MWKPeYAUrpdLisxMDqTssLYyKxRMIonQ/2E4sztTddyv5VdL8lmp8pO8HT30G8+e/F AYxsJnKxNTHMVaWcEK72TIbAmbFZ69sX7pv1TOwXnLXj63kqkLNl8N9Whhv0w5vN1z+rI LfayAMDVzHCFgr/1Q6EaUraqtx3+qCQh7OUiQTs6y+jIM5t0Ow+tBYc8sy+oxylRbKzN1 c6kCEzNaeXTBAQlLeNNJK4qAp4aCFYwYdvMF8SAqvUG0YVtcz0WEqyIc1iv9GP1bs6iDG j2m15i0uJ8lqH3EM+pJLcN3y0xDsqH3d09pkQFrxDm6eUPTK4Nafac3Zyvz8Dt+yQpA== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=bHJEdnDt; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 94954606A322 for ; Fri, 4 Dec 2026 00:56:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=bHJEdnDt Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5030D1F000CE; Fri, 4 Dec 2026 00:56:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796345782; bh=J4rcQrau78FEHV0WXwiWo505Hr9g6k63DZDSsKFp/bA=; h=From:Subject:Reply-To:To:Cc:In-Reply-To:References:Date; b=bHJEdnDt75kRv28WxjgWrlPTPf6DCecfh2fbL/P02KH4z1c9PNRjxdMmis1hNZNVT HHpvvQepu/0+ys5kYDhrVEJ3DK6rcTCZrZG3BHhuTe4FfrhBofIQmZLzb0OF+j9Sn8 HduawdnKMfvPQM9TCn1Ym9hWLdIKR2XIlzrtEWOxgOP9nz059B6503Dj6p8x8Ag3KW zvVYmo8DV8njtnBTTmXI5aK+Ta9QzxWbP8UOKXRCJdFAX0zJYn0WWHy+d3j0L8s7UX +5lBHjT9E4/HKCC+xxICU96V0nby0kMmcWN2IiasPqbFOu9CV0nm60qMWLGULFXTKw cTghh+ZM1v+Cw== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH v4] ext4: reject runtime casefold enablement Reply-To: sashiko-reviews@lists.linux.dev To: "Shuai Liu" <847807867@qq.com>, linux-ext4@vger.kernel.org Cc: tytso@mit.edu In-Reply-To: References: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Fri, 04 Dec 2026 00:56:21 +0000 X-Mailing-List: linux-ext4@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list Thank you for your contribution! Sashiko AI review found 2 potential issues to consider: - [Medium] ext4: TUNE_OPS_SUPPORTED still advertises rejected encoding flags - [Low] ext4: commit message falsely claims CONFIG_UNICODE=3Dn build fix -- commit 226964cc255f5ef2fe20fd74e60878c891e8efda Author: Shuai Liu <847807867@qq.com> ext4: reject runtime casefold enablement This commit removes EXT4_FEATURE_INCOMPAT_CASEFOLD from EXT4_TUNE_SET_INCOMPAT_SUPP and unconditionally rejects EXT4_TUNE_FL_ENCODING and EXT4_TUNE_FL_ENCODING_FLAGS in ext4_validate_tune_sb_params(), disallowing runtime casefold enablement through EXT4_IOC_SET_TUNE_SB_PARAM. Link: https://syzbot.org/bug?extid=3D68178aa1e39c8606392e Link: https://lore.kernel.org/all/20261202100056.1419-1-zhaimingbing@cmss.c= hinamobile.com/ > This also fixes a build failure with CONFIG_UNICODE=3Dn, where > ext4_ioctl_set_tune_sb() referenced sb->s_encoding, which struct > super_block only defines when CONFIG_UNICODE is enabled. [ ... ] > Reported-by: kernel test robot > Closes: https://lore.kernel.org/oe-kbuild-all/20261203190908.N2uDMQIX-lkp= @intel.com/ [Severity: Low] Should this paragraph and the kernel test robot trailers be removed from the commit message? Neither the baseline tree nor this diff references sb->s_encoding in ext4_ioctl_set_tune_sb(), so the CONFIG_UNICODE=3Dn build failure only existed in the unmerged earlier revisions. [ ... ] > diff --git a/fs/ext4/ioctl.c b/fs/ext4/ioctl.c > index 83630cd40712c..a2e0fef6ff0ab 100644 > --- a/fs/ext4/ioctl.c > +++ b/fs/ext4/ioctl.c [ ... ] > @@ -1514,20 +1499,10 @@ static int ext4_validate_tune_sb_params(struct su= per_block *sb, > } > } > } > - if (params->set_flags & EXT4_TUNE_FL_ENCODING) { > - if (!enabling_casefold) > - return -EINVAL; > - if (params->encoding =3D=3D 0) > - params->encoding =3D EXT4_ENC_UTF8_12_1; > - else if (params->encoding !=3D EXT4_ENC_UTF8_12_1) > - return -EINVAL; > - } > - if (params->set_flags & EXT4_TUNE_FL_ENCODING_FLAGS) { > - if (!enabling_casefold) > - return -EINVAL; > - if (params->encoding_flags & ~SB_ENC_SUPP_MASK) > - return -EINVAL; > - } > + if (params->set_flags & EXT4_TUNE_FL_ENCODING) > + return -EINVAL; > + if (params->set_flags & EXT4_TUNE_FL_ENCODING_FLAGS) > + return -EINVAL; > =20 > return 0; > } [Severity: Medium] Should EXT4_TUNE_FL_ENCODING and EXT4_TUNE_FL_ENCODING_FLAGS also be dropped from TUNE_OPS_SUPPORTED? ext4_ioctl_get_tune_sb() copies TUNE_OPS_SUPPORTED into ret.set_flags, so EXT4_IOC_GET_TUNE_SB_PARAM still advertises both flags to userspace (such as tune2fs) as supported even though EXT4_IOC_SET_TUNE_SB_PARAM now unconditionally rejects them. Keeping them in TUNE_OPS_SUPPORTED also lets a request combining EXT4_FEATURE_COMPAT_DIR_INDEX with an encoding flag bypass the early ~TUNE_OPS_SUPPORTED check, mutate sbi->s_hash_seed, sbi->s_def_hash_version, and sbi->s_hash_unsigned on the live superblock, and only then fail here with -EINVAL instead of -EOPNOTSUPP. In addition, the EXT4_TUNE_FL_ENCODING and EXT4_TUNE_FL_ENCODING_FLAGS branches in ext4_sb_setparams() are now dead code on the ioctl path. Removing both flags from TUNE_OPS_SUPPORTED keeps capability discovery accurate, rejects them early with -EOPNOTSUPP before any sbi mutation, and allows dropping both checks here and the dead branches in ext4_sb_setparams(). --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/tencent_06514DECB95= B4A2BB120C9373541E0D2890A@qq.com?part=3D1