All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Arbab Haider" <arbabhaider649@gmail.com>
Cc: linux-ext4@vger.kernel.org, tytso@mit.edu
Subject: Re: [PATCH] ext2: handle NULL fc->source in ext2_msg_fc()
Date: Sun, 22 Nov 2026 18:26:57 +0000	[thread overview]
Message-ID: <sashiko-outbox-228178@kernel.org> (raw)
In-Reply-To: <20261122182331.13740-2-arbabhaider649@gmail.com>

> With the new mount API (fsopen()/fsconfig()), userspace can pass mount
> options such as "nobh", "dax", or "reservation" before setting the
> "source" parameter, leaving fc->source as NULL during option parsing.
> 
> In ext2_msg_fc(), when fc->purpose != FS_CONTEXT_FOR_RECONFIGURE,
> strrchr(fc->source, '/') is called unconditionally without checking if
> fc->source is non-NULL, causing a kernel NULL pointer dereference:
> 
>   KASAN: null-ptr-deref in range [0x0000000000000000-0x0000000000000007]
>   RIP: 0010:strrchr+0x24/0x80
>   ext2_msg_fc+0x157/0x1e3
> 
> Check fc->source before calling strrchr(), and omit the "(%s)" device
> prefix when s_id is NULL or empty (e.g., when source is unset, empty,
> or ends with '/').
> 
> Tested locally in QEMU (x86_64, KASAN+UBSAN) using fsopen()/fsconfig()
> with NULL, empty, trailing-slash, relative, and full-path sources.
> 
> Reported-by: syzbot+1d23ad199a3bfd6f9149@syzkaller.appspotmail.com
> Closes: https://syzkaller.appspot.com/bug?extid=1d23ad199a3bfd6f9149
> Fixes: 98f18c76c2c3 ("ext2: create ext2_msg_fc for use during parsing")
> Cc: stable@vger.kernel.org
> Signed-off-by: Arbab Haider <arbabhaider649@gmail.com>

Sashiko has reviewed this patch and found no issues.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261122182331.13740-2-arbabhaider649@gmail.com?part=1

  reply	other threads:[~2026-11-22 18:26 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-22 18:23 [PATCH] ext2: handle NULL fc->source in ext2_msg_fc() Arbab Haider
2026-11-22 18:26 ` sashiko-bot [this message]
2026-11-23 10:38 ` Jan Kara

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=sashiko-outbox-228178@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=arbabhaider649@gmail.com \
    --cc=linux-ext4@vger.kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.