public inbox for stable@vger.kernel.org
 help / color / mirror / Atom feed
From: Christian Brauner <brauner@kernel.org>
To: Miklos Szeredi <mszeredi@redhat.com>
Cc: Christian Brauner <brauner@kernel.org>,
	Samuel Page <sam@bynar.io>,
	linux-fsdevel@vger.kernel.org, stable@vger.kernel.org,
	Qi Tang <tpluszz77@gmail.com>, Zijun Hu <nightu@northwestern.edu>
Subject: Re: [PATCH] fuse: reject oversized dirents in page cache
Date: Tue, 21 Apr 2026 13:31:10 +0200	[thread overview]
Message-ID: <20260421-tricksen-trinken-ada351b5e4c8@brauner> (raw)
In-Reply-To: <20260420090139.662772-1-mszeredi@redhat.com>

On Mon, 20 Apr 2026 11:01:37 +0200, Miklos Szeredi wrote:
> fuse_add_dirent_to_cache() computes a serialized dirent size from the
> server-controlled namelen field and copies the dirent into a single
> page-cache page. The existing logic only checks whether the dirent fits
> in the remaining space of the current page and advances to a fresh page
> if not. It never checks whether the dirent itself exceeds PAGE_SIZE.
> 
> As a result, a malicious FUSE server can return a dirent with
> namelen=4095, producing a serialized record size of 4120 bytes. On 4 KiB
> page systems this causes memcpy() to overflow the cache page by 24 bytes
> into the following kernel page.
> 
> [...]

Applied to the vfs.fixes branch of the vfs/vfs.git tree.
Patches in the vfs.fixes branch should appear in linux-next soon.

Please report any outstanding bugs that were missed during review in a
new review to the original patch series allowing us to drop it.

It's encouraged to provide Acked-bys and Reviewed-bys even though the
patch has now been applied. If possible patch trailers will be updated.

Note that commit hashes shown below are subject to change due to rebase,
trailer updates or similar. If in doubt, please check the listed branch.

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs.git
branch: vfs.fixes

[1/1] fuse: reject oversized dirents in page cache
      https://git.kernel.org/vfs/vfs/c/5c3b2e242190

      reply	other threads:[~2026-04-21 11:31 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-20  9:01 [PATCH] fuse: reject oversized dirents in page cache Miklos Szeredi
2026-04-21 11:31 ` Christian Brauner [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=20260421-tricksen-trinken-ada351b5e4c8@brauner \
    --to=brauner@kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=mszeredi@redhat.com \
    --cc=nightu@northwestern.edu \
    --cc=sam@bynar.io \
    --cc=stable@vger.kernel.org \
    --cc=tpluszz77@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