From: "Michael Kerrisk (man-pages)" <mtk.manpages@gmail.com>
To: David Howells <dhowells@redhat.com>
Cc: mtk.manpages@gmail.com, lkml <linux-kernel@vger.kernel.org>,
linux-fsdevel <linux-fsdevel@vger.kernel.org>,
hch@infradead.org, Eric Biggers <ebiggers3@gmail.com>,
Linux API <linux-api@vger.kernel.org>,
Alexander Viro <viro@zeniv.linux.org.uk>
Subject: Re: Unchecked flags in statx(2) [Should be fixed before 4.11-final?]
Date: Fri, 21 Apr 2017 14:28:22 +0200 [thread overview]
Message-ID: <e8b8e13f-868e-07f7-1c0b-d1e9bbc2dcb3@gmail.com> (raw)
In-Reply-To: <a7d1fa79-b479-184e-af7e-b4319490f2a3@gmail.com>
[Adding a few people to CC, and correcting myself on one piece]
On 04/21/2017 02:14 PM, Michael Kerrisk (man-pages) wrote:
> Hello David,
>
> I was reading your statx(2) man page, and noticed this text:
>
> Do not simply set mask to UINT_MAX as one or more bits may, in the
> future, be used to specify an extension to the buffer.
>
> (Here' 'mask' is the fourth argument to statx())
>
> What is going on here? Why is there not a check in the code to
> give EINVAL if any flag other than those in STATX_ALL (0x00000fffU)
> is specified? (There is a check that gives EINVAL flags in
> STATX__RESERVED (0x80000000U), but STATX_ALL != ~STATX__RESERVED.
>
> Similarly, there appears to be no check for invalid flags in the
> 'flags' argument of statx(). Why is there also not such a check
> there?
>
> The failure to do these sorts of checks has been the source of grief
> in the past with other system calls.
So, it looks like the checks are there for 'flags' (I missed that
they were one level deeper in the call sequence), but my question
re 'mask' still stands.
Cheers,
Michael
--
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/
next prev parent reply other threads:[~2017-04-21 12:28 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-04-21 12:14 Unchecked flags in statx(2) [Should be fixed before 4.11-final?] Michael Kerrisk (man-pages)
2017-04-21 12:28 ` Michael Kerrisk (man-pages) [this message]
2017-04-21 12:41 ` David Howells
2017-04-21 12:47 ` David Howells
2017-04-21 13:01 ` David Howells
2017-04-21 13:13 ` Michael Kerrisk (man-pages)
2017-04-21 18:16 ` Andreas Dilger
2017-04-21 19:19 ` Michael Kerrisk (man-pages)
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=e8b8e13f-868e-07f7-1c0b-d1e9bbc2dcb3@gmail.com \
--to=mtk.manpages@gmail.com \
--cc=dhowells@redhat.com \
--cc=ebiggers3@gmail.com \
--cc=hch@infradead.org \
--cc=linux-api@vger.kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--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;
as well as URLs for NNTP newsgroup(s).