Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
statx: correct error handling of NULL pathname
The change in commit 1e2f82d ("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. [1] https://lkml.org/lkml/2017/4/26/561 Signed-off-by: Michael Kerrisk <[email protected]> Cc: David Howells <[email protected]> Cc: Al Viro <[email protected]> Cc: Eric Sandeen <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
- Loading branch information