From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=80.241.56.152 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796056520; b=SeYdtosIxvWL82SSe/eB77KsaJ8n/uyJ1DPuL/MavbZjCxezClpZZ4MAsPErEop2pf3v pb2jT0rgEiWILre4iT7aaSAl7375LOjMbibo+B73YfG3IzLekn3Qif7z24HJEqF4pG1Xx GFcSd5GuiPZCNIsrw3I+jW613xeSP2HrrhC1lK+mdv+KlDXeF+ndb+WmIlQRf08q/uvs6 naZQxC+NfHiQUPiTN8q7eNtnXlHcp6TPaVtlPWcF0Z5bhWN6xI0lvWq+SyQ15G6LQtFco SC7iMY2mj8r3rYyb2fM/mZOJlnAyetFTRreuheWuKl1KbmpUXfx9pRyhwnR3sJIuYdg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796056520; h=DMARC-Filter:Received:DKIM-Signature:From:To:Cc:Subject:In-Reply-To: References:Date:Message-ID:MIME-Version:Content-Type: X-Rspamd-Queue-Id; bh=dK/TrZKhHyoOYWKMVgW0YIjDgBo7nhZ9l0vvUtBxrlw=; b=hyWl/Fv3Sp/n20wfXeApjQDPp99Zbjf/d3GnMCLJsjyDnChKss59ZZFl6RHPgMkU6B1O FhLeCII+AWcEFKVJYi8LVFu8R3lG2pnDFVjxrd6qo0CzxX6j8qWz/+omR/r3R6mYJ4Yqw wPUIOgewZlUtTBXzgA9KBbzbseS2ge1/6snvYmWPNAb+jn3sYVbEMFzEkDCTxGpy85j0d 7b7cD5D/LzaIGbygy4PTijkMkSuZkT3dTL4uhRY+9pwInIpJeqBKR3TtG2hmj3lX7rC7i qU8u5eYJ57sryE3gc0vUF7J5CKv+5y346OAbMPw/vfW48X7RipquG9ubUOSHnB+k/nQ== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=krisman.be; spf=pass smtp.mailfrom=krisman.be; dkim=pass header.d=krisman.be header.i=@krisman.be header.a=rsa-sha256 header.s=MBO0001 header.b=lv35dtpM; arc=none smtp.remote-ip=80.241.56.152 Received: from mout-p-102.mailbox.org (mout-p-102.mailbox.org [80.241.56.152]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 09BEE606A32D; Mon, 30 Nov 2026 16:35:18 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 09BEE606A32D Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=krisman.be Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=krisman.be Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key, unprotected) header.d=krisman.be header.i=@krisman.be header.a=rsa-sha256 header.s=MBO0001 header.b=lv35dtpM Received: from smtp202.mailbox.org (smtp202.mailbox.org [IPv6:2001:67c:2050:b231:465::202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519MLKEM768 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-102.mailbox.org (Postfix) with ESMTPS id 4jdV4J2nrtzKvmn; Mon, 30 Nov 2026 17:35:12 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=krisman.be; s=MBO0001; t=1796056512; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=dK/TrZKhHyoOYWKMVgW0YIjDgBo7nhZ9l0vvUtBxrlw=; b=lv35dtpMWwqgOyn2Ub8biisIG6ZAC1A1hHuIQSlBzfUNJVyMFUsf8MpMhvEjSWEbZ2Saq7 IdKQQo2lryuRFa8tAewnymGMKiXA2mf0Hf7+wtvtVDpJua+0OcxLDZ0WcfDzn+Tc07lAkU /+1LVYpqup6S+jrQfi1Z3IwE/oEy5f8yc9CEr1p4sAwEVHsyagxmVDKoP1PV9IzaLatc2F BYb0cH9A2UeWWgdvYpC1rwaxUo0P2WJaZ25Cju+UcdFqz4nZJY8+pTBkvUotRpLxwNJwGB 625tsXngrpnGihAsFz0d8ZH+iGDG4PFwvKq+lWH/ni8fNUQL8R7cq14PFMxnrQ== Authentication-Results: outgoing_mbo_mout; dkim=none; spf=pass (outgoing_mbo_mout: domain of gabriel@krisman.be designates 2001:67c:2050:b231:465::202 as permitted sender) smtp.mailfrom=gabriel@krisman.be From: Gabriel Krisman Bertazi To: Edward Adam Davis , syzbot+68178aa1e39c8606392e@syzkaller.appspotmail.com Cc: djwong@kernel.org, jack@suse.cz, linux-ext4@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com, tytso@mit.edu Subject: Re: [PATCH] ext4: Add validity checks for the casefold feature In-Reply-To: <20261130110526.116017-1-eadavis@sina.com> References: <6b0ce1e1.8ccee5ca.1045fd.02b4.GAE@google.com> <20261130110526.116017-1-eadavis@sina.com> Date: Mon, 30 Nov 2026 11:35:07 -0500 Message-ID: <87tskyb7lw.fsf@cartola> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain X-Rspamd-Queue-Id: 4jdV4J2nrtzKvmn Edward Adam Davis writes: > The EXT4_FEATURE_INCOMPAT_CASEFOLD feature is not enabled during the file > system mount process; consequently, s_encoding is not loaded into the > superblock. When the EXT4_FEATURE_INCOMPAT_CASEFOLD feature is enabled via > EXT4_IOC_SET_TUNE_SB_PARAM, sb->s_encoding is not initialized. > After the EXT4_CASEFOLD_FL flag is set on a dir via ext4_ioctl_setflags(), > the lookup operation performed on that directory triggers a call to the > ext4_fname_setup_ci_filename() function. This function passes the NULL > value of dir->i_sb->s_encoding to utf8_casefold(), which subsequently leads > to a null-ptr-deref of um->tables within utf8nlookup(). > > Added validity checks related to casefold feature to prevent referencing > an uninitialized encoding. Yeah, I don't think we can really have FEATURE_INCOMPAT_CASEFOLD correctly enabled at runtime via SET_TUNE_SB_PARAM and working immediately, because we cannot safely overwrite d->d_ops of all existing dentries. Even if we start setting ->d_ops for newer dentries after setting this flag, or somehow when flipping +F, we need vfs support when instantiating negative dentries and ugh. I also don't know if people really need to set FEATURE_INCOMPAT_CASEFOLD at runtime, but if the need exists, it should be after a umount-mount to ensures the tree is completely pruned from the cache. Either way if we disable it, like this patch suggests, GET_TUNE_SB_PARAM should be changed too to not say it is supported. -- Gabriel Krisman Bertazi