• Eric Biggers's avatar
    statx: reject unknown flags when using NULL path · 8c7493aa
    Eric Biggers authored
    The statx() system call currently accepts unknown flags when called with
    a NULL path to operate on a file descriptor.  Left unchanged, this could
    make it hard to introduce new query flags in the future, since
    applications may not be able to tell whether a given flag is supported.
    
    Fix this by failing the system call with EINVAL if any flags other than
    KSTAT_QUERY_FLAGS are specified in combination with a NULL path.
    
    Arguably, we could still permit known lookup-related flags such as
    AT_SYMLINK_NOFOLLOW.  However, that would be inconsistent with how
    sys_utimensat() behaves when passed a NULL path, which seems to be the
    closest precedent.  And given that the NULL path case is (I believe)
    mainly intended to be used to implement a wrapper function like fstatx()
    that doesn't have a path argument, I think rejecting lookup-related
    flags too is probably the best choice.
    Signed-off-by: default avatarEric Biggers <ebiggers@google.com>
    Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
    Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
    8c7493aa
Name
Last commit
Last update
Documentation Loading commit data...
arch Loading commit data...
block Loading commit data...
certs Loading commit data...
crypto Loading commit data...
drivers Loading commit data...
firmware Loading commit data...
fs Loading commit data...
include Loading commit data...
init Loading commit data...
ipc Loading commit data...
kernel Loading commit data...
lib Loading commit data...
mm Loading commit data...
net Loading commit data...
samples Loading commit data...
scripts Loading commit data...
security Loading commit data...
sound Loading commit data...
tools Loading commit data...
usr Loading commit data...
virt Loading commit data...
.cocciconfig Loading commit data...
.get_maintainer.ignore Loading commit data...
.gitattributes Loading commit data...
.gitignore Loading commit data...
.mailmap Loading commit data...
COPYING Loading commit data...
CREDITS Loading commit data...
Kbuild Loading commit data...
Kconfig Loading commit data...
MAINTAINERS Loading commit data...
Makefile Loading commit data...
README Loading commit data...