]> git.ipfire.org Git - thirdparty/man-pages.git/commit
statx.2: Clarify details of a case where an invalid 'mask' value may be rejected
authorMichael Kerrisk <mtk.manpages@gmail.com>
Tue, 20 Aug 2019 07:29:49 +0000 (09:29 +0200)
committerMichael Kerrisk <mtk.manpages@gmail.com>
Tue, 20 Aug 2019 07:29:49 +0000 (09:29 +0200)
commitc031ffcc56e60ae7f8ecfbf03de295ab4dc23a8b
treec06f25f87e42a4a196b4d5f9198389cbc67bbe21
parent8d839a5673c6719a09eee6d432b2e636c3c98702
statx.2: Clarify details of a case where an invalid 'mask' value may be rejected

As reported by Simone:

    I was looking at version from 2017-09-15 but it's the same
    on: http://man7.org/linux/man-pages/man2/statx.2.html
    (2019-03-06)

    There is reported (about the mask argument) after the list
    of constants:

    > Note that the kernel does not reject values in mask other
    > than the above.  Instead, it simply informs the caller which
    > values are sup‐ ported by this kernel and filesystem via the
    > statx.stx_mask field.

    But as reported in the error values, there can be EINVAL if
    mask has a reserved valued, and I found a check against
    STATX__RESERVED in fs/stat.c for this. So if you use a that
    bit (0x80000000U) the kernel will reject the value.

    Probably is better to say that the kernel do not enforce the
    use of only the listed values, but there are anyway reserved
    values so and so you cannot put whatever you want on mask
    (that apply to more values than UINT_MAX).

Reported-by: Simone Piccardi <piccardi@truelite.it>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
man2/statx.2