commit:     6592e08cac452d580e0146f7de3c53a8cb51c933
Author:     Mike Gilbert <floppym <AT> gentoo <DOT> org>
AuthorDate: Sun Dec 22 18:59:28 2024 +0000
Commit:     Mike Gilbert <floppym <AT> gentoo <DOT> org>
CommitDate: Sun Dec 22 18:59:28 2024 +0000
URL:        https://gitweb.gentoo.org/proj/sandbox.git/commit/?id=6592e08c

Restore exception for NULL path for utimensat

glibc rejects with EINVAL, but the kernel accepts it. We should do
access checks in case we are in ptrace mode.

Signed-off-by: Mike Gilbert <floppym <AT> gentoo.org>

 libsandbox/libsandbox.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libsandbox/libsandbox.c b/libsandbox/libsandbox.c
index e9f4b89..1fd6715 100644
--- a/libsandbox/libsandbox.c
+++ b/libsandbox/libsandbox.c
@@ -1080,7 +1080,7 @@ bool before_syscall(int dirfd, int sb_nr, const char 
*func, const char *file, in
 
        if (file == NULL) {
                /* futimesat treats dirfd as the target when file is NULL */
-               if (sb_nr != SB_NR_FUTIMESAT)
+               if (sb_nr != SB_NR_FUTIMESAT && sb_nr != SB_NR_UTIMENSAT)
                        return true; /* let the kernel reject this */
        }
        else if (file[0] == '\0') {

Reply via email to