From dd039b74efd2b7ecb499a122e05465783716d577 Mon Sep 17 00:00:00 2001 From: "Dmitry V. Levin" Date: Mon, 28 Dec 2015 00:44:47 +0000 Subject: [PATCH] Set SYSCALL_NEVER_FAILS flag for umask syscall Linux kernel always ANDs umask argument with 0700 and therefore this syscall never fails. * linux/*/syscallent*.h (umask): Set NF flag. --- linux/32/syscallent.h | 2 +- linux/64/syscallent.h | 2 +- linux/alpha/syscallent.h | 2 +- linux/arm/syscallent.h | 2 +- linux/avr32/syscallent.h | 2 +- linux/bfin/syscallent.h | 2 +- linux/hppa/syscallent.h | 2 +- linux/i386/syscallent.h | 2 +- linux/ia64/syscallent.h | 2 +- linux/m68k/syscallent.h | 2 +- linux/microblaze/syscallent.h | 2 +- linux/mips/syscallent-n32.h | 2 +- linux/mips/syscallent-n64.h | 2 +- linux/mips/syscallent-o32.h | 2 +- linux/powerpc/syscallent.h | 2 +- linux/powerpc64/syscallent.h | 2 +- linux/s390/syscallent.h | 2 +- linux/s390x/syscallent.h | 2 +- linux/sh/syscallent.h | 2 +- linux/sh64/syscallent.h | 2 +- linux/sparc/syscallent.h | 2 +- linux/x32/syscallent.h | 2 +- linux/x86_64/syscallent.h | 2 +- linux/xtensa/syscallent.h | 2 +- 24 files changed, 24 insertions(+), 24 deletions(-) diff --git a/linux/32/syscallent.h b/linux/32/syscallent.h index 5b51fb0e..dfe95cc2 100644 --- a/linux/32/syscallent.h +++ b/linux/32/syscallent.h @@ -171,7 +171,7 @@ [163] = { 2, 0, SEN(getrlimit), "getrlimit" }, [164] = { 2, 0, SEN(setrlimit), "setrlimit" }, [165] = { 2, 0, SEN(getrusage), "getrusage" }, -[166] = { 1, 0, SEN(umask), "umask" }, +[166] = { 1, NF, SEN(umask), "umask" }, [167] = { 5, 0, SEN(prctl), "prctl" }, [168] = { 3, 0, SEN(getcpu), "getcpu" }, [169] = { 2, 0, SEN(gettimeofday), "gettimeofday" }, diff --git a/linux/64/syscallent.h b/linux/64/syscallent.h index 5847e618..bb3cb333 100644 --- a/linux/64/syscallent.h +++ b/linux/64/syscallent.h @@ -164,7 +164,7 @@ [163] = { 2, 0, SEN(getrlimit), "getrlimit" }, [164] = { 2, 0, SEN(setrlimit), "setrlimit" }, [165] = { 2, 0, SEN(getrusage), "getrusage" }, -[166] = { 1, 0, SEN(umask), "umask" }, +[166] = { 1, NF, SEN(umask), "umask" }, [167] = { 5, 0, SEN(prctl), "prctl" }, [168] = { 3, 0, SEN(getcpu), "getcpu" }, [169] = { 2, 0, SEN(gettimeofday), "gettimeofday" }, diff --git a/linux/alpha/syscallent.h b/linux/alpha/syscallent.h index e5134736..a44cf982 100644 --- a/linux/alpha/syscallent.h +++ b/linux/alpha/syscallent.h @@ -86,7 +86,7 @@ [ 57] = { 2, TF, SEN(symlink), "symlink" }, [ 58] = { 3, TF, SEN(readlink), "readlink" }, [ 59] = { 3, TF|TP|SE|SI, SEN(execve), "execve" }, -[ 60] = { 1, 0, SEN(umask), "umask" }, +[ 60] = { 1, NF, SEN(umask), "umask" }, [ 61] = { 1, TF, SEN(chroot), "chroot" }, [ 62] = { 5, 0, SEN(printargs), "osf_old_fstat" }, /*not implemented */ [ 63] = { 0, 0, SEN(getpgrp), "getpgrp" }, diff --git a/linux/arm/syscallent.h b/linux/arm/syscallent.h index 83a8d3ed..7d5bc556 100644 --- a/linux/arm/syscallent.h +++ b/linux/arm/syscallent.h @@ -86,7 +86,7 @@ [ 57] = { 2, 0, SEN(setpgid), "setpgid" }, [ 58] = { 2, 0, SEN(ulimit), "ulimit" }, [ 59] = { 1, 0, SEN(oldolduname), "oldolduname" }, -[ 60] = { 1, 0, SEN(umask), "umask" }, +[ 60] = { 1, NF, SEN(umask), "umask" }, [ 61] = { 1, TF, SEN(chroot), "chroot" }, [ 62] = { 2, 0, SEN(ustat), "ustat" }, [ 63] = { 2, TD, SEN(dup2), "dup2" }, diff --git a/linux/avr32/syscallent.h b/linux/avr32/syscallent.h index 462e50d4..ea8d7352 100644 --- a/linux/avr32/syscallent.h +++ b/linux/avr32/syscallent.h @@ -32,7 +32,7 @@ [ 4] = { 3, TD, SEN(write), "write" }, [ 5] = { 3, TD|TF, SEN(open), "open" }, [ 6] = { 1, TD, SEN(close), "close" }, -[ 7] = { 1, 0, SEN(umask), "umask" }, +[ 7] = { 1, NF, SEN(umask), "umask" }, [ 8] = { 2, TD|TF, SEN(creat), "creat" }, [ 9] = { 2, TF, SEN(link), "link" }, [ 10] = { 1, TF, SEN(unlink), "unlink" }, diff --git a/linux/bfin/syscallent.h b/linux/bfin/syscallent.h index 1449fc2d..07bc4735 100644 --- a/linux/bfin/syscallent.h +++ b/linux/bfin/syscallent.h @@ -86,7 +86,7 @@ [ 57] = { 2, 0, SEN(setpgid), "setpgid" }, [ 58] = { 2, 0, SEN(ulimit), "ulimit" }, [ 59] = { 1, 0, SEN(oldolduname), "oldolduname" }, -[ 60] = { 1, 0, SEN(umask), "umask" }, +[ 60] = { 1, NF, SEN(umask), "umask" }, [ 61] = { 1, TF, SEN(chroot), "chroot" }, [ 62] = { 2, 0, SEN(ustat), "ustat" }, [ 63] = { 2, TD, SEN(dup2), "dup2" }, diff --git a/linux/hppa/syscallent.h b/linux/hppa/syscallent.h index ad56841b..ece571db 100644 --- a/linux/hppa/syscallent.h +++ b/linux/hppa/syscallent.h @@ -62,7 +62,7 @@ [ 57] = { 2, 0, SEN(setpgid), "setpgid" }, [ 58] = { 4, TN, SEN(send), "send" }, [ 59] = { 1, 0, SEN(uname), "uname" }, -[ 60] = { 1, 0, SEN(umask), "umask" }, +[ 60] = { 1, NF, SEN(umask), "umask" }, [ 61] = { 1, TF, SEN(chroot), "chroot" }, [ 62] = { 2, 0, SEN(ustat), "ustat" }, [ 63] = { 2, TD, SEN(dup2), "dup2" }, diff --git a/linux/i386/syscallent.h b/linux/i386/syscallent.h index c92f89cd..94b3e86d 100644 --- a/linux/i386/syscallent.h +++ b/linux/i386/syscallent.h @@ -86,7 +86,7 @@ [ 57] = { 2, 0, SEN(setpgid), "setpgid" }, [ 58] = { 2, 0, SEN(ulimit), "ulimit" }, [ 59] = { 1, 0, SEN(oldolduname), "oldolduname" }, -[ 60] = { 1, 0, SEN(umask), "umask" }, +[ 60] = { 1, NF, SEN(umask), "umask" }, [ 61] = { 1, TF, SEN(chroot), "chroot" }, [ 62] = { 2, 0, SEN(ustat), "ustat" }, [ 63] = { 2, TD, SEN(dup2), "dup2" }, diff --git a/linux/ia64/syscallent.h b/linux/ia64/syscallent.h index fcb99a00..5e6adfc2 100644 --- a/linux/ia64/syscallent.h +++ b/linux/ia64/syscallent.h @@ -83,7 +83,7 @@ [1064] = { 1, TF, SEN(acct), "acct" }, [1065] = { 3, TD, SEN(ioctl), "ioctl" }, [1066] = { 3, TD, SEN(fcntl), "fcntl" }, -[1067] = { 1, 0, SEN(umask), "umask" }, +[1067] = { 1, NF, SEN(umask), "umask" }, [1068] = { 1, TF, SEN(chroot), "chroot" }, [1069] = { 2, 0, SEN(ustat), "ustat" }, [1070] = { 2, TD, SEN(dup2), "dup2" }, diff --git a/linux/m68k/syscallent.h b/linux/m68k/syscallent.h index a5d59f3d..5716abd8 100644 --- a/linux/m68k/syscallent.h +++ b/linux/m68k/syscallent.h @@ -86,7 +86,7 @@ [ 57] = { 2, 0, SEN(setpgid), "setpgid" }, [ 58] = { 2, 0, SEN(ulimit), "ulimit" }, [ 59] = { 1, 0, SEN(oldolduname), "oldolduname" }, -[ 60] = { 1, 0, SEN(umask), "umask" }, +[ 60] = { 1, NF, SEN(umask), "umask" }, [ 61] = { 1, TF, SEN(chroot), "chroot" }, [ 62] = { 2, 0, SEN(ustat), "ustat" }, [ 63] = { 2, TD, SEN(dup2), "dup2" }, diff --git a/linux/microblaze/syscallent.h b/linux/microblaze/syscallent.h index cd6d83ef..9f3207d4 100644 --- a/linux/microblaze/syscallent.h +++ b/linux/microblaze/syscallent.h @@ -86,7 +86,7 @@ [ 57] = { 2, 0, SEN(setpgid), "setpgid" }, [ 58] = { 2, 0, SEN(ulimit), "ulimit" }, [ 59] = { 1, 0, SEN(oldolduname), "oldolduname" }, -[ 60] = { 1, 0, SEN(umask), "umask" }, +[ 60] = { 1, NF, SEN(umask), "umask" }, [ 61] = { 1, TF, SEN(chroot), "chroot" }, [ 62] = { 2, 0, SEN(ustat), "ustat" }, [ 63] = { 2, TD, SEN(dup2), "dup2" }, diff --git a/linux/mips/syscallent-n32.h b/linux/mips/syscallent-n32.h index 6c1bb088..e7debb85 100644 --- a/linux/mips/syscallent-n32.h +++ b/linux/mips/syscallent-n32.h @@ -93,7 +93,7 @@ [6090] = { 3, TF, SEN(chown), "chown" }, [6091] = { 3, TD, SEN(fchown), "fchown" }, [6092] = { 3, TF, SEN(chown), "lchown" }, -[6093] = { 1, 0, SEN(umask), "umask" }, +[6093] = { 1, NF, SEN(umask), "umask" }, [6094] = { 2, 0, SEN(gettimeofday), "gettimeofday" }, [6095] = { 2, 0, SEN(getrlimit), "getrlimit" }, [6096] = { 2, 0, SEN(getrusage), "getrusage" }, diff --git a/linux/mips/syscallent-n64.h b/linux/mips/syscallent-n64.h index 697623ba..d8a1a800 100644 --- a/linux/mips/syscallent-n64.h +++ b/linux/mips/syscallent-n64.h @@ -93,7 +93,7 @@ [5090] = { 3, TF, SEN(chown), "chown" }, [5091] = { 3, TD, SEN(fchown), "fchown" }, [5092] = { 3, TF, SEN(chown), "lchown" }, -[5093] = { 1, 0, SEN(umask), "umask" }, +[5093] = { 1, NF, SEN(umask), "umask" }, [5094] = { 2, 0, SEN(gettimeofday), "gettimeofday" }, [5095] = { 2, 0, SEN(getrlimit), "getrlimit" }, [5096] = { 2, 0, SEN(getrusage), "getrusage" }, diff --git a/linux/mips/syscallent-o32.h b/linux/mips/syscallent-o32.h index 286b4e71..54d31653 100644 --- a/linux/mips/syscallent-o32.h +++ b/linux/mips/syscallent-o32.h @@ -60,7 +60,7 @@ [4057] = { 2, 0, SEN(setpgid), "setpgid" }, [4058] = { 0, 0, SEN(ulimit), "ulimit" }, [4059] = { 1, 0, SEN(oldolduname), "oldolduname" }, -[4060] = { 1, 0, SEN(umask), "umask" }, +[4060] = { 1, NF, SEN(umask), "umask" }, [4061] = { 1, TF, SEN(chroot), "chroot" }, [4062] = { 2, 0, SEN(ustat), "ustat" }, [4063] = { 2, TD, SEN(dup2), "dup2" }, diff --git a/linux/powerpc/syscallent.h b/linux/powerpc/syscallent.h index f641fed5..c94b3b1b 100644 --- a/linux/powerpc/syscallent.h +++ b/linux/powerpc/syscallent.h @@ -86,7 +86,7 @@ [ 57] = { 2, 0, SEN(setpgid), "setpgid" }, [ 58] = { 2, 0, SEN(ulimit), "ulimit" }, [ 59] = { 1, 0, SEN(oldolduname), "oldolduname" }, -[ 60] = { 1, 0, SEN(umask), "umask" }, +[ 60] = { 1, NF, SEN(umask), "umask" }, [ 61] = { 1, TF, SEN(chroot), "chroot" }, [ 62] = { 2, 0, SEN(ustat), "ustat" }, [ 63] = { 2, TD, SEN(dup2), "dup2" }, diff --git a/linux/powerpc64/syscallent.h b/linux/powerpc64/syscallent.h index 3e58ec28..e2ecbad8 100644 --- a/linux/powerpc64/syscallent.h +++ b/linux/powerpc64/syscallent.h @@ -86,7 +86,7 @@ [ 57] = { 2, 0, SEN(setpgid), "setpgid" }, [ 58] = { 2, 0, SEN(ulimit), "ulimit" }, [ 59] = { 1, 0, SEN(oldolduname), "oldolduname" }, -[ 60] = { 1, 0, SEN(umask), "umask" }, +[ 60] = { 1, NF, SEN(umask), "umask" }, [ 61] = { 1, TF, SEN(chroot), "chroot" }, [ 62] = { 2, 0, SEN(ustat), "ustat" }, [ 63] = { 2, TD, SEN(dup2), "dup2" }, diff --git a/linux/s390/syscallent.h b/linux/s390/syscallent.h index cb2d7877..7f752d2c 100644 --- a/linux/s390/syscallent.h +++ b/linux/s390/syscallent.h @@ -88,7 +88,7 @@ [ 57] = { 2, 0, SEN(setpgid), "setpgid" }, [ 58] = { }, [ 59] = { }, -[ 60] = { 1, 0, SEN(umask), "umask" }, +[ 60] = { 1, NF, SEN(umask), "umask" }, [ 61] = { 1, TF, SEN(chroot), "chroot" }, [ 62] = { 2, 0, SEN(ustat), "ustat" }, [ 63] = { 2, TD, SEN(dup2), "dup2" }, diff --git a/linux/s390x/syscallent.h b/linux/s390x/syscallent.h index c332520c..22e1e863 100644 --- a/linux/s390x/syscallent.h +++ b/linux/s390x/syscallent.h @@ -87,7 +87,7 @@ [ 57] = { 2, 0, SEN(setpgid), "setpgid" }, [ 58] = { }, [ 59] = { }, -[ 60] = { 1, 0, SEN(umask), "umask" }, +[ 60] = { 1, NF, SEN(umask), "umask" }, [ 61] = { 1, TF, SEN(chroot), "chroot" }, [ 62] = { 2, 0, SEN(ustat), "ustat" }, [ 63] = { 2, TD, SEN(dup2), "dup2" }, diff --git a/linux/sh/syscallent.h b/linux/sh/syscallent.h index 7fd840dd..06ad024a 100644 --- a/linux/sh/syscallent.h +++ b/linux/sh/syscallent.h @@ -88,7 +88,7 @@ [ 57] = { 2, 0, SEN(setpgid), "setpgid" }, [ 58] = { 2, 0, SEN(ulimit), "ulimit" }, [ 59] = { 1, 0, SEN(oldolduname), "oldolduname" }, -[ 60] = { 1, 0, SEN(umask), "umask" }, +[ 60] = { 1, NF, SEN(umask), "umask" }, [ 61] = { 1, TF, SEN(chroot), "chroot" }, [ 62] = { 2, 0, SEN(ustat), "ustat" }, [ 63] = { 2, TD, SEN(dup2), "dup2" }, diff --git a/linux/sh64/syscallent.h b/linux/sh64/syscallent.h index 1ccdcada..2d2c70b6 100644 --- a/linux/sh64/syscallent.h +++ b/linux/sh64/syscallent.h @@ -86,7 +86,7 @@ [ 57] = { 2, 0, SEN(setpgid), "setpgid" }, [ 58] = { 2, 0, SEN(ulimit), "ulimit" }, [ 59] = { 1, 0, SEN(oldolduname), "oldolduname" }, -[ 60] = { 1, 0, SEN(umask), "umask" }, +[ 60] = { 1, NF, SEN(umask), "umask" }, [ 61] = { 1, TF, SEN(chroot), "chroot" }, [ 62] = { 2, 0, SEN(ustat), "ustat" }, [ 63] = { 2, TD, SEN(dup2), "dup2" }, diff --git a/linux/sparc/syscallent.h b/linux/sparc/syscallent.h index c1e4e207..9fe29448 100644 --- a/linux/sparc/syscallent.h +++ b/linux/sparc/syscallent.h @@ -58,7 +58,7 @@ [ 57] = { 2, TF, SEN(symlink), "symlink" }, [ 58] = { 3, TF, SEN(readlink), "readlink" }, [ 59] = { 3, TF|TP|SE|SI, SEN(execve), "execve" }, -[ 60] = { 1, 0, SEN(umask), "umask" }, +[ 60] = { 1, NF, SEN(umask), "umask" }, [ 61] = { 1, TF, SEN(chroot), "chroot" }, [ 62] = { 2, TD, SEN(fstat), "fstat" }, [ 63] = { 2, TD, SEN(fstat64), "fstat64" }, diff --git a/linux/x32/syscallent.h b/linux/x32/syscallent.h index da142861..062488dc 100644 --- a/linux/x32/syscallent.h +++ b/linux/x32/syscallent.h @@ -93,7 +93,7 @@ [ 92] = { 3, TF, SEN(chown), "chown" }, [ 93] = { 3, TD, SEN(fchown), "fchown" }, [ 94] = { 3, TF, SEN(chown), "lchown" }, -[ 95] = { 1, 0, SEN(umask), "umask" }, +[ 95] = { 1, NF, SEN(umask), "umask" }, [ 96] = { 2, 0, SEN(gettimeofday), "gettimeofday" }, [ 97] = { 2, 0, SEN(getrlimit), "getrlimit" }, [ 98] = { 2, 0, SEN(getrusage), "getrusage" }, diff --git a/linux/x86_64/syscallent.h b/linux/x86_64/syscallent.h index 0b3ed41d..fc77528b 100644 --- a/linux/x86_64/syscallent.h +++ b/linux/x86_64/syscallent.h @@ -93,7 +93,7 @@ [ 92] = { 3, TF, SEN(chown), "chown" }, [ 93] = { 3, TD, SEN(fchown), "fchown" }, [ 94] = { 3, TF, SEN(chown), "lchown" }, -[ 95] = { 1, 0, SEN(umask), "umask" }, +[ 95] = { 1, NF, SEN(umask), "umask" }, [ 96] = { 2, 0, SEN(gettimeofday), "gettimeofday" }, [ 97] = { 2, 0, SEN(getrlimit), "getrlimit" }, [ 98] = { 2, 0, SEN(getrusage), "getrusage" }, diff --git a/linux/xtensa/syscallent.h b/linux/xtensa/syscallent.h index 4c553ee8..46a457d9 100644 --- a/linux/xtensa/syscallent.h +++ b/linux/xtensa/syscallent.h @@ -51,7 +51,7 @@ [ 55] = { 2, TD, SEN(fstat64), "fstat64" }, [ 56] = { 2, TD, SEN(flock), "flock" }, [ 57] = { 2, TF, SEN(access), "access" }, -[ 58] = { 1, 0, SEN(umask), "umask" }, +[ 58] = { 1, NF, SEN(umask), "umask" }, [ 59] = { 3, TD, SEN(getdents), "getdents" }, [ 60] = { 3, TD, SEN(getdents64), "getdents64" }, [ 61] = { 3, TD, SEN(fcntl64), "fcntl64" }, -- 2.40.0