linux-hardening.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@infradead.org>
To: "Darrick J. Wong" <djwong@kernel.org>
Cc: Christoph Hellwig <hch@infradead.org>,
	Kees Cook <keescook@chromium.org>,
	Carlos Maiolino <cem@kernel.org>,
	Dave Chinner <david@fromorbit.com>,
	Jeff Layton <jlayton@kernel.org>,
	Eric Biggers <ebiggers@kernel.org>,
	"Gustavo A. R. Silva" <gustavoars@kernel.org>,
	linux-xfs@vger.kernel.org, linux-hardening@vger.kernel.org
Subject: Re: [PATCH] libxfs: Redefine 1-element arrays as flexible arrays
Date: Wed, 12 Jul 2023 22:54:33 -0700	[thread overview]
Message-ID: <ZK+Rmc0fBpJ3tVRN@infradead.org> (raw)
In-Reply-To: <20230713054450.GQ108251@frogsfrogsfrogs>

On Wed, Jul 12, 2023 at 10:44:50PM -0700, Darrick J. Wong wrote:
> /*
>  * List the names and sizes of the values of all the attributes of an object.
>  * "Cursor" must be allocated and zeroed before the first call, it is used
>  * to maintain context between system calls if all the attribute names won't
>  * fit into the buffer on the first system call.
>  * The return value is -1 on error (w/errno set appropriately), 0 on success.
>  */
> extern int attr_list(const char *__path, char *__buffer, const int __buffersize,
> 		int __flags, attrlist_cursor_t *__cursor)
> 	__attribute__ ((deprecated ("Use listxattr or llistxattr instead")));
> extern int attr_listf(int __fd, char *__buffer, const int __buffersize,
> 		int __flags, attrlist_cursor_t *__cursor)
> 	__attribute__ ((deprecated ("Use flistxattr instead")));
> 
> I take that as a sign that they could drop all these xfs-specific APIs
> one day, which means we ought to keep them in xfs_fs.h.

Well...

These APIs you quoted are in fact internally mapped to the normal
xattr syscalls by libattr, and have been since the Linux xattr syscalls
were created.  The only thing that actually uses the definitions in
Linux is the magic attrlist by handle ioctl that exists only in
XFS and which is exported through libhandle in xfsprogs.  But the
libhandle API is based on the attrlist_cursor from libattr and
doesn't use the xfs_ kernel definitions.

(that struct attrlist/attrlist_ent in libattr have the same 1-sized
array problem, but fortunately we don't need to solve that here..)

  reply	other threads:[~2023-07-13  5:54 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-11 22:20 [PATCH] libxfs: Redefine 1-element arrays as flexible arrays Kees Cook
2023-07-12  5:37 ` Darrick J. Wong
2023-07-12 13:09   ` Christoph Hellwig
2023-07-13  5:44     ` Darrick J. Wong
2023-07-13  5:54       ` Christoph Hellwig [this message]
2023-07-12 18:45   ` Kees Cook

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=ZK+Rmc0fBpJ3tVRN@infradead.org \
    --to=hch@infradead.org \
    --cc=cem@kernel.org \
    --cc=david@fromorbit.com \
    --cc=djwong@kernel.org \
    --cc=ebiggers@kernel.org \
    --cc=gustavoars@kernel.org \
    --cc=jlayton@kernel.org \
    --cc=keescook@chromium.org \
    --cc=linux-hardening@vger.kernel.org \
    --cc=linux-xfs@vger.kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).