From: Christian Brauner <brauner@kernel.org>
To: Christian Schoenebeck <linux_oss@crudebyte.com>
Cc: Eric Van Hensbergen <ericvh@kernel.org>,
Latchesar Ionkov <lucho@ionkov.net>,
Dominique Martinet <asmadeus@codewreck.org>,
v9fs@lists.linux.dev, linux-kernel@vger.kernel.org,
xingwei lee <xrivendell7@gmail.com>,
sam sun <samsun1006219@gmail.com>,
Seth Forshee <sforshee@kernel.org>
Subject: Re: [PATCH] 9p: cap xattr max size to XATTR_SIZE_MAX
Date: Mon, 4 Mar 2024 15:19:58 +0100 [thread overview]
Message-ID: <20240304-zeitschrift-tagung-6f2a28e781bc@brauner> (raw)
In-Reply-To: <4091309.WcpKHNDlqE@silver>
On Mon, Mar 04, 2024 at 02:35:07PM +0100, Christian Schoenebeck wrote:
> On Monday, March 4, 2024 1:42:43 PM CET Dominique Martinet wrote:
> > We probably shouldn't ever get an xattr bigger than that, and the current check
> > of SSIZE_MAX is a bit too large.
>
> Maybe, OTOH e.g. ACLs (dynamic size) are implemented by storing them as xattrs
> on 9p server as well, and this change somewhat expects server to run Linux as
> well. So maybe s/XATTR_SIZE_MAX/KMALLOC_MAX_SIZE/ might be more appropriate,
> considering that this patch is about fixing a potential kmalloc() warning?
>
> Worth to mention in the commit log BTW what the issue was.
>
> /Christian
So the error is somewhat specific to filesystem capabilities which also
live in the xattr apis but Seth is working to get rid of them in there.
They currently use a special api vfs_getxattr_alloc() which is an
in-kernel api that does a racy query-size+allocate-buffer+retrieve-data
dance.
That api is used for fscaps, security labels, and other xattrs. And that
api doesn't do any size checks which probably should also be fixed now
that I write this.
@Seth?
next prev parent reply other threads:[~2024-03-04 14:20 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-04 12:42 Dominique Martinet
2024-03-04 13:35 ` Christian Schoenebeck
2024-03-04 14:19 ` Christian Brauner [this message]
2024-03-04 14:35 ` Seth Forshee
2024-03-04 14:44 ` Seth Forshee
2024-09-01 7:16 ` Fedor Pchelkin
2024-09-22 20:26 ` Dominique Martinet
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=20240304-zeitschrift-tagung-6f2a28e781bc@brauner \
--to=brauner@kernel.org \
--cc=asmadeus@codewreck.org \
--cc=ericvh@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux_oss@crudebyte.com \
--cc=lucho@ionkov.net \
--cc=samsun1006219@gmail.com \
--cc=sforshee@kernel.org \
--cc=v9fs@lists.linux.dev \
--cc=xrivendell7@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
all inboxes | Powered by JetHome®