mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: fujo <hooyan2024@gmail.com>
To: linux-fsdevel@vger.kernel.org
Cc: Christian Brauner <brauner@kernel.org>,
	Alexander Viro <viro@zeniv.linux.org.uk>, Jan Kara <jack@suse.cz>,
	linux-kernel@vger.kernel.org, shaos <shawnq1@163.com>
Subject: [PATCH 0/2] fs: two mount API fixes
Date: Wed, 21 Oct 2026 13:51:51 -0400	[thread overview]
Message-ID: <179260511193.411.2849255769062027805@gmail.com> (raw)

Two mount API edge cases reported by shaos, both reproduced on
7.3.0-rc7 (58161ead2) with a small syscall probe run as /init under
QEMU with KASAN:

 - statmount(2) with STATMOUNT_MNT_UIDMAP on a mount that is not
   idmapped and a short buffer copied the reserved empty string at
   offset 512, one byte past the declared bufsize, and returned
   success.

 - listmount(2) and listns(2) with a U64_MAX cursor wrapped around to
   zero and restarted the enumeration at the first entry.

Probe output before:

  uidmap buf=100  ret=0   size=101 byte512=0
  lm cursor=MAX   ret=1   id0=2147483651
  ln cursor=MAX   ret=8   id0=1 id1=2

after:

  uidmap buf=100  ret=-75 (EOVERFLOW) byte512=170
  lm cursor=MAX   ret=-22 (EINVAL)
  ln cursor=MAX   ret=-22 (EINVAL)

The in-tree statmount_test (17/17), statmount_test_ns (2/2) and
listmount_test (2/2) pass with both patches applied.

Thanks,
fujo

             reply	other threads:[~2026-10-21 17:53 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-21 17:51 fujo [this message]
2026-10-21 17:51 ` [PATCH 1/2] fs: statmount: don't copy strings past the caller's buffer fujo
2026-10-21 17:51 ` [PATCH 2/2] fs: reject U64_MAX cursors in listmount() and listns() fujo

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=179260511193.411.2849255769062027805@gmail.com \
    --to=hooyan2024@gmail.com \
    --cc=brauner@kernel.org \
    --cc=jack@suse.cz \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=shawnq1@163.com \
    --cc=viro@zeniv.linux.org.uk \
    /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

all inboxes | Powered by JetHome®