Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1628194

Unchecked flags in statx(2) [Should be fixed before 4.11-final?]

From "Michael Kerrisk (man-pages)" <mtk.manpages@gmail.com>
Newsgroups linux.kernel
Subject Unchecked flags in statx(2) [Should be fixed before 4.11-final?]
Date 2017-04-21 14:20 +0200
Message-ID <tyFHz-5HC-1@gated-at.bofh.it> (permalink)
Organization linux.* mail to news gateway

Show all headers | View raw


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.

Cheers,

Michael


-- 
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/

Back to linux.kernel | Previous | NextNext in thread | Find similar | Unroll thread


Thread

Unchecked flags in statx(2) [Should be fixed before 4.11-final?] "Michael Kerrisk (man-pages)" <mtk.manpages@gmail.com> - 2017-04-21 14:20 +0200
  Re: Unchecked flags in statx(2) [Should be fixed before 4.11-final?] "Michael Kerrisk (man-pages)" <mtk.manpages@gmail.com> - 2017-04-21 14:30 +0200
  Re: Unchecked flags in statx(2) [Should be fixed before 4.11-final?] David Howells <dhowells@redhat.com> - 2017-04-21 14:50 +0200
  Re: Unchecked flags in statx(2) [Should be fixed before 4.11-final?] David Howells <dhowells@redhat.com> - 2017-04-21 14:50 +0200
  Re: Unchecked flags in statx(2) [Should be fixed before 4.11-final?] David Howells <dhowells@redhat.com> - 2017-04-21 15:10 +0200
    Re: Unchecked flags in statx(2) [Should be fixed before 4.11-final?] "Michael Kerrisk (man-pages)" <mtk.manpages@gmail.com> - 2017-04-21 15:20 +0200
      Re: Unchecked flags in statx(2) [Should be fixed before 4.11-final?] Andreas Dilger <adilger@dilger.ca> - 2017-04-21 20:50 +0200
        Re: Unchecked flags in statx(2) [Should be fixed before 4.11-final?] "Michael Kerrisk (man-pages)" <mtk.manpages@gmail.com> - 2017-04-21 21:20 +0200

csiph-web