The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Gabriel Krisman Bertazi <gabriel@krisman.be>
To: Edward Adam Davis <eadavis@sina.com>,
	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
Date: Mon, 30 Nov 2026 11:35:07 -0500	[thread overview]
Message-ID: <87tskyb7lw.fsf@cartola> (raw)
In-Reply-To: <20261130110526.116017-1-eadavis@sina.com>

Edward Adam Davis <eadavis@sina.com> 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

  parent reply	other threads:[~2026-11-30 16:35 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-30  2:39 [syzbot] [ext4?] general protection fault in utf8nlookup (2) syzbot
2026-11-30 11:05 ` [PATCH] ext4: Add validity checks for the casefold feature Edward Adam Davis
2026-11-30 16:32   ` kernel test robot
2026-11-30 16:35   ` Gabriel Krisman Bertazi [this message]
2026-11-30 16:44   ` kernel test robot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87tskyb7lw.fsf@cartola \
    --to=gabriel@krisman.be \
    --cc=djwong@kernel.org \
    --cc=eadavis@sina.com \
    --cc=jack@suse.cz \
    --cc=linux-ext4@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=syzbot+68178aa1e39c8606392e@syzkaller.appspotmail.com \
    --cc=syzkaller-bugs@googlegroups.com \
    --cc=tytso@mit.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox