From: Dmitry V. Levin Date: Sun, 12 May 2019 22:45:45 +0000 (+0000) Subject: Implement and use new parsers of utimensat syscall X-Git-Tag: v5.1~32 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=db9896f718ac146e4b43d1c2ae0c0d93b084feb5;p=strace Implement and use new parsers of utimensat syscall * utimes.c (SYS_FUNC(utimensat)): Remove. [HAVE_ARCH_TIME32_SYSCALLS] (SYS_FUNC(utimensat_time32)): New function. * pathtrace.c (pathtrace_match_set): Replace SEN_utimensat with SEN_utimensat_time32. * linux/64/syscallent.h: Replace SEN(utimensat) with SEN(utimensat_time64). * linux/alpha/syscallent.h: Likewise. * linux/ia64/syscallent.h: Likewise. * linux/mips/syscallent-n64.h: Likewise. * linux/powerpc64/syscallent.h: Likewise. * linux/s390x/syscallent.h: Likewise. * linux/sh64/syscallent.h: Likewise. * linux/sparc64/syscallent.h: Likewise. * linux/x32/syscallent.h: Likewise. * linux/x86_64/syscallent.h: Likewise. * linux/32/syscallent.h: Replace SEN(utimensat) with SEN(utimensat_time32). * linux/arm/syscallent.h: Likewise. * linux/avr32/syscallent.h: Likewise. * linux/bfin/syscallent.h: Likewise. * linux/hppa/syscallent.h: Likewise. * linux/i386/syscallent.h: Likewise. * linux/m68k/syscallent.h: Likewise. * linux/microblaze/syscallent.h: Likewise. * linux/mips/syscallent-n32.h: Likewise. * linux/mips/syscallent-o32.h: Likewise. * linux/powerpc/syscallent.h: Likewise. * linux/s390/syscallent.h: Likewise. * linux/sh/syscallent.h: Likewise. * linux/sparc/syscallent.h: Likewise. * linux/xtensa/syscallent.h: Likewise. --- diff --git a/linux/32/syscallent.h b/linux/32/syscallent.h index bbcbf92c..3fba9051 100644 --- a/linux/32/syscallent.h +++ b/linux/32/syscallent.h @@ -100,7 +100,7 @@ [ 85] = { 2, TD, SEN(timerfd_create), "timerfd_create" }, [ 86] = { 4, TD, SEN(timerfd_settime32), "timerfd_settime" }, [ 87] = { 2, TD, SEN(timerfd_gettime32), "timerfd_gettime" }, -[ 88] = { 4, TD|TF, SEN(utimensat), "utimensat" }, +[ 88] = { 4, TD|TF, SEN(utimensat_time32), "utimensat" }, [ 89] = { 1, TF, SEN(acct), "acct" }, [ 90] = { 2, 0, SEN(capget), "capget" }, [ 91] = { 2, 0, SEN(capset), "capset" }, diff --git a/linux/64/syscallent.h b/linux/64/syscallent.h index 1778272b..4335145d 100644 --- a/linux/64/syscallent.h +++ b/linux/64/syscallent.h @@ -93,7 +93,7 @@ [ 85] = { 2, TD, SEN(timerfd_create), "timerfd_create" }, [ 86] = { 4, TD, SEN(timerfd_settime64), "timerfd_settime" }, [ 87] = { 2, TD, SEN(timerfd_gettime64), "timerfd_gettime" }, -[ 88] = { 4, TD|TF, SEN(utimensat), "utimensat" }, +[ 88] = { 4, TD|TF, SEN(utimensat_time64), "utimensat" }, [ 89] = { 1, TF, SEN(acct), "acct" }, [ 90] = { 2, 0, SEN(capget), "capget" }, [ 91] = { 2, 0, SEN(capset), "capset" }, diff --git a/linux/alpha/syscallent.h b/linux/alpha/syscallent.h index b027bdcb..a48e5a75 100644 --- a/linux/alpha/syscallent.h +++ b/linux/alpha/syscallent.h @@ -418,7 +418,7 @@ [472] = { 6, TM, SEN(move_pages), "move_pages" }, [473] = { 3, 0, SEN(getcpu), "getcpu" }, [474] = { 6, TD, SEN(epoll_pwait), "epoll_pwait" }, -[475] = { 4, TD|TF, SEN(utimensat), "utimensat" }, +[475] = { 4, TD|TF, SEN(utimensat_time64), "utimensat" }, [476] = { 3, TD|TS, SEN(signalfd), "signalfd" }, [477] = { 4, TD, SEN(timerfd), "timerfd" }, /* not implemented */ [478] = { 1, TD, SEN(eventfd), "eventfd" }, diff --git a/linux/arm/syscallent.h b/linux/arm/syscallent.h index cd7b1576..f17b85b2 100644 --- a/linux/arm/syscallent.h +++ b/linux/arm/syscallent.h @@ -355,7 +355,7 @@ [345] = { 3, 0, SEN(getcpu), "getcpu" }, [346] = { 6, TD, SEN(epoll_pwait), "epoll_pwait" }, [347] = { 4, 0, SEN(kexec_load), "kexec_load" }, -[348] = { 4, TD|TF, SEN(utimensat), "utimensat" }, +[348] = { 4, TD|TF, SEN(utimensat_time32), "utimensat" }, [349] = { 3, TD|TS, SEN(signalfd), "signalfd" }, [350] = { 2, TD, SEN(timerfd_create), "timerfd_create" }, [351] = { 1, TD, SEN(eventfd), "eventfd" }, diff --git a/linux/avr32/syscallent.h b/linux/avr32/syscallent.h index d4608029..09d7b536 100644 --- a/linux/avr32/syscallent.h +++ b/linux/avr32/syscallent.h @@ -284,7 +284,7 @@ [275] = { 3, TI, SEN(shmget), "shmget" }, [276] = { 1, TI|TM|SI, SEN(shmdt), "shmdt" }, [277] = { 3, TI, SEN(shmctl), "shmctl" }, -[278] = { 4, TD|TF, SEN(utimensat), "utimensat" }, +[278] = { 4, TD|TF, SEN(utimensat_time32), "utimensat" }, [279] = { 3, TD|TS, SEN(signalfd), "signalfd" }, [280] = { 4, TD, SEN(timerfd), "timerfd" }, [281] = { 1, TD, SEN(eventfd), "eventfd" }, diff --git a/linux/bfin/syscallent.h b/linux/bfin/syscallent.h index f97ae058..65655203 100644 --- a/linux/bfin/syscallent.h +++ b/linux/bfin/syscallent.h @@ -353,7 +353,7 @@ [344] = { 4, TD, SEN(tee), "tee" }, [345] = { 4, TD, SEN(vmsplice), "vmsplice" }, [346] = { 6, TD, SEN(epoll_pwait), "epoll_pwait" }, -[347] = { 4, TD|TF, SEN(utimensat), "utimensat" }, +[347] = { 4, TD|TF, SEN(utimensat_time32), "utimensat" }, [348] = { 3, TD|TS, SEN(signalfd), "signalfd" }, [349] = { 2, TD, SEN(timerfd_create), "timerfd_create" }, [350] = { 1, TD, SEN(eventfd), "eventfd" }, diff --git a/linux/hppa/syscallent.h b/linux/hppa/syscallent.h index dd4448fd..ebeaa183 100644 --- a/linux/hppa/syscallent.h +++ b/linux/hppa/syscallent.h @@ -304,7 +304,7 @@ [298] = { 3, TF|TSF|TSFA, SEN(statfs64), "statfs64" }, [299] = { 3, TD|TFSF|TSFA, SEN(fstatfs64), "fstatfs64" }, [300] = { 4, 0, SEN(kexec_load), "kexec_load" }, -[301] = { 4, TD|TF, SEN(utimensat), "utimensat" }, +[301] = { 4, TD|TF, SEN(utimensat_time32), "utimensat" }, [302] = { 3, TD|TS, SEN(signalfd), "signalfd" }, [303] = { 4, TD, SEN(timerfd), "timerfd" }, [304] = { 1, TD, SEN(eventfd), "eventfd" }, diff --git a/linux/i386/syscallent.h b/linux/i386/syscallent.h index faa70b02..123c74b4 100644 --- a/linux/i386/syscallent.h +++ b/linux/i386/syscallent.h @@ -326,7 +326,7 @@ [317] = { 6, TM, SEN(move_pages), "move_pages" }, [318] = { 3, 0, SEN(getcpu), "getcpu" }, [319] = { 6, TD, SEN(epoll_pwait), "epoll_pwait" }, -[320] = { 4, TD|TF, SEN(utimensat), "utimensat" }, +[320] = { 4, TD|TF, SEN(utimensat_time32), "utimensat" }, [321] = { 3, TD|TS, SEN(signalfd), "signalfd" }, [322] = { 2, TD, SEN(timerfd_create), "timerfd_create" }, [323] = { 1, TD, SEN(eventfd), "eventfd" }, diff --git a/linux/ia64/syscallent.h b/linux/ia64/syscallent.h index a59ceaab..bdbf4472 100644 --- a/linux/ia64/syscallent.h +++ b/linux/ia64/syscallent.h @@ -289,7 +289,7 @@ [1024 + 279] = { 4, TD, SEN(fallocate), "fallocate" }, [1024 + 280] = { 3, 0, SEN(getcpu), "getcpu" }, [1024 + 281] = { 6, TD, SEN(epoll_pwait), "epoll_pwait" }, -[1024 + 282] = { 4, TD|TF, SEN(utimensat), "utimensat" }, +[1024 + 282] = { 4, TD|TF, SEN(utimensat_time64), "utimensat" }, [1024 + 283] = { 3, TD|TS, SEN(signalfd), "signalfd" }, [1024 + 284] = { 4, TD, SEN(timerfd), "timerfd" }, [1024 + 285] = { 1, TD, SEN(eventfd), "eventfd" }, diff --git a/linux/m68k/syscallent.h b/linux/m68k/syscallent.h index 1f2b3db4..2e9dc835 100644 --- a/linux/m68k/syscallent.h +++ b/linux/m68k/syscallent.h @@ -322,7 +322,7 @@ [313] = { 4, 0, SEN(kexec_load), "kexec_load" }, [314] = { 3, 0, SEN(getcpu), "getcpu" }, [315] = { 6, TD, SEN(epoll_pwait), "epoll_pwait" }, -[316] = { 4, TD|TF, SEN(utimensat), "utimensat" }, +[316] = { 4, TD|TF, SEN(utimensat_time32), "utimensat" }, [317] = { 3, TD|TS, SEN(signalfd), "signalfd" }, [318] = { 2, TD, SEN(timerfd_create), "timerfd_create" }, [319] = { 1, TD, SEN(eventfd), "eventfd" }, diff --git a/linux/microblaze/syscallent.h b/linux/microblaze/syscallent.h index 1389854f..ad23bee8 100644 --- a/linux/microblaze/syscallent.h +++ b/linux/microblaze/syscallent.h @@ -326,7 +326,7 @@ [317] = { 6, TM, SEN(move_pages), "move_pages" }, [318] = { 3, 0, SEN(getcpu), "getcpu" }, [319] = { 6, TD, SEN(epoll_pwait), "epoll_pwait" }, -[320] = { 4, TD|TF, SEN(utimensat), "utimensat" }, +[320] = { 4, TD|TF, SEN(utimensat_time32), "utimensat" }, [321] = { 3, TD|TS, SEN(signalfd), "signalfd" }, [322] = { 2, TD, SEN(timerfd_create), "timerfd_create" }, [323] = { 1, TD, SEN(eventfd), "eventfd" }, diff --git a/linux/mips/syscallent-n32.h b/linux/mips/syscallent-n32.h index 736da779..7f7aa07b 100644 --- a/linux/mips/syscallent-n32.h +++ b/linux/mips/syscallent-n32.h @@ -286,7 +286,7 @@ [6276] = { 6, TD, SEN(epoll_pwait), "epoll_pwait" }, [6277] = { 3, 0, SEN(ioprio_set), "ioprio_set" }, [6278] = { 2, 0, SEN(ioprio_get), "ioprio_get" }, -[6279] = { 4, TD|TF, SEN(utimensat), "utimensat" }, +[6279] = { 4, TD|TF, SEN(utimensat_time32), "utimensat" }, [6280] = { 3, TD|TS, SEN(signalfd), "signalfd" }, [6281] = { 4, TD, SEN(timerfd), "timerfd" }, [6282] = { 1, TD, SEN(eventfd), "eventfd" }, diff --git a/linux/mips/syscallent-n64.h b/linux/mips/syscallent-n64.h index d4df7a01..baaab654 100644 --- a/linux/mips/syscallent-n64.h +++ b/linux/mips/syscallent-n64.h @@ -282,7 +282,7 @@ [5272] = { 6, TD, SEN(epoll_pwait), "epoll_pwait" }, [5273] = { 3, 0, SEN(ioprio_set), "ioprio_set" }, [5274] = { 2, 0, SEN(ioprio_get), "ioprio_get" }, -[5275] = { 4, TD|TF, SEN(utimensat), "utimensat" }, +[5275] = { 4, TD|TF, SEN(utimensat_time64), "utimensat" }, [5276] = { 3, TD|TS, SEN(signalfd), "signalfd" }, [5277] = { 4, TD, SEN(timerfd), "timerfd" }, [5278] = { 1, TD, SEN(eventfd), "eventfd" }, diff --git a/linux/mips/syscallent-o32.h b/linux/mips/syscallent-o32.h index 539d1f8c..df0c98a5 100644 --- a/linux/mips/syscallent-o32.h +++ b/linux/mips/syscallent-o32.h @@ -324,7 +324,7 @@ [4313] = { 6, TD, SEN(epoll_pwait), "epoll_pwait" }, [4314] = { 3, 0, SEN(ioprio_set), "ioprio_set" }, [4315] = { 2, 0, SEN(ioprio_get), "ioprio_get" }, -[4316] = { 4, TD|TF, SEN(utimensat), "utimensat" }, +[4316] = { 4, TD|TF, SEN(utimensat_time32), "utimensat" }, [4317] = { 3, TD|TS, SEN(signalfd), "signalfd" }, [4318] = { 4, TD, SEN(timerfd), "timerfd" }, [4319] = { 1, TD, SEN(eventfd), "eventfd" }, diff --git a/linux/powerpc/syscallent.h b/linux/powerpc/syscallent.h index 628c717c..b5eeaece 100644 --- a/linux/powerpc/syscallent.h +++ b/linux/powerpc/syscallent.h @@ -311,7 +311,7 @@ [301] = { 6, TM, SEN(move_pages), "move_pages" }, [302] = { 3, 0, SEN(getcpu), "getcpu" }, [303] = { 6, TD, SEN(epoll_pwait), "epoll_pwait" }, -[304] = { 4, TD|TF, SEN(utimensat), "utimensat" }, +[304] = { 4, TD|TF, SEN(utimensat_time32), "utimensat" }, [305] = { 3, TD|TS, SEN(signalfd), "signalfd" }, [306] = { 2, TD, SEN(timerfd_create), "timerfd_create" }, [307] = { 1, TD, SEN(eventfd), "eventfd" }, diff --git a/linux/powerpc64/syscallent.h b/linux/powerpc64/syscallent.h index 0d3296ae..e282198b 100644 --- a/linux/powerpc64/syscallent.h +++ b/linux/powerpc64/syscallent.h @@ -306,7 +306,7 @@ [301] = { 6, TM, SEN(move_pages), "move_pages" }, [302] = { 3, 0, SEN(getcpu), "getcpu" }, [303] = { 6, TD, SEN(epoll_pwait), "epoll_pwait" }, -[304] = { 4, TD|TF, SEN(utimensat), "utimensat" }, +[304] = { 4, TD|TF, SEN(utimensat_time64), "utimensat" }, [305] = { 3, TD|TS, SEN(signalfd), "signalfd" }, [306] = { 2, TD, SEN(timerfd_create), "timerfd_create" }, [307] = { 1, TD, SEN(eventfd), "eventfd" }, diff --git a/linux/s390/syscallent.h b/linux/s390/syscallent.h index a0992e3b..eff90fc0 100644 --- a/linux/s390/syscallent.h +++ b/linux/s390/syscallent.h @@ -324,7 +324,7 @@ [312] = { 6, TD, SEN(epoll_pwait), "epoll_pwait" }, [313] = { 2, TF, SEN(utimes), "utimes" }, [314] = { 6, TD, SEN(fallocate), "fallocate" }, -[315] = { 4, TD|TF, SEN(utimensat), "utimensat" }, +[315] = { 4, TD|TF, SEN(utimensat_time32), "utimensat" }, [316] = { 3, TD|TS, SEN(signalfd), "signalfd" }, [317] = { 4, TD, SEN(timerfd), "timerfd" }, [318] = { 1, TD, SEN(eventfd), "eventfd" }, diff --git a/linux/s390x/syscallent.h b/linux/s390x/syscallent.h index 98c70540..8561fdd1 100644 --- a/linux/s390x/syscallent.h +++ b/linux/s390x/syscallent.h @@ -308,7 +308,7 @@ [312] = { 6, TD, SEN(epoll_pwait), "epoll_pwait" }, [313] = { 2, TF, SEN(utimes), "utimes" }, [314] = { 4, TD, SEN(fallocate), "fallocate" }, -[315] = { 4, TD|TF, SEN(utimensat), "utimensat" }, +[315] = { 4, TD|TF, SEN(utimensat_time64), "utimensat" }, [316] = { 3, TD|TS, SEN(signalfd), "signalfd" }, [317] = { 4, TD, SEN(timerfd), "timerfd" }, [318] = { 1, TD, SEN(eventfd), "eventfd" }, diff --git a/linux/sh/syscallent.h b/linux/sh/syscallent.h index 4523c0a4..d97f0aaa 100644 --- a/linux/sh/syscallent.h +++ b/linux/sh/syscallent.h @@ -326,7 +326,7 @@ [317] = { 6, TM, SEN(move_pages), "move_pages" }, [318] = { 3, 0, SEN(getcpu), "getcpu" }, [319] = { 6, TD, SEN(epoll_pwait), "epoll_pwait" }, -[320] = { 4, TD|TF, SEN(utimensat), "utimensat" }, +[320] = { 4, TD|TF, SEN(utimensat_time32), "utimensat" }, [321] = { 3, TD|TS, SEN(signalfd), "signalfd" }, [322] = { 2, TD, SEN(timerfd_create), "timerfd_create" }, [323] = { 1, TD, SEN(eventfd), "eventfd" }, diff --git a/linux/sh64/syscallent.h b/linux/sh64/syscallent.h index 4b921283..c5a8fdea 100644 --- a/linux/sh64/syscallent.h +++ b/linux/sh64/syscallent.h @@ -352,7 +352,7 @@ [345] = { 6, TM, SEN(move_pages), "move_pages" }, [346] = { 3, 0, SEN(getcpu), "getcpu" }, [347] = { 6, TD, SEN(epoll_pwait), "epoll_pwait" }, -[348] = { 4, TD|TF, SEN(utimensat), "utimensat" }, +[348] = { 4, TD|TF, SEN(utimensat_time64), "utimensat" }, [349] = { 3, TD|TS, SEN(signalfd), "signalfd" }, [350] = { 2, TD, SEN(timerfd_create), "timerfd_create" }, [351] = { 1, TD, SEN(eventfd), "eventfd" }, diff --git a/linux/sparc/syscallent.h b/linux/sparc/syscallent.h index d4365ce6..18aa94f9 100644 --- a/linux/sparc/syscallent.h +++ b/linux/sparc/syscallent.h @@ -315,7 +315,7 @@ [307] = { 6, TM, SEN(move_pages), "move_pages" }, [308] = { 3, 0, SEN(getcpu), "getcpu" }, [309] = { 6, TD, SEN(epoll_pwait), "epoll_pwait" }, -[310] = { 4, TD|TF, SEN(utimensat), "utimensat" }, +[310] = { 4, TD|TF, SEN(utimensat_time32), "utimensat" }, [311] = { 3, TD|TS, SEN(signalfd), "signalfd" }, [312] = { 2, TD, SEN(timerfd_create), "timerfd_create" }, [313] = { 1, TD, SEN(eventfd), "eventfd" }, diff --git a/linux/sparc64/syscallent.h b/linux/sparc64/syscallent.h index 805d42f1..77123091 100644 --- a/linux/sparc64/syscallent.h +++ b/linux/sparc64/syscallent.h @@ -313,7 +313,7 @@ [307] = { 6, TM, SEN(move_pages), "move_pages" }, [308] = { 3, 0, SEN(getcpu), "getcpu" }, [309] = { 6, TD, SEN(epoll_pwait), "epoll_pwait" }, -[310] = { 4, TD|TF, SEN(utimensat), "utimensat" }, +[310] = { 4, TD|TF, SEN(utimensat_time64), "utimensat" }, [311] = { 3, TD|TS, SEN(signalfd), "signalfd" }, [312] = { 2, TD, SEN(timerfd_create), "timerfd_create" }, [313] = { 1, TD, SEN(eventfd), "eventfd" }, diff --git a/linux/x32/syscallent.h b/linux/x32/syscallent.h index 4b64c3c6..2446f0b3 100644 --- a/linux/x32/syscallent.h +++ b/linux/x32/syscallent.h @@ -285,7 +285,7 @@ [277] = { 4, TD, SEN(sync_file_range), "sync_file_range" }, [278] = { 4, TD, SEN(printargs), "vmsplice#64" }, [279] = { 6, TM, SEN(printargs), "move_pages#64" }, -[280] = { 4, TD|TF, SEN(utimensat), "utimensat" }, +[280] = { 4, TD|TF, SEN(utimensat_time64), "utimensat" }, [281] = { 6, TD, SEN(epoll_pwait), "epoll_pwait" }, [282] = { 3, TD|TS, SEN(signalfd), "signalfd" }, [283] = { 2, TD, SEN(timerfd_create), "timerfd_create" }, diff --git a/linux/x86_64/syscallent.h b/linux/x86_64/syscallent.h index 89f2ad41..3e0ce619 100644 --- a/linux/x86_64/syscallent.h +++ b/linux/x86_64/syscallent.h @@ -285,7 +285,7 @@ [277] = { 4, TD, SEN(sync_file_range), "sync_file_range" }, [278] = { 4, TD, SEN(vmsplice), "vmsplice" }, [279] = { 6, TM, SEN(move_pages), "move_pages" }, -[280] = { 4, TD|TF, SEN(utimensat), "utimensat" }, +[280] = { 4, TD|TF, SEN(utimensat_time64), "utimensat" }, [281] = { 6, TD, SEN(epoll_pwait), "epoll_pwait" }, [282] = { 3, TD|TS, SEN(signalfd), "signalfd" }, [283] = { 2, TD, SEN(timerfd_create), "timerfd_create" }, diff --git a/linux/xtensa/syscallent.h b/linux/xtensa/syscallent.h index 93acedbd..d01c7957 100644 --- a/linux/xtensa/syscallent.h +++ b/linux/xtensa/syscallent.h @@ -292,7 +292,7 @@ [293] = { 5, TD|TF, SEN(linkat), "linkat" }, [294] = { 3, TD|TF, SEN(symlinkat), "symlinkat" }, [295] = { 4, TD|TF, SEN(readlinkat), "readlinkat" }, -[296] = { 4, TD|TF, SEN(utimensat), "utimensat" }, +[296] = { 4, TD|TF, SEN(utimensat_time32), "utimensat" }, [297] = { 5, TD|TF, SEN(fchownat), "fchownat" }, [298] = { 3, TD|TF, SEN(futimesat), "futimesat" }, [299] = { 4, TD|TF|TFST|TSTA,SEN(fstatat64), "fstatat64" }, diff --git a/pathtrace.c b/pathtrace.c index 2e83c5c4..a1716cae 100644 --- a/pathtrace.c +++ b/pathtrace.c @@ -203,7 +203,7 @@ pathtrace_match_set(struct tcb *tcp, struct path_set *set) case SEN_readlinkat: case SEN_statx: case SEN_unlinkat: - case SEN_utimensat: + case SEN_utimensat_time32: case SEN_utimensat_time64: /* fd, path */ return fdmatch(tcp, tcp->u_arg[0], set) || diff --git a/utimes.c b/utimes.c index cf9168e3..87fc32bf 100644 --- a/utimes.c +++ b/utimes.c @@ -46,10 +46,12 @@ do_utimensat(struct tcb *const tcp, const print_obj_by_addr_fn print_ts) return RVAL_DECODED; } -SYS_FUNC(utimensat) +#if HAVE_ARCH_TIME32_SYSCALLS +SYS_FUNC(utimensat_time32) { - return do_utimensat(tcp, print_timespec_utime_pair); + return do_utimensat(tcp, print_timespec32_utime_pair); } +#endif SYS_FUNC(utimensat_time64) {