]> granicus.if.org Git - strace/commitdiff
prctl: finish decoding of several commands on entering syscall
authorDmitry V. Levin <ldv@altlinux.org>
Sun, 6 Dec 2015 15:29:04 +0000 (15:29 +0000)
committerDmitry V. Levin <ldv@altlinux.org>
Sun, 6 Dec 2015 15:29:04 +0000 (15:29 +0000)
* prctl.c (SYS_FUNC(prctl)): Return RVAL_DECODED after decoding of
PR_GET_DUMPABLE, PR_GET_KEEPCAPS, PR_GET_SECCOMP, PR_GET_TIMERSLACK,
PR_GET_TIMING, and PR_CAPBSET_READ commands.

prctl.c

diff --git a/prctl.c b/prctl.c
index cfd117f1de0cf815d8476ddfdfbc03cdbeb36334..23c012251fc862e91fcbf316bd8f5a26a30b0396 100644 (file)
--- a/prctl.c
+++ b/prctl.c
@@ -53,9 +53,7 @@ SYS_FUNC(prctl)
        case PR_GET_SECCOMP:
        case PR_GET_TIMERSLACK:
        case PR_GET_TIMING:
-               if (entering(tcp))
-                       break;
-               return syserror(tcp) ? 0 : RVAL_UDECIMAL;
+               return RVAL_DECODED;
 
        case PR_GET_CHILD_SUBREAPER:
        case PR_GET_ENDIAN:
@@ -139,18 +137,11 @@ SYS_FUNC(prctl)
                return RVAL_DECODED;
 
        case PR_CAPBSET_DROP:
+       case PR_CAPBSET_READ:
                tprints(", ");
                printxval(cap, tcp->u_arg[1], "CAP_???");
                return RVAL_DECODED;
 
-       case PR_CAPBSET_READ:
-               if (entering(tcp)) {
-                       tprints(", ");
-                       printxval(cap, tcp->u_arg[1], "CAP_???");
-                       break;
-               }
-               return syserror(tcp) ? 0 : RVAL_UDECIMAL;
-
        case PR_MCE_KILL:
                tprints(", ");
                printxval(pr_mce_kill, tcp->u_arg[1], "PR_MCE_KILL_???");
@@ -250,14 +241,6 @@ SYS_FUNC(prctl)
                print_prctl_args(tcp, 2);
                return RVAL_DECODED;
 
-       case PR_GET_NO_NEW_PRIVS:
-       case PR_GET_THP_DISABLE:
-               if (entering(tcp)) {
-                       print_prctl_args(tcp, 1);
-                       return 0;
-               }
-               return syserror(tcp) ? 0 : RVAL_UDECIMAL;
-
        case PR_MCE_KILL_GET:
                if (entering(tcp)) {
                        print_prctl_args(tcp, 1);
@@ -268,6 +251,8 @@ SYS_FUNC(prctl)
                tcp->auxstr = xlookup(pr_mce_kill_policy, tcp->u_rval);
                return tcp->auxstr ? RVAL_STR : RVAL_UDECIMAL;
 
+       case PR_GET_NO_NEW_PRIVS:
+       case PR_GET_THP_DISABLE:
        case PR_MPX_DISABLE_MANAGEMENT:
        case PR_MPX_ENABLE_MANAGEMENT:
        default: