Commit 59372bbf authored by Michael Kerrisk (man-pages)'s avatar Michael Kerrisk (man-pages) Committed by Linus Torvalds
Browse files

statx: correct error handling of NULL pathname

The change in commit 1e2f82d1 ("statx: Kill fd-with-NULL-path
support in favour of AT_EMPTY_PATH") to error on a NULL pathname to
statx() is inconsistent.

It results in the error EINVAL for a NULL pathname.  Other system calls
with similar APIs (fchownat(), fstatat(), linkat()), return EFAULT.

The solution is simply to remove the EINVAL check.  As I already pointed
out in [1], user_path_at*() and filename_lookup() will handle the NULL
pathname as per the other APIs, to correctly produce the error EFAULT.


Signed-off-by: default avatarMichael Kerrisk <>
Cc: David Howells <>
Cc: Al Viro <>
Cc: Eric Sandeen <>
Signed-off-by: default avatarLinus Torvalds <>
parent f8324608
......@@ -567,8 +567,6 @@ SYSCALL_DEFINE5(statx,
return -EINVAL;
return -EINVAL;
if (!filename)
return -EINVAL;
error = vfs_statx(dfd, filename, flags, &stat, mask);
if (error)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment