Linux filesystem development
 help / color / mirror / Atom feed
From: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
To: Jan Kara <jack@suse.cz>
Cc: ZW Tang <tangzw515@gmail.com>,
	 Amir Goldstein <amir73il@gmail.com>,
	linux-fsdevel@vger.kernel.org,  linux-kernel@vger.kernel.org
Subject: Re: [BUG] fanotify: WARNING in fanotify_handle_event with crafted msdos image and long path
Date: Mon, 31 Aug 2026 23:25:21 +0900	[thread overview]
Message-ID: <8733vuweni.fsf@mail.parknet.co.jp> (raw)
In-Reply-To: <3kzvlb3wpzbg6k6ttzp6rh2cfmz3hmmmlisgxjn5u4xmaaqibm@qkre7flkhejl>

Jan Kara <jack@suse.cz> writes:

> On Mon 31-08-26 12:32:57, ZW Tang wrote:
>> I am reporting a warning triggered by a syzkaller reproducer on
>> Linux 7.2.0-rc3. A similar issue appears to have been reported upstream
>> before, but I can still reproduce it on Linux 7.2.0-rc3 with HEAD commit
>> 1137d8b5df06137fb49513cc923b3b24d94cb809.
>> 
>> The reproducer mounts a crafted msdos filesystem image, creates a very
>> long pathname, installs a fanotify mark, and then calls execve() on the
>> long path. During execve(), the file open path triggers fsnotify, which
>> then calls fanotify_handle_event(). While fanotify is constructing the
>> event, it hits a warning in fs/notify/fanotify/fanotify.h.
>> 
>> This looks like a fanotify name-event encoding robustness issue. A crafted
>> filesystem image together with a very long pathname appears to trigger an
>> unexpected name/fid event layout, and fanotify_info_copy_name() reaches a
>> WARN_ON_ONCE() path. The kernel should probably reject or truncate the
>> event cleanly instead of triggering a warning, because panic_on_warn turns
>> this into a kernel panic.
>
> fanotify complains that the name length is greater than NAME_MAX.  If I can
> guess, the problem likely is that the msdos filesystem (vfat?) allows a
> file name that is longer than NAME_MAX. Which would be a bug in the
> filesystem driver, not a problem in fanotify... Ogawa, care to have a look?

A patch looks like be applied to v7.3.
-- 
OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>

      reply	other threads:[~2026-08-31 14:25 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-31  4:32 [BUG] fanotify: WARNING in fanotify_handle_event with crafted msdos image and long path ZW Tang
2026-08-31 10:31 ` Jan Kara
2026-08-31 14:25   ` OGAWA Hirofumi [this message]

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=8733vuweni.fsf@mail.parknet.co.jp \
    --to=hirofumi@mail.parknet.co.jp \
    --cc=amir73il@gmail.com \
    --cc=jack@suse.cz \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tangzw515@gmail.com \
    /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