2015-12-17 17:56:48 +00:00
/*
* Copyright ( c ) 1994 - 1996 Rick Sladkey < jrs @ world . std . com >
* Copyright ( c ) 1996 - 2000 Wichert Akkerman < wichert @ cistron . nl >
* Copyright ( c ) 2005 - 2007 Roland McGrath < roland @ redhat . com >
* Copyright ( c ) 2008 - 2015 Dmitry V . Levin < ldv @ altlinux . org >
* All rights reserved .
*
* Redistribution and use in source and binary forms , with or without
* modification , are permitted provided that the following conditions
* are met :
* 1. Redistributions of source code must retain the above copyright
* notice , this list of conditions and the following disclaimer .
* 2. Redistributions in binary form must reproduce the above copyright
* notice , this list of conditions and the following disclaimer in the
* documentation and / or other materials provided with the distribution .
* 3. The name of the author may not be used to endorse or promote products
* derived from this software without specific prior written permission .
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ` ` AS IS ' ' AND ANY EXPRESS OR
* IMPLIED WARRANTIES , INCLUDING , BUT NOT LIMITED TO , THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED .
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT , INDIRECT ,
* INCIDENTAL , SPECIAL , EXEMPLARY , OR CONSEQUENTIAL DAMAGES ( INCLUDING , BUT
* NOT LIMITED TO , PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES ; LOSS OF USE ,
* DATA , OR PROFITS ; OR BUSINESS INTERRUPTION ) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY , WHETHER IN CONTRACT , STRICT LIABILITY , OR TORT
* ( INCLUDING NEGLIGENCE OR OTHERWISE ) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE , EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE .
*/
2014-12-11 19:25:02 +00:00
# include "defs.h"
2016-11-20 02:00:35 +00:00
# include <linux/prctl.h>
2014-12-11 19:25:02 +00:00
# include "xlat/prctl_options.h"
2015-12-06 15:33:53 +00:00
# include "xlat/pr_cap_ambient.h"
2016-12-06 22:14:48 +03:00
# include "xlat/pr_dumpable.h"
2016-11-19 23:10:01 +03:00
# include "xlat/pr_fp_mode.h"
2015-02-14 01:51:03 +00:00
# include "xlat/pr_mce_kill.h"
# include "xlat/pr_mce_kill_policy.h"
# include "xlat/pr_set_mm.h"
# include "xlat/pr_tsc.h"
2015-12-06 15:33:53 +00:00
# include "xlat/pr_unalign_flags.h"
2014-12-11 19:25:02 +00:00
2015-02-14 01:51:03 +00:00
# ifndef TASK_COMM_LEN
# define TASK_COMM_LEN 16
2014-12-11 19:25:02 +00:00
# endif
2015-02-04 23:50:50 +00:00
# ifdef HAVE_LINUX_SECCOMP_H
# include <linux / seccomp.h>
# endif
# include "xlat/seccomp_mode.h"
2015-02-14 01:51:03 +00:00
# ifdef HAVE_LINUX_SECUREBITS_H
# include <linux / securebits.h>
# endif
# include "xlat/secbits.h"
/* these constants are the same as in <linux/capability.h> */
enum {
# include "caps0.h"
# include "caps1.h"
} ;
# include "xlat/cap.h"
2015-07-25 09:43:01 +00:00
static void
print_prctl_args ( struct tcb * tcp , const unsigned int first )
{
unsigned int i ;
for ( i = first ; i < tcp - > s_ent - > nargs ; + + i )
2016-12-26 05:28:04 +03:00
tprintf ( " , %# " PRI_klx , tcp - > u_arg [ i ] ) ;
2015-07-25 09:43:01 +00:00
}
2015-07-17 21:49:17 +00:00
SYS_FUNC ( prctl )
2014-12-11 19:25:02 +00:00
{
2016-05-16 22:19:31 +00:00
const unsigned int option = tcp - > u_arg [ 0 ] ;
2016-12-26 05:28:04 +03:00
const kernel_ulong_t arg2 = tcp - > u_arg [ 1 ] ;
const kernel_ulong_t arg3 = tcp - > u_arg [ 2 ] ;
2016-11-18 20:25:13 +03:00
/*
* PR_SET_VMA is the only command which actually uses these arguments
* currently , and it is available only on Android for now .
*/
# ifdef __ANDROID__
2016-12-26 05:28:04 +03:00
const kernel_ulong_t arg4 = tcp - > u_arg [ 3 ] ;
const kernel_ulong_t arg5 = tcp - > u_arg [ 4 ] ;
2016-11-18 20:25:13 +03:00
# endif
2014-12-11 19:25:02 +00:00
unsigned int i ;
2015-07-17 21:49:17 +00:00
if ( entering ( tcp ) )
2016-05-16 22:19:31 +00:00
printxval ( prctl_options , option , " PR_??? " ) ;
2015-02-14 01:51:03 +00:00
2016-05-16 22:19:31 +00:00
switch ( option ) {
2015-07-17 21:49:17 +00:00
case PR_GET_KEEPCAPS :
case PR_GET_SECCOMP :
case PR_GET_TIMERSLACK :
case PR_GET_TIMING :
2015-12-06 15:29:04 +00:00
return RVAL_DECODED ;
2015-07-17 21:49:17 +00:00
case PR_GET_CHILD_SUBREAPER :
2015-02-14 01:51:03 +00:00
case PR_GET_ENDIAN :
case PR_GET_FPEMU :
case PR_GET_FPEXC :
2015-07-17 21:49:17 +00:00
if ( entering ( tcp ) )
tprints ( " , " ) ;
else
2016-11-18 20:25:13 +03:00
printnum_int ( tcp , arg2 , " %u " ) ;
2015-07-17 21:49:17 +00:00
break ;
2016-12-06 22:14:48 +03:00
case PR_GET_DUMPABLE :
if ( entering ( tcp ) )
break ;
if ( syserror ( tcp ) )
return 0 ;
2016-12-26 10:26:03 +00:00
tcp - > auxstr = xlookup ( pr_dumpable , ( kernel_ulong_t ) tcp - > u_rval ) ;
2016-12-06 22:14:48 +03:00
return RVAL_STR ;
2015-02-14 01:51:03 +00:00
case PR_GET_NAME :
2016-11-18 21:00:02 +03:00
if ( entering ( tcp ) ) {
2015-07-17 21:49:17 +00:00
tprints ( " , " ) ;
2016-11-18 21:00:02 +03:00
} else {
2015-07-17 21:49:17 +00:00
if ( syserror ( tcp ) )
2016-11-18 20:25:13 +03:00
printaddr ( arg2 ) ;
2015-07-17 21:49:17 +00:00
else
2016-11-18 20:25:13 +03:00
printstr_ex ( tcp , arg2 , TASK_COMM_LEN ,
2016-11-20 00:38:34 +00:00
QUOTE_0_TERMINATED ) ;
2015-07-17 21:49:17 +00:00
}
break ;
2015-02-14 01:51:03 +00:00
case PR_GET_PDEATHSIG :
2016-11-18 21:00:02 +03:00
if ( entering ( tcp ) ) {
2015-07-17 21:49:17 +00:00
tprints ( " , " ) ;
2016-11-18 21:00:02 +03:00
} else if ( ! umove_or_printaddr ( tcp , arg2 , & i ) ) {
2015-07-17 21:49:17 +00:00
tprints ( " [ " ) ;
tprints ( signame ( i ) ) ;
tprints ( " ] " ) ;
}
break ;
2015-02-14 01:51:03 +00:00
case PR_GET_SECUREBITS :
2015-07-17 21:49:17 +00:00
if ( entering ( tcp ) )
break ;
if ( syserror ( tcp ) | | tcp - > u_rval = = 0 )
return 0 ;
2016-05-15 14:23:06 +00:00
tcp - > auxstr = sprintflags ( " " , secbits ,
2016-12-26 10:26:03 +00:00
( kernel_ulong_t ) tcp - > u_rval ) ;
2015-07-17 21:49:17 +00:00
return RVAL_STR ;
2015-02-14 01:51:03 +00:00
case PR_GET_TID_ADDRESS :
2015-07-17 21:49:17 +00:00
if ( entering ( tcp ) )
tprints ( " , " ) ;
else
2016-12-12 00:12:27 +03:00
printnum_kptr ( tcp , arg2 ) ;
2015-07-17 21:49:17 +00:00
break ;
2015-02-14 01:51:03 +00:00
case PR_GET_TSC :
2016-11-18 21:00:02 +03:00
if ( entering ( tcp ) ) {
2015-07-17 21:49:17 +00:00
tprints ( " , " ) ;
2016-11-18 21:00:02 +03:00
} else if ( ! umove_or_printaddr ( tcp , arg2 , & i ) ) {
2015-07-17 21:49:17 +00:00
tprints ( " [ " ) ;
printxval ( pr_tsc , i , " PR_TSC_??? " ) ;
tprints ( " ] " ) ;
}
break ;
2015-02-14 01:51:03 +00:00
case PR_GET_UNALIGN :
2016-11-18 21:00:02 +03:00
if ( entering ( tcp ) ) {
2015-07-17 21:49:17 +00:00
tprints ( " , " ) ;
2016-11-18 21:00:02 +03:00
} else if ( ! umove_or_printaddr ( tcp , arg2 , & i ) ) {
2015-07-17 21:49:17 +00:00
tprints ( " [ " ) ;
printflags ( pr_unalign_flags , i , " PR_UNALIGN_??? " ) ;
tprints ( " ] " ) ;
}
break ;
2016-11-19 23:10:01 +03:00
case PR_GET_FP_MODE :
if ( entering ( tcp ) )
break ;
if ( syserror ( tcp ) | | tcp - > u_rval = = 0 )
return 0 ;
tcp - > auxstr = sprintflags ( " " , pr_fp_mode ,
2016-12-26 10:26:03 +00:00
( kernel_ulong_t ) tcp - > u_rval ) ;
2016-11-19 23:10:01 +03:00
return RVAL_STR ;
2015-07-17 21:49:17 +00:00
/* PR_TASK_PERF_EVENTS_* take no arguments. */
2015-02-14 01:51:03 +00:00
case PR_TASK_PERF_EVENTS_DISABLE :
case PR_TASK_PERF_EVENTS_ENABLE :
2015-07-17 21:49:17 +00:00
return RVAL_DECODED ;
2015-02-04 23:50:50 +00:00
2015-02-14 01:51:03 +00:00
case PR_SET_CHILD_SUBREAPER :
case PR_SET_ENDIAN :
case PR_SET_FPEMU :
case PR_SET_FPEXC :
case PR_SET_KEEPCAPS :
case PR_SET_TIMING :
Use kernel_ulong_t instead of unsigned long long where appropriate
* defs.h (printaddr_ull): Rename to printaddr_klu, change argument
type from unsigned long long to kernel_ulong_t. All callers updated.
(getarg_ull): Rename to getarg_klu, change return value type
from unsigned long long to kernel_ulong_t. All callers updated.
(PRI_kl, PRI_kld, PRI_klu, PRI_klx): New macros.
* bjm.c (SYS_FUNC(init_module)): Print kernel_ulong_t type using
PRI_klu format.
* desc.c (SYS_FUNC(pselect6)): Likewise.
* fadvise.c (SYS_FUNC(fadvise64)): Likewise.
* lookup_dcookie.c (SYS_FUNC(lookup_dcookie)): Likewise.
* mq.c (SYS_FUNC(mq_timedsend), SYS_FUNC(mq_timedreceive)): Likewise.
* kcmp.c (SYS_FUNC(kcmp)): Print kernel_ulong_t type using
PRI_klx format.
* keyctl.c (SYS_FUNC(keyctl)): Likewise.
* pkeys.c (SYS_FUNC(pkey_alloc)): Likewise.
* prctl.c (print_prctl_args, SYS_FUNC(prctl), SYS_FUNC(arch_prctl)):
Print kernel_ulong_t type using PRI_kld, PRI_klu, or PRI_klx format.
* util.c (printaddr_ull): Rename to printaddr_klu, change argument
type from unsigned long long to kernel_ulong_t, print it using
PRI_klx format.
(getarg_ull): Rename to getarg_klu, change return value type
from unsigned long long to kernel_ulong_t, print it using
PRI_klx format.
2016-12-19 16:56:45 +00:00
tprintf ( " , % " PRI_klu , arg2 ) ;
2015-07-17 21:49:17 +00:00
return RVAL_DECODED ;
2015-02-14 01:51:03 +00:00
2016-12-06 22:14:48 +03:00
case PR_SET_DUMPABLE :
tprints ( " , " ) ;
printxval64 ( pr_dumpable , arg2 , " SUID_DUMP_??? " ) ;
return RVAL_DECODED ;
2015-02-14 01:51:03 +00:00
case PR_CAPBSET_DROP :
2015-12-06 15:29:04 +00:00
case PR_CAPBSET_READ :
2015-02-14 01:51:03 +00:00
tprints ( " , " ) ;
2016-11-18 20:25:13 +03:00
printxval64 ( cap , arg2 , " CAP_??? " ) ;
2015-07-17 21:49:17 +00:00
return RVAL_DECODED ;
2015-12-06 15:33:53 +00:00
case PR_CAP_AMBIENT :
tprints ( " , " ) ;
2016-11-18 20:25:13 +03:00
printxval64 ( pr_cap_ambient , arg2 ,
2016-05-16 23:22:11 +00:00
" PR_CAP_AMBIENT_??? " ) ;
2016-11-18 20:25:13 +03:00
switch ( arg2 ) {
2015-12-06 15:33:53 +00:00
case PR_CAP_AMBIENT_RAISE :
case PR_CAP_AMBIENT_LOWER :
case PR_CAP_AMBIENT_IS_SET :
tprints ( " , " ) ;
2016-11-18 20:25:13 +03:00
printxval64 ( cap , arg3 , " CAP_??? " ) ;
2015-12-06 15:33:53 +00:00
print_prctl_args ( tcp , 3 ) ;
break ;
default :
print_prctl_args ( tcp , 2 ) ;
break ;
}
return RVAL_DECODED ;
2015-02-14 01:51:03 +00:00
case PR_MCE_KILL :
tprints ( " , " ) ;
2016-11-18 20:25:13 +03:00
printxval64 ( pr_mce_kill , arg2 , " PR_MCE_KILL_??? " ) ;
2015-02-14 01:51:03 +00:00
tprints ( " , " ) ;
2016-11-18 20:25:13 +03:00
if ( PR_MCE_KILL_SET = = arg2 )
printxval64 ( pr_mce_kill_policy , arg3 ,
" PR_MCE_KILL_??? " ) ;
2015-02-14 01:51:03 +00:00
else
Use kernel_ulong_t instead of unsigned long long where appropriate
* defs.h (printaddr_ull): Rename to printaddr_klu, change argument
type from unsigned long long to kernel_ulong_t. All callers updated.
(getarg_ull): Rename to getarg_klu, change return value type
from unsigned long long to kernel_ulong_t. All callers updated.
(PRI_kl, PRI_kld, PRI_klu, PRI_klx): New macros.
* bjm.c (SYS_FUNC(init_module)): Print kernel_ulong_t type using
PRI_klu format.
* desc.c (SYS_FUNC(pselect6)): Likewise.
* fadvise.c (SYS_FUNC(fadvise64)): Likewise.
* lookup_dcookie.c (SYS_FUNC(lookup_dcookie)): Likewise.
* mq.c (SYS_FUNC(mq_timedsend), SYS_FUNC(mq_timedreceive)): Likewise.
* kcmp.c (SYS_FUNC(kcmp)): Print kernel_ulong_t type using
PRI_klx format.
* keyctl.c (SYS_FUNC(keyctl)): Likewise.
* pkeys.c (SYS_FUNC(pkey_alloc)): Likewise.
* prctl.c (print_prctl_args, SYS_FUNC(prctl), SYS_FUNC(arch_prctl)):
Print kernel_ulong_t type using PRI_kld, PRI_klu, or PRI_klx format.
* util.c (printaddr_ull): Rename to printaddr_klu, change argument
type from unsigned long long to kernel_ulong_t, print it using
PRI_klx format.
(getarg_ull): Rename to getarg_klu, change return value type
from unsigned long long to kernel_ulong_t, print it using
PRI_klx format.
2016-12-19 16:56:45 +00:00
tprintf ( " %# " PRI_klx , arg3 ) ;
2015-07-25 09:43:01 +00:00
print_prctl_args ( tcp , 3 ) ;
2015-07-17 21:49:17 +00:00
return RVAL_DECODED ;
2015-02-14 01:51:03 +00:00
case PR_SET_NAME :
tprints ( " , " ) ;
2016-11-18 20:25:13 +03:00
printstr_ex ( tcp , arg2 , TASK_COMM_LEN - 1 ,
2016-11-20 00:38:34 +00:00
QUOTE_0_TERMINATED ) ;
2015-07-17 21:49:17 +00:00
return RVAL_DECODED ;
2015-02-14 01:51:03 +00:00
2015-07-29 22:49:38 +00:00
# ifdef __ANDROID__
# ifndef PR_SET_VMA_ANON_NAME
# define PR_SET_VMA_ANON_NAME 0
# endif
case PR_SET_VMA :
2016-11-18 20:25:13 +03:00
if ( arg2 = = PR_SET_VMA_ANON_NAME ) {
Use kernel_ulong_t instead of unsigned long long where appropriate
* defs.h (printaddr_ull): Rename to printaddr_klu, change argument
type from unsigned long long to kernel_ulong_t. All callers updated.
(getarg_ull): Rename to getarg_klu, change return value type
from unsigned long long to kernel_ulong_t. All callers updated.
(PRI_kl, PRI_kld, PRI_klu, PRI_klx): New macros.
* bjm.c (SYS_FUNC(init_module)): Print kernel_ulong_t type using
PRI_klu format.
* desc.c (SYS_FUNC(pselect6)): Likewise.
* fadvise.c (SYS_FUNC(fadvise64)): Likewise.
* lookup_dcookie.c (SYS_FUNC(lookup_dcookie)): Likewise.
* mq.c (SYS_FUNC(mq_timedsend), SYS_FUNC(mq_timedreceive)): Likewise.
* kcmp.c (SYS_FUNC(kcmp)): Print kernel_ulong_t type using
PRI_klx format.
* keyctl.c (SYS_FUNC(keyctl)): Likewise.
* pkeys.c (SYS_FUNC(pkey_alloc)): Likewise.
* prctl.c (print_prctl_args, SYS_FUNC(prctl), SYS_FUNC(arch_prctl)):
Print kernel_ulong_t type using PRI_kld, PRI_klu, or PRI_klx format.
* util.c (printaddr_ull): Rename to printaddr_klu, change argument
type from unsigned long long to kernel_ulong_t, print it using
PRI_klx format.
(getarg_ull): Rename to getarg_klu, change return value type
from unsigned long long to kernel_ulong_t, print it using
PRI_klx format.
2016-12-19 16:56:45 +00:00
tprintf ( " , PR_SET_VMA_ANON_NAME, %# " PRI_klx , arg3 ) ;
tprintf ( " , % " PRI_klu " , " , arg4 ) ;
2016-12-20 16:43:26 +00:00
printstr ( tcp , arg5 ) ;
2015-07-29 22:49:38 +00:00
} else {
/* There are no other sub-options now, but there
* might be in future . . . */
print_prctl_args ( tcp , 1 ) ;
}
return RVAL_DECODED ;
# endif
2015-02-14 01:51:03 +00:00
case PR_SET_MM :
tprints ( " , " ) ;
2016-11-18 20:25:13 +03:00
printxval ( pr_set_mm , arg2 , " PR_SET_MM_??? " ) ;
2015-07-25 09:43:01 +00:00
print_prctl_args ( tcp , 2 ) ;
2015-07-17 21:49:17 +00:00
return RVAL_DECODED ;
2015-02-14 01:51:03 +00:00
case PR_SET_PDEATHSIG :
tprints ( " , " ) ;
2016-11-18 20:25:13 +03:00
if ( arg2 > 128 )
Use kernel_ulong_t instead of unsigned long long where appropriate
* defs.h (printaddr_ull): Rename to printaddr_klu, change argument
type from unsigned long long to kernel_ulong_t. All callers updated.
(getarg_ull): Rename to getarg_klu, change return value type
from unsigned long long to kernel_ulong_t. All callers updated.
(PRI_kl, PRI_kld, PRI_klu, PRI_klx): New macros.
* bjm.c (SYS_FUNC(init_module)): Print kernel_ulong_t type using
PRI_klu format.
* desc.c (SYS_FUNC(pselect6)): Likewise.
* fadvise.c (SYS_FUNC(fadvise64)): Likewise.
* lookup_dcookie.c (SYS_FUNC(lookup_dcookie)): Likewise.
* mq.c (SYS_FUNC(mq_timedsend), SYS_FUNC(mq_timedreceive)): Likewise.
* kcmp.c (SYS_FUNC(kcmp)): Print kernel_ulong_t type using
PRI_klx format.
* keyctl.c (SYS_FUNC(keyctl)): Likewise.
* pkeys.c (SYS_FUNC(pkey_alloc)): Likewise.
* prctl.c (print_prctl_args, SYS_FUNC(prctl), SYS_FUNC(arch_prctl)):
Print kernel_ulong_t type using PRI_kld, PRI_klu, or PRI_klx format.
* util.c (printaddr_ull): Rename to printaddr_klu, change argument
type from unsigned long long to kernel_ulong_t, print it using
PRI_klx format.
(getarg_ull): Rename to getarg_klu, change return value type
from unsigned long long to kernel_ulong_t, print it using
PRI_klx format.
2016-12-19 16:56:45 +00:00
tprintf ( " % " PRI_klu , arg2 ) ;
2015-02-14 01:51:03 +00:00
else
2016-11-18 20:25:13 +03:00
tprints ( signame ( arg2 ) ) ;
2015-07-17 21:49:17 +00:00
return RVAL_DECODED ;
2015-02-14 01:51:03 +00:00
case PR_SET_PTRACER :
tprints ( " , " ) ;
2016-11-18 20:36:21 +03:00
if ( ( int ) arg2 = = - 1 )
2015-02-14 01:51:03 +00:00
tprints ( " PR_SET_PTRACER_ANY " ) ;
else
Use kernel_ulong_t instead of unsigned long long where appropriate
* defs.h (printaddr_ull): Rename to printaddr_klu, change argument
type from unsigned long long to kernel_ulong_t. All callers updated.
(getarg_ull): Rename to getarg_klu, change return value type
from unsigned long long to kernel_ulong_t. All callers updated.
(PRI_kl, PRI_kld, PRI_klu, PRI_klx): New macros.
* bjm.c (SYS_FUNC(init_module)): Print kernel_ulong_t type using
PRI_klu format.
* desc.c (SYS_FUNC(pselect6)): Likewise.
* fadvise.c (SYS_FUNC(fadvise64)): Likewise.
* lookup_dcookie.c (SYS_FUNC(lookup_dcookie)): Likewise.
* mq.c (SYS_FUNC(mq_timedsend), SYS_FUNC(mq_timedreceive)): Likewise.
* kcmp.c (SYS_FUNC(kcmp)): Print kernel_ulong_t type using
PRI_klx format.
* keyctl.c (SYS_FUNC(keyctl)): Likewise.
* pkeys.c (SYS_FUNC(pkey_alloc)): Likewise.
* prctl.c (print_prctl_args, SYS_FUNC(prctl), SYS_FUNC(arch_prctl)):
Print kernel_ulong_t type using PRI_kld, PRI_klu, or PRI_klx format.
* util.c (printaddr_ull): Rename to printaddr_klu, change argument
type from unsigned long long to kernel_ulong_t, print it using
PRI_klx format.
(getarg_ull): Rename to getarg_klu, change return value type
from unsigned long long to kernel_ulong_t, print it using
PRI_klx format.
2016-12-19 16:56:45 +00:00
tprintf ( " % " PRI_klu , arg2 ) ;
2015-07-17 21:49:17 +00:00
return RVAL_DECODED ;
2015-02-14 01:51:03 +00:00
case PR_SET_SECCOMP :
tprints ( " , " ) ;
2016-11-18 20:25:13 +03:00
printxval64 ( seccomp_mode , arg2 ,
" SECCOMP_MODE_??? " ) ;
if ( SECCOMP_MODE_STRICT = = arg2 )
2015-07-17 21:49:17 +00:00
return RVAL_DECODED ;
2016-11-18 20:25:13 +03:00
if ( SECCOMP_MODE_FILTER = = arg2 ) {
2015-02-04 23:50:50 +00:00
tprints ( " , " ) ;
2016-11-18 20:25:13 +03:00
print_seccomp_filter ( tcp , arg3 ) ;
2015-07-17 21:49:17 +00:00
return RVAL_DECODED ;
2015-02-14 01:51:03 +00:00
}
2015-07-25 09:43:01 +00:00
print_prctl_args ( tcp , 2 ) ;
2015-07-17 21:49:17 +00:00
return RVAL_DECODED ;
2015-02-04 23:50:50 +00:00
2015-02-14 01:51:03 +00:00
case PR_SET_SECUREBITS :
tprints ( " , " ) ;
2016-11-18 20:25:13 +03:00
printflags64 ( secbits , arg2 , " SECBIT_??? " ) ;
2015-07-17 21:49:17 +00:00
return RVAL_DECODED ;
2015-02-14 01:51:03 +00:00
case PR_SET_TIMERSLACK :
Use kernel_ulong_t instead of unsigned long long where appropriate
* defs.h (printaddr_ull): Rename to printaddr_klu, change argument
type from unsigned long long to kernel_ulong_t. All callers updated.
(getarg_ull): Rename to getarg_klu, change return value type
from unsigned long long to kernel_ulong_t. All callers updated.
(PRI_kl, PRI_kld, PRI_klu, PRI_klx): New macros.
* bjm.c (SYS_FUNC(init_module)): Print kernel_ulong_t type using
PRI_klu format.
* desc.c (SYS_FUNC(pselect6)): Likewise.
* fadvise.c (SYS_FUNC(fadvise64)): Likewise.
* lookup_dcookie.c (SYS_FUNC(lookup_dcookie)): Likewise.
* mq.c (SYS_FUNC(mq_timedsend), SYS_FUNC(mq_timedreceive)): Likewise.
* kcmp.c (SYS_FUNC(kcmp)): Print kernel_ulong_t type using
PRI_klx format.
* keyctl.c (SYS_FUNC(keyctl)): Likewise.
* pkeys.c (SYS_FUNC(pkey_alloc)): Likewise.
* prctl.c (print_prctl_args, SYS_FUNC(prctl), SYS_FUNC(arch_prctl)):
Print kernel_ulong_t type using PRI_kld, PRI_klu, or PRI_klx format.
* util.c (printaddr_ull): Rename to printaddr_klu, change argument
type from unsigned long long to kernel_ulong_t, print it using
PRI_klx format.
(getarg_ull): Rename to getarg_klu, change return value type
from unsigned long long to kernel_ulong_t, print it using
PRI_klx format.
2016-12-19 16:56:45 +00:00
tprintf ( " , % " PRI_kld , arg2 ) ;
2015-07-17 21:49:17 +00:00
return RVAL_DECODED ;
2015-02-14 01:51:03 +00:00
case PR_SET_TSC :
tprints ( " , " ) ;
2016-11-18 20:25:13 +03:00
printxval ( pr_tsc , arg2 , " PR_TSC_??? " ) ;
2015-07-17 21:49:17 +00:00
return RVAL_DECODED ;
2015-02-14 01:51:03 +00:00
case PR_SET_UNALIGN :
tprints ( " , " ) ;
2016-11-18 20:25:13 +03:00
printflags ( pr_unalign_flags , arg2 , " PR_UNALIGN_??? " ) ;
2015-07-17 21:49:17 +00:00
return RVAL_DECODED ;
2015-02-14 01:51:03 +00:00
case PR_SET_NO_NEW_PRIVS :
case PR_SET_THP_DISABLE :
Use kernel_ulong_t instead of unsigned long long where appropriate
* defs.h (printaddr_ull): Rename to printaddr_klu, change argument
type from unsigned long long to kernel_ulong_t. All callers updated.
(getarg_ull): Rename to getarg_klu, change return value type
from unsigned long long to kernel_ulong_t. All callers updated.
(PRI_kl, PRI_kld, PRI_klu, PRI_klx): New macros.
* bjm.c (SYS_FUNC(init_module)): Print kernel_ulong_t type using
PRI_klu format.
* desc.c (SYS_FUNC(pselect6)): Likewise.
* fadvise.c (SYS_FUNC(fadvise64)): Likewise.
* lookup_dcookie.c (SYS_FUNC(lookup_dcookie)): Likewise.
* mq.c (SYS_FUNC(mq_timedsend), SYS_FUNC(mq_timedreceive)): Likewise.
* kcmp.c (SYS_FUNC(kcmp)): Print kernel_ulong_t type using
PRI_klx format.
* keyctl.c (SYS_FUNC(keyctl)): Likewise.
* pkeys.c (SYS_FUNC(pkey_alloc)): Likewise.
* prctl.c (print_prctl_args, SYS_FUNC(prctl), SYS_FUNC(arch_prctl)):
Print kernel_ulong_t type using PRI_kld, PRI_klu, or PRI_klx format.
* util.c (printaddr_ull): Rename to printaddr_klu, change argument
type from unsigned long long to kernel_ulong_t, print it using
PRI_klx format.
(getarg_ull): Rename to getarg_klu, change return value type
from unsigned long long to kernel_ulong_t, print it using
PRI_klx format.
2016-12-19 16:56:45 +00:00
tprintf ( " , % " PRI_klu , arg2 ) ;
2015-07-25 09:43:01 +00:00
print_prctl_args ( tcp , 2 ) ;
2015-07-17 21:49:17 +00:00
return RVAL_DECODED ;
2015-02-14 01:51:03 +00:00
case PR_MCE_KILL_GET :
2015-07-25 09:43:01 +00:00
if ( entering ( tcp ) ) {
print_prctl_args ( tcp , 1 ) ;
return 0 ;
}
2015-02-14 01:51:03 +00:00
if ( syserror ( tcp ) )
return 0 ;
2016-05-14 21:46:05 +00:00
tcp - > auxstr = xlookup ( pr_mce_kill_policy ,
2016-12-26 10:26:03 +00:00
( kernel_ulong_t ) tcp - > u_rval ) ;
2015-02-14 01:51:03 +00:00
return tcp - > auxstr ? RVAL_STR : RVAL_UDECIMAL ;
2016-11-19 23:10:01 +03:00
case PR_SET_FP_MODE :
tprints ( " , " ) ;
printflags ( pr_fp_mode , arg2 , " PR_FP_MODE_??? " ) ;
return RVAL_DECODED ;
2015-12-06 15:29:04 +00:00
case PR_GET_NO_NEW_PRIVS :
case PR_GET_THP_DISABLE :
2015-07-17 21:49:17 +00:00
case PR_MPX_DISABLE_MANAGEMENT :
case PR_MPX_ENABLE_MANAGEMENT :
2015-02-14 01:51:03 +00:00
default :
2015-07-25 09:43:01 +00:00
print_prctl_args ( tcp , 1 ) ;
2015-07-17 21:49:17 +00:00
return RVAL_DECODED ;
2014-12-11 19:25:02 +00:00
}
return 0 ;
}
# if defined X86_64 || defined X32
# include <asm / prctl.h>
# include "xlat / archvals.h"
2015-04-07 01:36:50 +00:00
SYS_FUNC ( arch_prctl )
2014-12-11 19:25:02 +00:00
{
2016-05-16 22:19:31 +00:00
const unsigned int option = tcp - > u_arg [ 0 ] ;
2016-12-26 05:28:04 +03:00
const kernel_ulong_t addr = tcp - > u_arg [ 1 ] ;
2016-05-16 22:19:31 +00:00
2015-02-14 01:51:03 +00:00
if ( entering ( tcp ) )
2016-05-16 22:19:31 +00:00
printxval ( archvals , option , " ARCH_??? " ) ;
2015-02-14 01:51:03 +00:00
2016-05-16 22:19:31 +00:00
switch ( option ) {
2015-02-14 01:51:03 +00:00
case ARCH_GET_GS :
case ARCH_GET_FS :
2015-07-17 21:49:17 +00:00
if ( entering ( tcp ) )
2015-02-14 01:51:03 +00:00
tprints ( " , " ) ;
2015-07-17 21:49:17 +00:00
else
2016-11-18 20:25:13 +03:00
printnum_ptr ( tcp , addr ) ;
2015-02-14 01:51:03 +00:00
return 0 ;
2014-12-11 19:25:02 +00:00
}
2015-02-14 01:51:03 +00:00
Use kernel_ulong_t instead of unsigned long long where appropriate
* defs.h (printaddr_ull): Rename to printaddr_klu, change argument
type from unsigned long long to kernel_ulong_t. All callers updated.
(getarg_ull): Rename to getarg_klu, change return value type
from unsigned long long to kernel_ulong_t. All callers updated.
(PRI_kl, PRI_kld, PRI_klu, PRI_klx): New macros.
* bjm.c (SYS_FUNC(init_module)): Print kernel_ulong_t type using
PRI_klu format.
* desc.c (SYS_FUNC(pselect6)): Likewise.
* fadvise.c (SYS_FUNC(fadvise64)): Likewise.
* lookup_dcookie.c (SYS_FUNC(lookup_dcookie)): Likewise.
* mq.c (SYS_FUNC(mq_timedsend), SYS_FUNC(mq_timedreceive)): Likewise.
* kcmp.c (SYS_FUNC(kcmp)): Print kernel_ulong_t type using
PRI_klx format.
* keyctl.c (SYS_FUNC(keyctl)): Likewise.
* pkeys.c (SYS_FUNC(pkey_alloc)): Likewise.
* prctl.c (print_prctl_args, SYS_FUNC(prctl), SYS_FUNC(arch_prctl)):
Print kernel_ulong_t type using PRI_kld, PRI_klu, or PRI_klx format.
* util.c (printaddr_ull): Rename to printaddr_klu, change argument
type from unsigned long long to kernel_ulong_t, print it using
PRI_klx format.
(getarg_ull): Rename to getarg_klu, change return value type
from unsigned long long to kernel_ulong_t, print it using
PRI_klx format.
2016-12-19 16:56:45 +00:00
tprintf ( " , %# " PRI_klx , addr ) ;
2015-07-17 21:49:17 +00:00
return RVAL_DECODED ;
2014-12-11 19:25:02 +00:00
}
# endif /* X86_64 || X32 */