git: 5e777d88c46a - stable/13 - linux(4): Handle AT_EMPTY_PATH in the utimensat syscall.

From: Dmitry Chagin <dchagin_at_FreeBSD.org>
Date: Fri, 17 Jun 2022 19:24:09 UTC
The branch stable/13 has been updated by dchagin:

URL: https://cgit.FreeBSD.org/src/commit/?id=5e777d88c46a394dd0d0b9dd0fa1a6d870bf4e32

commit 5e777d88c46a394dd0d0b9dd0fa1a6d870bf4e32
Author:     Dmitry Chagin <dchagin@FreeBSD.org>
AuthorDate: 2021-05-31 19:37:06 +0000
Commit:     Dmitry Chagin <dchagin@FreeBSD.org>
CommitDate: 2022-06-17 19:22:16 +0000

    linux(4): Handle AT_EMPTY_PATH in the utimensat syscall.
    
    Differential Revision:  https://reviews.freebsd.org/D30518
    MFC after:              2 weeks
    
    (cherry picked from commit b4f9b6eef2bb30059cf1040383c88c94f4d093a5)
---
 sys/compat/linux/linux_misc.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/sys/compat/linux/linux_misc.c b/sys/compat/linux/linux_misc.c
index cb129179a44d..023d98f2ec34 100644
--- a/sys/compat/linux/linux_misc.c
+++ b/sys/compat/linux/linux_misc.c
@@ -813,7 +813,7 @@ linux_utimensat(struct thread *td, struct linux_utimensat_args *args)
 
 	dfd = (args->dfd == LINUX_AT_FDCWD) ? AT_FDCWD : args->dfd;
 
-	if (args->flags & ~LINUX_AT_SYMLINK_NOFOLLOW)
+	if (args->flags & ~(LINUX_AT_SYMLINK_NOFOLLOW | LINUX_AT_EMPTY_PATH))
 		return (EINVAL);
 
 	if (args->times != NULL) {
@@ -863,6 +863,8 @@ linux_utimensat(struct thread *td, struct linux_utimensat_args *args)
 
 	if (args->flags & LINUX_AT_SYMLINK_NOFOLLOW)
 		flags |= AT_SYMLINK_NOFOLLOW;
+	if (args->flags & LINUX_AT_EMPTY_PATH)
+		flags |= AT_EMPTY_PATH;
 
 	if (!LUSECONVPATH(td)) {
 		if (args->pathname != NULL) {