2015-12-17 17:56:48 +00:00
/*
* Copyright ( c ) 2014 - 2015 Dmitry V . Levin < ldv @ altlinux . org >
2018-06-14 11:00:00 +00:00
* Copyright ( c ) 2014 - 2018 The strace developers .
2015-12-17 17:56:48 +00:00
* All rights reserved .
*
2018-12-10 00:00:00 +00:00
* SPDX - License - Identifier : LGPL - 2.1 - or - later
2015-12-17 17:56:48 +00:00
*/
2014-02-05 22:41:45 +00:00
# include "defs.h"
2017-09-01 16:14:25 +02:00
# include "keyctl_kdf_params.h"
# include "print_fields.h"
2014-02-05 22:41:45 +00:00
typedef int32_t key_serial_t ;
2014-04-25 23:30:54 +00:00
# include "xlat/key_spec.h"
2014-02-05 22:41:45 +00:00
2016-10-03 21:35:24 +03:00
struct keyctl_dh_params {
int32_t private ;
int32_t prime ;
int32_t base ;
} ;
2014-02-05 22:41:45 +00:00
static void
print_keyring_serial_number ( key_serial_t id )
{
2018-04-04 14:31:09 +02:00
printxval_d ( key_spec , id , NULL ) ;
2014-02-05 22:41:45 +00:00
}
2015-04-07 01:36:50 +00:00
SYS_FUNC ( add_key )
2014-02-05 22:41:45 +00:00
{
keyctl.c: make use of RVAL_DECODED
* keyctl.c (sys_add_key, sys_request_key): Update for RVAL_DECODED.
(keyctl_join_session_keyring, keyctl_handle_key,
keyctl_set_reqkey_keyring): Remove.
(keyctl_get_keyring_id, keyctl_update_key, keyctl_handle_key_key,
keyctl_read_key, keyctl_keyring_search, keyctl_chown_key,
keyctl_instantiate_key, keyctl_instantiate_key_iov, keyctl_negate_key,
keyctl_reject_key, keyctl_set_timeout, keyctl_get_persistent,
keyctl_setperm_key): Change to return void.
Update for RVAL_DECODED.
(sys_keyctl): Update callers. Update for RVAL_DECODED.
2015-07-20 00:48:49 +00:00
/* type */
2016-12-20 16:43:26 +00:00
printstr ( tcp , tcp - > u_arg [ 0 ] ) ;
keyctl.c: make use of RVAL_DECODED
* keyctl.c (sys_add_key, sys_request_key): Update for RVAL_DECODED.
(keyctl_join_session_keyring, keyctl_handle_key,
keyctl_set_reqkey_keyring): Remove.
(keyctl_get_keyring_id, keyctl_update_key, keyctl_handle_key_key,
keyctl_read_key, keyctl_keyring_search, keyctl_chown_key,
keyctl_instantiate_key, keyctl_instantiate_key_iov, keyctl_negate_key,
keyctl_reject_key, keyctl_set_timeout, keyctl_get_persistent,
keyctl_setperm_key): Change to return void.
Update for RVAL_DECODED.
(sys_keyctl): Update callers. Update for RVAL_DECODED.
2015-07-20 00:48:49 +00:00
/* description */
tprints ( " , " ) ;
2016-12-20 16:43:26 +00:00
printstr ( tcp , tcp - > u_arg [ 1 ] ) ;
keyctl.c: make use of RVAL_DECODED
* keyctl.c (sys_add_key, sys_request_key): Update for RVAL_DECODED.
(keyctl_join_session_keyring, keyctl_handle_key,
keyctl_set_reqkey_keyring): Remove.
(keyctl_get_keyring_id, keyctl_update_key, keyctl_handle_key_key,
keyctl_read_key, keyctl_keyring_search, keyctl_chown_key,
keyctl_instantiate_key, keyctl_instantiate_key_iov, keyctl_negate_key,
keyctl_reject_key, keyctl_set_timeout, keyctl_get_persistent,
keyctl_setperm_key): Change to return void.
Update for RVAL_DECODED.
(sys_keyctl): Update callers. Update for RVAL_DECODED.
2015-07-20 00:48:49 +00:00
/* payload */
tprints ( " , " ) ;
2016-12-20 16:43:26 +00:00
printstrn ( tcp , tcp - > u_arg [ 2 ] , tcp - > u_arg [ 3 ] ) ;
keyctl.c: make use of RVAL_DECODED
* keyctl.c (sys_add_key, sys_request_key): Update for RVAL_DECODED.
(keyctl_join_session_keyring, keyctl_handle_key,
keyctl_set_reqkey_keyring): Remove.
(keyctl_get_keyring_id, keyctl_update_key, keyctl_handle_key_key,
keyctl_read_key, keyctl_keyring_search, keyctl_chown_key,
keyctl_instantiate_key, keyctl_instantiate_key_iov, keyctl_negate_key,
keyctl_reject_key, keyctl_set_timeout, keyctl_get_persistent,
keyctl_setperm_key): Change to return void.
Update for RVAL_DECODED.
(sys_keyctl): Update callers. Update for RVAL_DECODED.
2015-07-20 00:48:49 +00:00
/* payload length */
2016-12-26 10:16:35 +00:00
tprintf ( " , % " PRI_klu " , " , tcp - > u_arg [ 3 ] ) ;
keyctl.c: make use of RVAL_DECODED
* keyctl.c (sys_add_key, sys_request_key): Update for RVAL_DECODED.
(keyctl_join_session_keyring, keyctl_handle_key,
keyctl_set_reqkey_keyring): Remove.
(keyctl_get_keyring_id, keyctl_update_key, keyctl_handle_key_key,
keyctl_read_key, keyctl_keyring_search, keyctl_chown_key,
keyctl_instantiate_key, keyctl_instantiate_key_iov, keyctl_negate_key,
keyctl_reject_key, keyctl_set_timeout, keyctl_get_persistent,
keyctl_setperm_key): Change to return void.
Update for RVAL_DECODED.
(sys_keyctl): Update callers. Update for RVAL_DECODED.
2015-07-20 00:48:49 +00:00
/* keyring serial number */
print_keyring_serial_number ( tcp - > u_arg [ 4 ] ) ;
return RVAL_DECODED ;
2014-02-05 22:41:45 +00:00
}
2015-04-07 01:36:50 +00:00
SYS_FUNC ( request_key )
2014-02-05 22:41:45 +00:00
{
keyctl.c: make use of RVAL_DECODED
* keyctl.c (sys_add_key, sys_request_key): Update for RVAL_DECODED.
(keyctl_join_session_keyring, keyctl_handle_key,
keyctl_set_reqkey_keyring): Remove.
(keyctl_get_keyring_id, keyctl_update_key, keyctl_handle_key_key,
keyctl_read_key, keyctl_keyring_search, keyctl_chown_key,
keyctl_instantiate_key, keyctl_instantiate_key_iov, keyctl_negate_key,
keyctl_reject_key, keyctl_set_timeout, keyctl_get_persistent,
keyctl_setperm_key): Change to return void.
Update for RVAL_DECODED.
(sys_keyctl): Update callers. Update for RVAL_DECODED.
2015-07-20 00:48:49 +00:00
/* type */
2016-12-20 16:43:26 +00:00
printstr ( tcp , tcp - > u_arg [ 0 ] ) ;
keyctl.c: make use of RVAL_DECODED
* keyctl.c (sys_add_key, sys_request_key): Update for RVAL_DECODED.
(keyctl_join_session_keyring, keyctl_handle_key,
keyctl_set_reqkey_keyring): Remove.
(keyctl_get_keyring_id, keyctl_update_key, keyctl_handle_key_key,
keyctl_read_key, keyctl_keyring_search, keyctl_chown_key,
keyctl_instantiate_key, keyctl_instantiate_key_iov, keyctl_negate_key,
keyctl_reject_key, keyctl_set_timeout, keyctl_get_persistent,
keyctl_setperm_key): Change to return void.
Update for RVAL_DECODED.
(sys_keyctl): Update callers. Update for RVAL_DECODED.
2015-07-20 00:48:49 +00:00
/* description */
tprints ( " , " ) ;
2016-12-20 16:43:26 +00:00
printstr ( tcp , tcp - > u_arg [ 1 ] ) ;
keyctl.c: make use of RVAL_DECODED
* keyctl.c (sys_add_key, sys_request_key): Update for RVAL_DECODED.
(keyctl_join_session_keyring, keyctl_handle_key,
keyctl_set_reqkey_keyring): Remove.
(keyctl_get_keyring_id, keyctl_update_key, keyctl_handle_key_key,
keyctl_read_key, keyctl_keyring_search, keyctl_chown_key,
keyctl_instantiate_key, keyctl_instantiate_key_iov, keyctl_negate_key,
keyctl_reject_key, keyctl_set_timeout, keyctl_get_persistent,
keyctl_setperm_key): Change to return void.
Update for RVAL_DECODED.
(sys_keyctl): Update callers. Update for RVAL_DECODED.
2015-07-20 00:48:49 +00:00
/* callout_info */
tprints ( " , " ) ;
2016-12-20 16:43:26 +00:00
printstr ( tcp , tcp - > u_arg [ 2 ] ) ;
keyctl.c: make use of RVAL_DECODED
* keyctl.c (sys_add_key, sys_request_key): Update for RVAL_DECODED.
(keyctl_join_session_keyring, keyctl_handle_key,
keyctl_set_reqkey_keyring): Remove.
(keyctl_get_keyring_id, keyctl_update_key, keyctl_handle_key_key,
keyctl_read_key, keyctl_keyring_search, keyctl_chown_key,
keyctl_instantiate_key, keyctl_instantiate_key_iov, keyctl_negate_key,
keyctl_reject_key, keyctl_set_timeout, keyctl_get_persistent,
keyctl_setperm_key): Change to return void.
Update for RVAL_DECODED.
(sys_keyctl): Update callers. Update for RVAL_DECODED.
2015-07-20 00:48:49 +00:00
/* keyring serial number */
tprints ( " , " ) ;
print_keyring_serial_number ( tcp - > u_arg [ 3 ] ) ;
return RVAL_DECODED ;
2014-02-05 22:41:45 +00:00
}
keyctl.c: make use of RVAL_DECODED
* keyctl.c (sys_add_key, sys_request_key): Update for RVAL_DECODED.
(keyctl_join_session_keyring, keyctl_handle_key,
keyctl_set_reqkey_keyring): Remove.
(keyctl_get_keyring_id, keyctl_update_key, keyctl_handle_key_key,
keyctl_read_key, keyctl_keyring_search, keyctl_chown_key,
keyctl_instantiate_key, keyctl_instantiate_key_iov, keyctl_negate_key,
keyctl_reject_key, keyctl_set_timeout, keyctl_get_persistent,
keyctl_setperm_key): Change to return void.
Update for RVAL_DECODED.
(sys_keyctl): Update callers. Update for RVAL_DECODED.
2015-07-20 00:48:49 +00:00
static void
2014-02-05 22:41:45 +00:00
keyctl_get_keyring_id ( struct tcb * tcp , key_serial_t id , int create )
{
keyctl.c: make use of RVAL_DECODED
* keyctl.c (sys_add_key, sys_request_key): Update for RVAL_DECODED.
(keyctl_join_session_keyring, keyctl_handle_key,
keyctl_set_reqkey_keyring): Remove.
(keyctl_get_keyring_id, keyctl_update_key, keyctl_handle_key_key,
keyctl_read_key, keyctl_keyring_search, keyctl_chown_key,
keyctl_instantiate_key, keyctl_instantiate_key_iov, keyctl_negate_key,
keyctl_reject_key, keyctl_set_timeout, keyctl_get_persistent,
keyctl_setperm_key): Change to return void.
Update for RVAL_DECODED.
(sys_keyctl): Update callers. Update for RVAL_DECODED.
2015-07-20 00:48:49 +00:00
print_keyring_serial_number ( id ) ;
tprintf ( " , %d " , create ) ;
2014-02-05 22:41:45 +00:00
}
keyctl.c: make use of RVAL_DECODED
* keyctl.c (sys_add_key, sys_request_key): Update for RVAL_DECODED.
(keyctl_join_session_keyring, keyctl_handle_key,
keyctl_set_reqkey_keyring): Remove.
(keyctl_get_keyring_id, keyctl_update_key, keyctl_handle_key_key,
keyctl_read_key, keyctl_keyring_search, keyctl_chown_key,
keyctl_instantiate_key, keyctl_instantiate_key_iov, keyctl_negate_key,
keyctl_reject_key, keyctl_set_timeout, keyctl_get_persistent,
keyctl_setperm_key): Change to return void.
Update for RVAL_DECODED.
(sys_keyctl): Update callers. Update for RVAL_DECODED.
2015-07-20 00:48:49 +00:00
static void
2016-10-03 21:36:03 +03:00
keyctl_update_key ( struct tcb * tcp , key_serial_t id , kernel_ulong_t addr ,
kernel_ulong_t len )
2014-02-05 22:41:45 +00:00
{
keyctl.c: make use of RVAL_DECODED
* keyctl.c (sys_add_key, sys_request_key): Update for RVAL_DECODED.
(keyctl_join_session_keyring, keyctl_handle_key,
keyctl_set_reqkey_keyring): Remove.
(keyctl_get_keyring_id, keyctl_update_key, keyctl_handle_key_key,
keyctl_read_key, keyctl_keyring_search, keyctl_chown_key,
keyctl_instantiate_key, keyctl_instantiate_key_iov, keyctl_negate_key,
keyctl_reject_key, keyctl_set_timeout, keyctl_get_persistent,
keyctl_setperm_key): Change to return void.
Update for RVAL_DECODED.
(sys_keyctl): Update callers. Update for RVAL_DECODED.
2015-07-20 00:48:49 +00:00
print_keyring_serial_number ( id ) ;
tprints ( " , " ) ;
2016-12-20 16:43:26 +00:00
printstrn ( tcp , addr , len ) ;
2016-10-03 21:36:03 +03:00
tprintf ( " , %llu " , zero_extend_signed_to_ull ( len ) ) ;
2014-02-05 22:41:45 +00:00
}
keyctl.c: make use of RVAL_DECODED
* keyctl.c (sys_add_key, sys_request_key): Update for RVAL_DECODED.
(keyctl_join_session_keyring, keyctl_handle_key,
keyctl_set_reqkey_keyring): Remove.
(keyctl_get_keyring_id, keyctl_update_key, keyctl_handle_key_key,
keyctl_read_key, keyctl_keyring_search, keyctl_chown_key,
keyctl_instantiate_key, keyctl_instantiate_key_iov, keyctl_negate_key,
keyctl_reject_key, keyctl_set_timeout, keyctl_get_persistent,
keyctl_setperm_key): Change to return void.
Update for RVAL_DECODED.
(sys_keyctl): Update callers. Update for RVAL_DECODED.
2015-07-20 00:48:49 +00:00
static void
2014-02-05 22:41:45 +00:00
keyctl_handle_key_key ( struct tcb * tcp , key_serial_t id1 , key_serial_t id2 )
{
keyctl.c: make use of RVAL_DECODED
* keyctl.c (sys_add_key, sys_request_key): Update for RVAL_DECODED.
(keyctl_join_session_keyring, keyctl_handle_key,
keyctl_set_reqkey_keyring): Remove.
(keyctl_get_keyring_id, keyctl_update_key, keyctl_handle_key_key,
keyctl_read_key, keyctl_keyring_search, keyctl_chown_key,
keyctl_instantiate_key, keyctl_instantiate_key_iov, keyctl_negate_key,
keyctl_reject_key, keyctl_set_timeout, keyctl_get_persistent,
keyctl_setperm_key): Change to return void.
Update for RVAL_DECODED.
(sys_keyctl): Update callers. Update for RVAL_DECODED.
2015-07-20 00:48:49 +00:00
print_keyring_serial_number ( id1 ) ;
tprints ( " , " ) ;
print_keyring_serial_number ( id2 ) ;
2014-02-05 22:41:45 +00:00
}
keyctl.c: make use of RVAL_DECODED
* keyctl.c (sys_add_key, sys_request_key): Update for RVAL_DECODED.
(keyctl_join_session_keyring, keyctl_handle_key,
keyctl_set_reqkey_keyring): Remove.
(keyctl_get_keyring_id, keyctl_update_key, keyctl_handle_key_key,
keyctl_read_key, keyctl_keyring_search, keyctl_chown_key,
keyctl_instantiate_key, keyctl_instantiate_key_iov, keyctl_negate_key,
keyctl_reject_key, keyctl_set_timeout, keyctl_get_persistent,
keyctl_setperm_key): Change to return void.
Update for RVAL_DECODED.
(sys_keyctl): Update callers. Update for RVAL_DECODED.
2015-07-20 00:48:49 +00:00
static void
2016-10-03 21:36:03 +03:00
keyctl_read_key ( struct tcb * tcp , key_serial_t id , kernel_ulong_t addr ,
kernel_ulong_t len , bool has_nul )
2014-02-05 22:41:45 +00:00
{
if ( entering ( tcp ) ) {
print_keyring_serial_number ( id ) ;
tprints ( " , " ) ;
} else {
2015-07-20 00:26:23 +00:00
if ( syserror ( tcp ) )
printaddr ( addr ) ;
2014-02-05 22:41:45 +00:00
else {
2016-10-03 21:36:03 +03:00
kernel_ulong_t rval = ( tcp - > u_rval > = 0 ) & &
( ( kernel_ulong_t ) tcp - > u_rval > len ) ? len :
( kernel_ulong_t ) tcp - > u_rval ;
2016-10-03 21:35:51 +03:00
printstr_ex ( tcp , addr , rval , has_nul ?
QUOTE_OMIT_TRAILING_0 : 0 ) ;
2014-02-05 22:41:45 +00:00
}
2016-10-03 21:36:03 +03:00
tprintf ( " , %llu " , zero_extend_signed_to_ull ( len ) ) ;
2014-02-05 22:41:45 +00:00
}
}
keyctl.c: make use of RVAL_DECODED
* keyctl.c (sys_add_key, sys_request_key): Update for RVAL_DECODED.
(keyctl_join_session_keyring, keyctl_handle_key,
keyctl_set_reqkey_keyring): Remove.
(keyctl_get_keyring_id, keyctl_update_key, keyctl_handle_key_key,
keyctl_read_key, keyctl_keyring_search, keyctl_chown_key,
keyctl_instantiate_key, keyctl_instantiate_key_iov, keyctl_negate_key,
keyctl_reject_key, keyctl_set_timeout, keyctl_get_persistent,
keyctl_setperm_key): Change to return void.
Update for RVAL_DECODED.
(sys_keyctl): Update callers. Update for RVAL_DECODED.
2015-07-20 00:48:49 +00:00
static void
2016-10-03 21:36:03 +03:00
keyctl_keyring_search ( struct tcb * tcp , key_serial_t id1 , kernel_ulong_t addr1 ,
kernel_ulong_t addr2 , key_serial_t id2 )
2014-02-05 22:41:45 +00:00
{
keyctl.c: make use of RVAL_DECODED
* keyctl.c (sys_add_key, sys_request_key): Update for RVAL_DECODED.
(keyctl_join_session_keyring, keyctl_handle_key,
keyctl_set_reqkey_keyring): Remove.
(keyctl_get_keyring_id, keyctl_update_key, keyctl_handle_key_key,
keyctl_read_key, keyctl_keyring_search, keyctl_chown_key,
keyctl_instantiate_key, keyctl_instantiate_key_iov, keyctl_negate_key,
keyctl_reject_key, keyctl_set_timeout, keyctl_get_persistent,
keyctl_setperm_key): Change to return void.
Update for RVAL_DECODED.
(sys_keyctl): Update callers. Update for RVAL_DECODED.
2015-07-20 00:48:49 +00:00
print_keyring_serial_number ( id1 ) ;
tprints ( " , " ) ;
2016-12-20 16:43:26 +00:00
printstr ( tcp , addr1 ) ;
keyctl.c: make use of RVAL_DECODED
* keyctl.c (sys_add_key, sys_request_key): Update for RVAL_DECODED.
(keyctl_join_session_keyring, keyctl_handle_key,
keyctl_set_reqkey_keyring): Remove.
(keyctl_get_keyring_id, keyctl_update_key, keyctl_handle_key_key,
keyctl_read_key, keyctl_keyring_search, keyctl_chown_key,
keyctl_instantiate_key, keyctl_instantiate_key_iov, keyctl_negate_key,
keyctl_reject_key, keyctl_set_timeout, keyctl_get_persistent,
keyctl_setperm_key): Change to return void.
Update for RVAL_DECODED.
(sys_keyctl): Update callers. Update for RVAL_DECODED.
2015-07-20 00:48:49 +00:00
tprints ( " , " ) ;
2016-12-20 16:43:26 +00:00
printstr ( tcp , addr2 ) ;
keyctl.c: make use of RVAL_DECODED
* keyctl.c (sys_add_key, sys_request_key): Update for RVAL_DECODED.
(keyctl_join_session_keyring, keyctl_handle_key,
keyctl_set_reqkey_keyring): Remove.
(keyctl_get_keyring_id, keyctl_update_key, keyctl_handle_key_key,
keyctl_read_key, keyctl_keyring_search, keyctl_chown_key,
keyctl_instantiate_key, keyctl_instantiate_key_iov, keyctl_negate_key,
keyctl_reject_key, keyctl_set_timeout, keyctl_get_persistent,
keyctl_setperm_key): Change to return void.
Update for RVAL_DECODED.
(sys_keyctl): Update callers. Update for RVAL_DECODED.
2015-07-20 00:48:49 +00:00
tprints ( " , " ) ;
print_keyring_serial_number ( id2 ) ;
2014-02-05 22:41:45 +00:00
}
keyctl.c: make use of RVAL_DECODED
* keyctl.c (sys_add_key, sys_request_key): Update for RVAL_DECODED.
(keyctl_join_session_keyring, keyctl_handle_key,
keyctl_set_reqkey_keyring): Remove.
(keyctl_get_keyring_id, keyctl_update_key, keyctl_handle_key_key,
keyctl_read_key, keyctl_keyring_search, keyctl_chown_key,
keyctl_instantiate_key, keyctl_instantiate_key_iov, keyctl_negate_key,
keyctl_reject_key, keyctl_set_timeout, keyctl_get_persistent,
keyctl_setperm_key): Change to return void.
Update for RVAL_DECODED.
(sys_keyctl): Update callers. Update for RVAL_DECODED.
2015-07-20 00:48:49 +00:00
static void
2016-10-03 21:35:57 +03:00
keyctl_chown_key ( struct tcb * tcp , key_serial_t id , unsigned user ,
unsigned group )
2014-02-05 22:41:45 +00:00
{
keyctl.c: make use of RVAL_DECODED
* keyctl.c (sys_add_key, sys_request_key): Update for RVAL_DECODED.
(keyctl_join_session_keyring, keyctl_handle_key,
keyctl_set_reqkey_keyring): Remove.
(keyctl_get_keyring_id, keyctl_update_key, keyctl_handle_key_key,
keyctl_read_key, keyctl_keyring_search, keyctl_chown_key,
keyctl_instantiate_key, keyctl_instantiate_key_iov, keyctl_negate_key,
keyctl_reject_key, keyctl_set_timeout, keyctl_get_persistent,
keyctl_setperm_key): Change to return void.
Update for RVAL_DECODED.
(sys_keyctl): Update callers. Update for RVAL_DECODED.
2015-07-20 00:48:49 +00:00
print_keyring_serial_number ( id ) ;
2016-09-29 15:56:02 +03:00
printuid ( " , " , user ) ;
printuid ( " , " , group ) ;
2014-02-05 22:41:45 +00:00
}
keyctl.c: make use of RVAL_DECODED
* keyctl.c (sys_add_key, sys_request_key): Update for RVAL_DECODED.
(keyctl_join_session_keyring, keyctl_handle_key,
keyctl_set_reqkey_keyring): Remove.
(keyctl_get_keyring_id, keyctl_update_key, keyctl_handle_key_key,
keyctl_read_key, keyctl_keyring_search, keyctl_chown_key,
keyctl_instantiate_key, keyctl_instantiate_key_iov, keyctl_negate_key,
keyctl_reject_key, keyctl_set_timeout, keyctl_get_persistent,
keyctl_setperm_key): Change to return void.
Update for RVAL_DECODED.
(sys_keyctl): Update callers. Update for RVAL_DECODED.
2015-07-20 00:48:49 +00:00
static void
2016-10-03 21:36:03 +03:00
keyctl_instantiate_key ( struct tcb * tcp , key_serial_t id1 , kernel_ulong_t addr ,
kernel_ulong_t len , key_serial_t id2 )
2014-02-05 22:41:45 +00:00
{
keyctl.c: make use of RVAL_DECODED
* keyctl.c (sys_add_key, sys_request_key): Update for RVAL_DECODED.
(keyctl_join_session_keyring, keyctl_handle_key,
keyctl_set_reqkey_keyring): Remove.
(keyctl_get_keyring_id, keyctl_update_key, keyctl_handle_key_key,
keyctl_read_key, keyctl_keyring_search, keyctl_chown_key,
keyctl_instantiate_key, keyctl_instantiate_key_iov, keyctl_negate_key,
keyctl_reject_key, keyctl_set_timeout, keyctl_get_persistent,
keyctl_setperm_key): Change to return void.
Update for RVAL_DECODED.
(sys_keyctl): Update callers. Update for RVAL_DECODED.
2015-07-20 00:48:49 +00:00
print_keyring_serial_number ( id1 ) ;
tprints ( " , " ) ;
2016-12-20 16:43:26 +00:00
printstrn ( tcp , addr , len ) ;
2016-10-03 21:36:03 +03:00
tprintf ( " , %llu, " , zero_extend_signed_to_ull ( len ) ) ;
keyctl.c: make use of RVAL_DECODED
* keyctl.c (sys_add_key, sys_request_key): Update for RVAL_DECODED.
(keyctl_join_session_keyring, keyctl_handle_key,
keyctl_set_reqkey_keyring): Remove.
(keyctl_get_keyring_id, keyctl_update_key, keyctl_handle_key_key,
keyctl_read_key, keyctl_keyring_search, keyctl_chown_key,
keyctl_instantiate_key, keyctl_instantiate_key_iov, keyctl_negate_key,
keyctl_reject_key, keyctl_set_timeout, keyctl_get_persistent,
keyctl_setperm_key): Change to return void.
Update for RVAL_DECODED.
(sys_keyctl): Update callers. Update for RVAL_DECODED.
2015-07-20 00:48:49 +00:00
print_keyring_serial_number ( id2 ) ;
2014-02-05 22:41:45 +00:00
}
keyctl.c: make use of RVAL_DECODED
* keyctl.c (sys_add_key, sys_request_key): Update for RVAL_DECODED.
(keyctl_join_session_keyring, keyctl_handle_key,
keyctl_set_reqkey_keyring): Remove.
(keyctl_get_keyring_id, keyctl_update_key, keyctl_handle_key_key,
keyctl_read_key, keyctl_keyring_search, keyctl_chown_key,
keyctl_instantiate_key, keyctl_instantiate_key_iov, keyctl_negate_key,
keyctl_reject_key, keyctl_set_timeout, keyctl_get_persistent,
keyctl_setperm_key): Change to return void.
Update for RVAL_DECODED.
(sys_keyctl): Update callers. Update for RVAL_DECODED.
2015-07-20 00:48:49 +00:00
static void
2014-02-05 22:41:45 +00:00
keyctl_instantiate_key_iov ( struct tcb * tcp , key_serial_t id1 ,
2016-10-03 21:36:03 +03:00
kernel_ulong_t addr , kernel_ulong_t len ,
2016-10-03 21:35:57 +03:00
key_serial_t id2 )
2014-02-05 22:41:45 +00:00
{
keyctl.c: make use of RVAL_DECODED
* keyctl.c (sys_add_key, sys_request_key): Update for RVAL_DECODED.
(keyctl_join_session_keyring, keyctl_handle_key,
keyctl_set_reqkey_keyring): Remove.
(keyctl_get_keyring_id, keyctl_update_key, keyctl_handle_key_key,
keyctl_read_key, keyctl_keyring_search, keyctl_chown_key,
keyctl_instantiate_key, keyctl_instantiate_key_iov, keyctl_negate_key,
keyctl_reject_key, keyctl_set_timeout, keyctl_get_persistent,
keyctl_setperm_key): Change to return void.
Update for RVAL_DECODED.
(sys_keyctl): Update callers. Update for RVAL_DECODED.
2015-07-20 00:48:49 +00:00
print_keyring_serial_number ( id1 ) ;
tprints ( " , " ) ;
2016-06-22 13:27:03 +00:00
tprint_iov ( tcp , len , addr , IOV_DECODE_STR ) ;
2016-10-03 21:36:03 +03:00
tprintf ( " , %llu, " , zero_extend_signed_to_ull ( len ) ) ;
keyctl.c: make use of RVAL_DECODED
* keyctl.c (sys_add_key, sys_request_key): Update for RVAL_DECODED.
(keyctl_join_session_keyring, keyctl_handle_key,
keyctl_set_reqkey_keyring): Remove.
(keyctl_get_keyring_id, keyctl_update_key, keyctl_handle_key_key,
keyctl_read_key, keyctl_keyring_search, keyctl_chown_key,
keyctl_instantiate_key, keyctl_instantiate_key_iov, keyctl_negate_key,
keyctl_reject_key, keyctl_set_timeout, keyctl_get_persistent,
keyctl_setperm_key): Change to return void.
Update for RVAL_DECODED.
(sys_keyctl): Update callers. Update for RVAL_DECODED.
2015-07-20 00:48:49 +00:00
print_keyring_serial_number ( id2 ) ;
2014-02-05 22:41:45 +00:00
}
keyctl.c: make use of RVAL_DECODED
* keyctl.c (sys_add_key, sys_request_key): Update for RVAL_DECODED.
(keyctl_join_session_keyring, keyctl_handle_key,
keyctl_set_reqkey_keyring): Remove.
(keyctl_get_keyring_id, keyctl_update_key, keyctl_handle_key_key,
keyctl_read_key, keyctl_keyring_search, keyctl_chown_key,
keyctl_instantiate_key, keyctl_instantiate_key_iov, keyctl_negate_key,
keyctl_reject_key, keyctl_set_timeout, keyctl_get_persistent,
keyctl_setperm_key): Change to return void.
Update for RVAL_DECODED.
(sys_keyctl): Update callers. Update for RVAL_DECODED.
2015-07-20 00:48:49 +00:00
static void
2014-02-05 22:41:45 +00:00
keyctl_negate_key ( struct tcb * tcp , key_serial_t id1 , unsigned timeout ,
key_serial_t id2 )
{
keyctl.c: make use of RVAL_DECODED
* keyctl.c (sys_add_key, sys_request_key): Update for RVAL_DECODED.
(keyctl_join_session_keyring, keyctl_handle_key,
keyctl_set_reqkey_keyring): Remove.
(keyctl_get_keyring_id, keyctl_update_key, keyctl_handle_key_key,
keyctl_read_key, keyctl_keyring_search, keyctl_chown_key,
keyctl_instantiate_key, keyctl_instantiate_key_iov, keyctl_negate_key,
keyctl_reject_key, keyctl_set_timeout, keyctl_get_persistent,
keyctl_setperm_key): Change to return void.
Update for RVAL_DECODED.
(sys_keyctl): Update callers. Update for RVAL_DECODED.
2015-07-20 00:48:49 +00:00
print_keyring_serial_number ( id1 ) ;
tprintf ( " , %u, " , timeout ) ;
print_keyring_serial_number ( id2 ) ;
2014-02-05 22:41:45 +00:00
}
keyctl.c: make use of RVAL_DECODED
* keyctl.c (sys_add_key, sys_request_key): Update for RVAL_DECODED.
(keyctl_join_session_keyring, keyctl_handle_key,
keyctl_set_reqkey_keyring): Remove.
(keyctl_get_keyring_id, keyctl_update_key, keyctl_handle_key_key,
keyctl_read_key, keyctl_keyring_search, keyctl_chown_key,
keyctl_instantiate_key, keyctl_instantiate_key_iov, keyctl_negate_key,
keyctl_reject_key, keyctl_set_timeout, keyctl_get_persistent,
keyctl_setperm_key): Change to return void.
Update for RVAL_DECODED.
(sys_keyctl): Update callers. Update for RVAL_DECODED.
2015-07-20 00:48:49 +00:00
static void
2014-02-05 22:41:45 +00:00
keyctl_reject_key ( struct tcb * tcp , key_serial_t id1 , unsigned timeout ,
unsigned error , key_serial_t id2 )
{
2016-09-29 15:56:35 +03:00
const char * err_str = err_name ( error ) ;
keyctl.c: make use of RVAL_DECODED
* keyctl.c (sys_add_key, sys_request_key): Update for RVAL_DECODED.
(keyctl_join_session_keyring, keyctl_handle_key,
keyctl_set_reqkey_keyring): Remove.
(keyctl_get_keyring_id, keyctl_update_key, keyctl_handle_key_key,
keyctl_read_key, keyctl_keyring_search, keyctl_chown_key,
keyctl_instantiate_key, keyctl_instantiate_key_iov, keyctl_negate_key,
keyctl_reject_key, keyctl_set_timeout, keyctl_get_persistent,
keyctl_setperm_key): Change to return void.
Update for RVAL_DECODED.
(sys_keyctl): Update callers. Update for RVAL_DECODED.
2015-07-20 00:48:49 +00:00
print_keyring_serial_number ( id1 ) ;
2016-09-29 15:56:35 +03:00
tprintf ( " , %u, " , timeout ) ;
2018-05-21 02:33:33 +02:00
print_xlat_ex ( error , err_str , XLAT_STYLE_FMT_U ) ;
tprints ( " , " ) ;
keyctl.c: make use of RVAL_DECODED
* keyctl.c (sys_add_key, sys_request_key): Update for RVAL_DECODED.
(keyctl_join_session_keyring, keyctl_handle_key,
keyctl_set_reqkey_keyring): Remove.
(keyctl_get_keyring_id, keyctl_update_key, keyctl_handle_key_key,
keyctl_read_key, keyctl_keyring_search, keyctl_chown_key,
keyctl_instantiate_key, keyctl_instantiate_key_iov, keyctl_negate_key,
keyctl_reject_key, keyctl_set_timeout, keyctl_get_persistent,
keyctl_setperm_key): Change to return void.
Update for RVAL_DECODED.
(sys_keyctl): Update callers. Update for RVAL_DECODED.
2015-07-20 00:48:49 +00:00
print_keyring_serial_number ( id2 ) ;
2014-02-05 22:41:45 +00:00
}
keyctl.c: make use of RVAL_DECODED
* keyctl.c (sys_add_key, sys_request_key): Update for RVAL_DECODED.
(keyctl_join_session_keyring, keyctl_handle_key,
keyctl_set_reqkey_keyring): Remove.
(keyctl_get_keyring_id, keyctl_update_key, keyctl_handle_key_key,
keyctl_read_key, keyctl_keyring_search, keyctl_chown_key,
keyctl_instantiate_key, keyctl_instantiate_key_iov, keyctl_negate_key,
keyctl_reject_key, keyctl_set_timeout, keyctl_get_persistent,
keyctl_setperm_key): Change to return void.
Update for RVAL_DECODED.
(sys_keyctl): Update callers. Update for RVAL_DECODED.
2015-07-20 00:48:49 +00:00
static void
2014-02-05 22:41:45 +00:00
keyctl_set_timeout ( struct tcb * tcp , key_serial_t id , unsigned timeout )
{
keyctl.c: make use of RVAL_DECODED
* keyctl.c (sys_add_key, sys_request_key): Update for RVAL_DECODED.
(keyctl_join_session_keyring, keyctl_handle_key,
keyctl_set_reqkey_keyring): Remove.
(keyctl_get_keyring_id, keyctl_update_key, keyctl_handle_key_key,
keyctl_read_key, keyctl_keyring_search, keyctl_chown_key,
keyctl_instantiate_key, keyctl_instantiate_key_iov, keyctl_negate_key,
keyctl_reject_key, keyctl_set_timeout, keyctl_get_persistent,
keyctl_setperm_key): Change to return void.
Update for RVAL_DECODED.
(sys_keyctl): Update callers. Update for RVAL_DECODED.
2015-07-20 00:48:49 +00:00
print_keyring_serial_number ( id ) ;
tprintf ( " , %u " , timeout ) ;
2014-02-05 22:41:45 +00:00
}
keyctl.c: make use of RVAL_DECODED
* keyctl.c (sys_add_key, sys_request_key): Update for RVAL_DECODED.
(keyctl_join_session_keyring, keyctl_handle_key,
keyctl_set_reqkey_keyring): Remove.
(keyctl_get_keyring_id, keyctl_update_key, keyctl_handle_key_key,
keyctl_read_key, keyctl_keyring_search, keyctl_chown_key,
keyctl_instantiate_key, keyctl_instantiate_key_iov, keyctl_negate_key,
keyctl_reject_key, keyctl_set_timeout, keyctl_get_persistent,
keyctl_setperm_key): Change to return void.
Update for RVAL_DECODED.
(sys_keyctl): Update callers. Update for RVAL_DECODED.
2015-07-20 00:48:49 +00:00
static void
2016-10-03 21:35:57 +03:00
keyctl_get_persistent ( struct tcb * tcp , unsigned uid , key_serial_t id )
2014-02-05 22:41:45 +00:00
{
2016-09-29 15:56:02 +03:00
printuid ( " " , uid ) ;
tprints ( " , " ) ;
keyctl.c: make use of RVAL_DECODED
* keyctl.c (sys_add_key, sys_request_key): Update for RVAL_DECODED.
(keyctl_join_session_keyring, keyctl_handle_key,
keyctl_set_reqkey_keyring): Remove.
(keyctl_get_keyring_id, keyctl_update_key, keyctl_handle_key_key,
keyctl_read_key, keyctl_keyring_search, keyctl_chown_key,
keyctl_instantiate_key, keyctl_instantiate_key_iov, keyctl_negate_key,
keyctl_reject_key, keyctl_set_timeout, keyctl_get_persistent,
keyctl_setperm_key): Change to return void.
Update for RVAL_DECODED.
(sys_keyctl): Update callers. Update for RVAL_DECODED.
2015-07-20 00:48:49 +00:00
print_keyring_serial_number ( id ) ;
2014-02-05 22:41:45 +00:00
}
2014-04-25 23:30:54 +00:00
# include "xlat/key_perms.h"
2014-02-05 22:41:45 +00:00
keyctl.c: make use of RVAL_DECODED
* keyctl.c (sys_add_key, sys_request_key): Update for RVAL_DECODED.
(keyctl_join_session_keyring, keyctl_handle_key,
keyctl_set_reqkey_keyring): Remove.
(keyctl_get_keyring_id, keyctl_update_key, keyctl_handle_key_key,
keyctl_read_key, keyctl_keyring_search, keyctl_chown_key,
keyctl_instantiate_key, keyctl_instantiate_key_iov, keyctl_negate_key,
keyctl_reject_key, keyctl_set_timeout, keyctl_get_persistent,
keyctl_setperm_key): Change to return void.
Update for RVAL_DECODED.
(sys_keyctl): Update callers. Update for RVAL_DECODED.
2015-07-20 00:48:49 +00:00
static void
2014-02-05 22:41:45 +00:00
keyctl_setperm_key ( struct tcb * tcp , key_serial_t id , uint32_t perm )
{
keyctl.c: make use of RVAL_DECODED
* keyctl.c (sys_add_key, sys_request_key): Update for RVAL_DECODED.
(keyctl_join_session_keyring, keyctl_handle_key,
keyctl_set_reqkey_keyring): Remove.
(keyctl_get_keyring_id, keyctl_update_key, keyctl_handle_key_key,
keyctl_read_key, keyctl_keyring_search, keyctl_chown_key,
keyctl_instantiate_key, keyctl_instantiate_key_iov, keyctl_negate_key,
keyctl_reject_key, keyctl_set_timeout, keyctl_get_persistent,
keyctl_setperm_key): Change to return void.
Update for RVAL_DECODED.
(sys_keyctl): Update callers. Update for RVAL_DECODED.
2015-07-20 00:48:49 +00:00
print_keyring_serial_number ( id ) ;
tprints ( " , " ) ;
printflags ( key_perms , perm , " KEY_??? " ) ;
2014-02-05 22:41:45 +00:00
}
2016-10-03 21:35:24 +03:00
static void
2016-10-03 21:36:03 +03:00
print_dh_params ( struct tcb * tcp , kernel_ulong_t addr )
2016-10-03 21:35:24 +03:00
{
struct keyctl_dh_params params ;
if ( umove_or_printaddr ( tcp , addr , & params ) )
return ;
tprints ( " {private= " ) ;
print_keyring_serial_number ( params . private ) ;
tprints ( " , prime= " ) ;
print_keyring_serial_number ( params . prime ) ;
tprints ( " , base= " ) ;
print_keyring_serial_number ( params . base ) ;
tprints ( " } " ) ;
}
static void
2016-10-03 21:36:03 +03:00
keyctl_dh_compute ( struct tcb * tcp , kernel_ulong_t params , kernel_ulong_t buf ,
2017-09-01 16:14:25 +02:00
kernel_ulong_t len , kernel_ulong_t kdf_addr )
2016-10-03 21:35:24 +03:00
{
if ( entering ( tcp ) ) {
print_dh_params ( tcp , params ) ;
tprints ( " , " ) ;
} else {
2017-09-01 16:14:25 +02:00
struct strace_keyctl_kdf_params kdf ;
2016-10-03 21:35:24 +03:00
if ( syserror ( tcp ) ) {
printaddr ( buf ) ;
} else {
2016-10-03 21:36:03 +03:00
kernel_ulong_t rval = ( tcp - > u_rval > = 0 ) & &
( ( kernel_ulong_t ) tcp - > u_rval > len ) ? len :
( kernel_ulong_t ) tcp - > u_rval ;
2016-12-20 16:43:26 +00:00
printstrn ( tcp , buf , rval ) ;
2016-10-03 21:35:24 +03:00
}
2017-09-01 16:14:25 +02:00
tprintf ( " , %llu, " , zero_extend_signed_to_ull ( len ) ) ;
if ( fetch_keyctl_kdf_params ( tcp , kdf_addr , & kdf ) ) {
printaddr ( kdf_addr ) ;
} else {
size_t i ;
PRINT_FIELD_STR ( " { " , kdf , hashname , tcp ) ;
/*
* Kernel doesn ' t touch otherinfo
* if otherinfolen is zero .
*/
if ( kdf . otherinfolen )
PRINT_FIELD_STRN ( " , " , kdf , otherinfo ,
kdf . otherinfolen , tcp ) ;
else
PRINT_FIELD_PTR ( " , " , kdf , otherinfo ) ;
PRINT_FIELD_U ( " , " , kdf , otherinfolen ) ;
/* Some future-proofing */
for ( i = 0 ; i < ARRAY_SIZE ( kdf . __spare ) ; i + + ) {
if ( kdf . __spare [ i ] )
break ;
}
if ( i < ARRAY_SIZE ( kdf . __spare ) ) {
tprints ( " , __spare=[ " ) ;
for ( i = 0 ; i < ARRAY_SIZE ( kdf . __spare ) ; i + + ) {
if ( i )
tprints ( " , " ) ;
tprintf ( " %#x " , kdf . __spare [ i ] ) ;
}
tprints ( " ] " ) ;
}
tprints ( " } " ) ;
}
2016-10-03 21:35:24 +03:00
}
}
2017-07-21 11:07:55 +00:00
static void
keyctl_restrict_keyring ( struct tcb * const tcp ,
const key_serial_t id ,
const kernel_ulong_t addr1 ,
const kernel_ulong_t addr2 )
{
print_keyring_serial_number ( id ) ;
tprints ( " , " ) ;
printstr ( tcp , addr1 ) ;
tprints ( " , " ) ;
printstr ( tcp , addr2 ) ;
}
2014-04-25 23:30:54 +00:00
# include "xlat/key_reqkeys.h"
# include "xlat/keyctl_commands.h"
2014-02-05 22:41:45 +00:00
2015-04-07 01:36:50 +00:00
SYS_FUNC ( keyctl )
2014-02-05 22:41:45 +00:00
{
int cmd = tcp - > u_arg [ 0 ] ;
2016-12-26 05:28:04 +03:00
kernel_ulong_t arg2 = tcp - > u_arg [ 1 ] ;
kernel_ulong_t arg3 = tcp - > u_arg [ 2 ] ;
kernel_ulong_t arg4 = tcp - > u_arg [ 3 ] ;
kernel_ulong_t arg5 = tcp - > u_arg [ 4 ] ;
2014-02-05 22:41:45 +00:00
keyctl.c: make use of RVAL_DECODED
* keyctl.c (sys_add_key, sys_request_key): Update for RVAL_DECODED.
(keyctl_join_session_keyring, keyctl_handle_key,
keyctl_set_reqkey_keyring): Remove.
(keyctl_get_keyring_id, keyctl_update_key, keyctl_handle_key_key,
keyctl_read_key, keyctl_keyring_search, keyctl_chown_key,
keyctl_instantiate_key, keyctl_instantiate_key_iov, keyctl_negate_key,
keyctl_reject_key, keyctl_set_timeout, keyctl_get_persistent,
keyctl_setperm_key): Change to return void.
Update for RVAL_DECODED.
(sys_keyctl): Update callers. Update for RVAL_DECODED.
2015-07-20 00:48:49 +00:00
if ( entering ( tcp ) ) {
2014-02-05 22:41:45 +00:00
printxval ( keyctl_commands , cmd , " KEYCTL_??? " ) ;
2016-09-29 15:56:20 +03:00
/*
* For now , KEYCTL_SESSION_TO_PARENT is the only cmd without
* arguments .
*/
if ( cmd ! = KEYCTL_SESSION_TO_PARENT )
tprints ( " , " ) ;
keyctl.c: make use of RVAL_DECODED
* keyctl.c (sys_add_key, sys_request_key): Update for RVAL_DECODED.
(keyctl_join_session_keyring, keyctl_handle_key,
keyctl_set_reqkey_keyring): Remove.
(keyctl_get_keyring_id, keyctl_update_key, keyctl_handle_key_key,
keyctl_read_key, keyctl_keyring_search, keyctl_chown_key,
keyctl_instantiate_key, keyctl_instantiate_key_iov, keyctl_negate_key,
keyctl_reject_key, keyctl_set_timeout, keyctl_get_persistent,
keyctl_setperm_key): Change to return void.
Update for RVAL_DECODED.
(sys_keyctl): Update callers. Update for RVAL_DECODED.
2015-07-20 00:48:49 +00:00
}
2014-02-05 22:41:45 +00:00
switch ( cmd ) {
case KEYCTL_GET_KEYRING_ID :
2016-10-03 21:36:03 +03:00
keyctl_get_keyring_id ( tcp , arg2 , arg3 ) ;
keyctl.c: make use of RVAL_DECODED
* keyctl.c (sys_add_key, sys_request_key): Update for RVAL_DECODED.
(keyctl_join_session_keyring, keyctl_handle_key,
keyctl_set_reqkey_keyring): Remove.
(keyctl_get_keyring_id, keyctl_update_key, keyctl_handle_key_key,
keyctl_read_key, keyctl_keyring_search, keyctl_chown_key,
keyctl_instantiate_key, keyctl_instantiate_key_iov, keyctl_negate_key,
keyctl_reject_key, keyctl_set_timeout, keyctl_get_persistent,
keyctl_setperm_key): Change to return void.
Update for RVAL_DECODED.
(sys_keyctl): Update callers. Update for RVAL_DECODED.
2015-07-20 00:48:49 +00:00
break ;
2014-02-05 22:41:45 +00:00
case KEYCTL_JOIN_SESSION_KEYRING :
2016-12-20 16:43:26 +00:00
printstr ( tcp , arg2 ) ;
keyctl.c: make use of RVAL_DECODED
* keyctl.c (sys_add_key, sys_request_key): Update for RVAL_DECODED.
(keyctl_join_session_keyring, keyctl_handle_key,
keyctl_set_reqkey_keyring): Remove.
(keyctl_get_keyring_id, keyctl_update_key, keyctl_handle_key_key,
keyctl_read_key, keyctl_keyring_search, keyctl_chown_key,
keyctl_instantiate_key, keyctl_instantiate_key_iov, keyctl_negate_key,
keyctl_reject_key, keyctl_set_timeout, keyctl_get_persistent,
keyctl_setperm_key): Change to return void.
Update for RVAL_DECODED.
(sys_keyctl): Update callers. Update for RVAL_DECODED.
2015-07-20 00:48:49 +00:00
break ;
2014-02-05 22:41:45 +00:00
case KEYCTL_UPDATE :
2016-10-03 21:36:03 +03:00
keyctl_update_key ( tcp , arg2 , arg3 , arg4 ) ;
keyctl.c: make use of RVAL_DECODED
* keyctl.c (sys_add_key, sys_request_key): Update for RVAL_DECODED.
(keyctl_join_session_keyring, keyctl_handle_key,
keyctl_set_reqkey_keyring): Remove.
(keyctl_get_keyring_id, keyctl_update_key, keyctl_handle_key_key,
keyctl_read_key, keyctl_keyring_search, keyctl_chown_key,
keyctl_instantiate_key, keyctl_instantiate_key_iov, keyctl_negate_key,
keyctl_reject_key, keyctl_set_timeout, keyctl_get_persistent,
keyctl_setperm_key): Change to return void.
Update for RVAL_DECODED.
(sys_keyctl): Update callers. Update for RVAL_DECODED.
2015-07-20 00:48:49 +00:00
break ;
2014-02-05 22:41:45 +00:00
case KEYCTL_REVOKE :
case KEYCTL_CLEAR :
case KEYCTL_INVALIDATE :
case KEYCTL_ASSUME_AUTHORITY :
2016-10-03 21:36:03 +03:00
print_keyring_serial_number ( arg2 ) ;
keyctl.c: make use of RVAL_DECODED
* keyctl.c (sys_add_key, sys_request_key): Update for RVAL_DECODED.
(keyctl_join_session_keyring, keyctl_handle_key,
keyctl_set_reqkey_keyring): Remove.
(keyctl_get_keyring_id, keyctl_update_key, keyctl_handle_key_key,
keyctl_read_key, keyctl_keyring_search, keyctl_chown_key,
keyctl_instantiate_key, keyctl_instantiate_key_iov, keyctl_negate_key,
keyctl_reject_key, keyctl_set_timeout, keyctl_get_persistent,
keyctl_setperm_key): Change to return void.
Update for RVAL_DECODED.
(sys_keyctl): Update callers. Update for RVAL_DECODED.
2015-07-20 00:48:49 +00:00
break ;
2014-02-05 22:41:45 +00:00
case KEYCTL_LINK :
case KEYCTL_UNLINK :
2016-10-03 21:36:03 +03:00
keyctl_handle_key_key ( tcp , arg2 , arg3 ) ;
keyctl.c: make use of RVAL_DECODED
* keyctl.c (sys_add_key, sys_request_key): Update for RVAL_DECODED.
(keyctl_join_session_keyring, keyctl_handle_key,
keyctl_set_reqkey_keyring): Remove.
(keyctl_get_keyring_id, keyctl_update_key, keyctl_handle_key_key,
keyctl_read_key, keyctl_keyring_search, keyctl_chown_key,
keyctl_instantiate_key, keyctl_instantiate_key_iov, keyctl_negate_key,
keyctl_reject_key, keyctl_set_timeout, keyctl_get_persistent,
keyctl_setperm_key): Change to return void.
Update for RVAL_DECODED.
(sys_keyctl): Update callers. Update for RVAL_DECODED.
2015-07-20 00:48:49 +00:00
break ;
2014-02-05 22:41:45 +00:00
case KEYCTL_DESCRIBE :
case KEYCTL_READ :
case KEYCTL_GET_SECURITY :
2016-10-03 21:36:03 +03:00
keyctl_read_key ( tcp , arg2 , arg3 , arg4 , cmd ! = KEYCTL_READ ) ;
keyctl.c: make use of RVAL_DECODED
* keyctl.c (sys_add_key, sys_request_key): Update for RVAL_DECODED.
(keyctl_join_session_keyring, keyctl_handle_key,
keyctl_set_reqkey_keyring): Remove.
(keyctl_get_keyring_id, keyctl_update_key, keyctl_handle_key_key,
keyctl_read_key, keyctl_keyring_search, keyctl_chown_key,
keyctl_instantiate_key, keyctl_instantiate_key_iov, keyctl_negate_key,
keyctl_reject_key, keyctl_set_timeout, keyctl_get_persistent,
keyctl_setperm_key): Change to return void.
Update for RVAL_DECODED.
(sys_keyctl): Update callers. Update for RVAL_DECODED.
2015-07-20 00:48:49 +00:00
return 0 ;
2014-02-05 22:41:45 +00:00
case KEYCTL_SEARCH :
2016-10-03 21:36:03 +03:00
keyctl_keyring_search ( tcp , arg2 , arg3 , arg4 , arg5 ) ;
keyctl.c: make use of RVAL_DECODED
* keyctl.c (sys_add_key, sys_request_key): Update for RVAL_DECODED.
(keyctl_join_session_keyring, keyctl_handle_key,
keyctl_set_reqkey_keyring): Remove.
(keyctl_get_keyring_id, keyctl_update_key, keyctl_handle_key_key,
keyctl_read_key, keyctl_keyring_search, keyctl_chown_key,
keyctl_instantiate_key, keyctl_instantiate_key_iov, keyctl_negate_key,
keyctl_reject_key, keyctl_set_timeout, keyctl_get_persistent,
keyctl_setperm_key): Change to return void.
Update for RVAL_DECODED.
(sys_keyctl): Update callers. Update for RVAL_DECODED.
2015-07-20 00:48:49 +00:00
break ;
2014-02-05 22:41:45 +00:00
case KEYCTL_CHOWN :
2016-10-03 21:36:03 +03:00
keyctl_chown_key ( tcp , arg2 , arg3 , arg4 ) ;
keyctl.c: make use of RVAL_DECODED
* keyctl.c (sys_add_key, sys_request_key): Update for RVAL_DECODED.
(keyctl_join_session_keyring, keyctl_handle_key,
keyctl_set_reqkey_keyring): Remove.
(keyctl_get_keyring_id, keyctl_update_key, keyctl_handle_key_key,
keyctl_read_key, keyctl_keyring_search, keyctl_chown_key,
keyctl_instantiate_key, keyctl_instantiate_key_iov, keyctl_negate_key,
keyctl_reject_key, keyctl_set_timeout, keyctl_get_persistent,
keyctl_setperm_key): Change to return void.
Update for RVAL_DECODED.
(sys_keyctl): Update callers. Update for RVAL_DECODED.
2015-07-20 00:48:49 +00:00
break ;
2014-02-05 22:41:45 +00:00
case KEYCTL_SETPERM :
2016-10-03 21:36:03 +03:00
keyctl_setperm_key ( tcp , arg2 , arg3 ) ;
keyctl.c: make use of RVAL_DECODED
* keyctl.c (sys_add_key, sys_request_key): Update for RVAL_DECODED.
(keyctl_join_session_keyring, keyctl_handle_key,
keyctl_set_reqkey_keyring): Remove.
(keyctl_get_keyring_id, keyctl_update_key, keyctl_handle_key_key,
keyctl_read_key, keyctl_keyring_search, keyctl_chown_key,
keyctl_instantiate_key, keyctl_instantiate_key_iov, keyctl_negate_key,
keyctl_reject_key, keyctl_set_timeout, keyctl_get_persistent,
keyctl_setperm_key): Change to return void.
Update for RVAL_DECODED.
(sys_keyctl): Update callers. Update for RVAL_DECODED.
2015-07-20 00:48:49 +00:00
break ;
2014-02-05 22:41:45 +00:00
case KEYCTL_INSTANTIATE :
2016-10-03 21:36:03 +03:00
keyctl_instantiate_key ( tcp , arg2 , arg3 , arg4 , arg5 ) ;
keyctl.c: make use of RVAL_DECODED
* keyctl.c (sys_add_key, sys_request_key): Update for RVAL_DECODED.
(keyctl_join_session_keyring, keyctl_handle_key,
keyctl_set_reqkey_keyring): Remove.
(keyctl_get_keyring_id, keyctl_update_key, keyctl_handle_key_key,
keyctl_read_key, keyctl_keyring_search, keyctl_chown_key,
keyctl_instantiate_key, keyctl_instantiate_key_iov, keyctl_negate_key,
keyctl_reject_key, keyctl_set_timeout, keyctl_get_persistent,
keyctl_setperm_key): Change to return void.
Update for RVAL_DECODED.
(sys_keyctl): Update callers. Update for RVAL_DECODED.
2015-07-20 00:48:49 +00:00
break ;
2014-02-05 22:41:45 +00:00
case KEYCTL_NEGATE :
2016-10-03 21:36:03 +03:00
keyctl_negate_key ( tcp , arg2 , arg3 , arg4 ) ;
keyctl.c: make use of RVAL_DECODED
* keyctl.c (sys_add_key, sys_request_key): Update for RVAL_DECODED.
(keyctl_join_session_keyring, keyctl_handle_key,
keyctl_set_reqkey_keyring): Remove.
(keyctl_get_keyring_id, keyctl_update_key, keyctl_handle_key_key,
keyctl_read_key, keyctl_keyring_search, keyctl_chown_key,
keyctl_instantiate_key, keyctl_instantiate_key_iov, keyctl_negate_key,
keyctl_reject_key, keyctl_set_timeout, keyctl_get_persistent,
keyctl_setperm_key): Change to return void.
Update for RVAL_DECODED.
(sys_keyctl): Update callers. Update for RVAL_DECODED.
2015-07-20 00:48:49 +00:00
break ;
2014-02-05 22:41:45 +00:00
case KEYCTL_SET_REQKEY_KEYRING :
2018-05-21 03:46:48 +02:00
printxvals_ex ( ( int ) arg2 , " KEY_REQKEY_DEFL_??? " ,
XLAT_STYLE_FMT_D , key_reqkeys , NULL ) ;
keyctl.c: make use of RVAL_DECODED
* keyctl.c (sys_add_key, sys_request_key): Update for RVAL_DECODED.
(keyctl_join_session_keyring, keyctl_handle_key,
keyctl_set_reqkey_keyring): Remove.
(keyctl_get_keyring_id, keyctl_update_key, keyctl_handle_key_key,
keyctl_read_key, keyctl_keyring_search, keyctl_chown_key,
keyctl_instantiate_key, keyctl_instantiate_key_iov, keyctl_negate_key,
keyctl_reject_key, keyctl_set_timeout, keyctl_get_persistent,
keyctl_setperm_key): Change to return void.
Update for RVAL_DECODED.
(sys_keyctl): Update callers. Update for RVAL_DECODED.
2015-07-20 00:48:49 +00:00
break ;
2014-02-05 22:41:45 +00:00
case KEYCTL_SET_TIMEOUT :
2016-10-03 21:36:03 +03:00
keyctl_set_timeout ( tcp , arg2 , arg3 ) ;
keyctl.c: make use of RVAL_DECODED
* keyctl.c (sys_add_key, sys_request_key): Update for RVAL_DECODED.
(keyctl_join_session_keyring, keyctl_handle_key,
keyctl_set_reqkey_keyring): Remove.
(keyctl_get_keyring_id, keyctl_update_key, keyctl_handle_key_key,
keyctl_read_key, keyctl_keyring_search, keyctl_chown_key,
keyctl_instantiate_key, keyctl_instantiate_key_iov, keyctl_negate_key,
keyctl_reject_key, keyctl_set_timeout, keyctl_get_persistent,
keyctl_setperm_key): Change to return void.
Update for RVAL_DECODED.
(sys_keyctl): Update callers. Update for RVAL_DECODED.
2015-07-20 00:48:49 +00:00
break ;
2014-02-05 22:41:45 +00:00
case KEYCTL_SESSION_TO_PARENT :
keyctl.c: make use of RVAL_DECODED
* keyctl.c (sys_add_key, sys_request_key): Update for RVAL_DECODED.
(keyctl_join_session_keyring, keyctl_handle_key,
keyctl_set_reqkey_keyring): Remove.
(keyctl_get_keyring_id, keyctl_update_key, keyctl_handle_key_key,
keyctl_read_key, keyctl_keyring_search, keyctl_chown_key,
keyctl_instantiate_key, keyctl_instantiate_key_iov, keyctl_negate_key,
keyctl_reject_key, keyctl_set_timeout, keyctl_get_persistent,
keyctl_setperm_key): Change to return void.
Update for RVAL_DECODED.
(sys_keyctl): Update callers. Update for RVAL_DECODED.
2015-07-20 00:48:49 +00:00
break ;
2014-02-05 22:41:45 +00:00
case KEYCTL_REJECT :
2016-10-03 21:36:03 +03:00
keyctl_reject_key ( tcp , arg2 , arg3 , arg4 , arg5 ) ;
keyctl.c: make use of RVAL_DECODED
* keyctl.c (sys_add_key, sys_request_key): Update for RVAL_DECODED.
(keyctl_join_session_keyring, keyctl_handle_key,
keyctl_set_reqkey_keyring): Remove.
(keyctl_get_keyring_id, keyctl_update_key, keyctl_handle_key_key,
keyctl_read_key, keyctl_keyring_search, keyctl_chown_key,
keyctl_instantiate_key, keyctl_instantiate_key_iov, keyctl_negate_key,
keyctl_reject_key, keyctl_set_timeout, keyctl_get_persistent,
keyctl_setperm_key): Change to return void.
Update for RVAL_DECODED.
(sys_keyctl): Update callers. Update for RVAL_DECODED.
2015-07-20 00:48:49 +00:00
break ;
2014-02-05 22:41:45 +00:00
case KEYCTL_INSTANTIATE_IOV :
2016-10-03 21:36:03 +03:00
keyctl_instantiate_key_iov ( tcp , arg2 , arg3 , arg4 , arg5 ) ;
keyctl.c: make use of RVAL_DECODED
* keyctl.c (sys_add_key, sys_request_key): Update for RVAL_DECODED.
(keyctl_join_session_keyring, keyctl_handle_key,
keyctl_set_reqkey_keyring): Remove.
(keyctl_get_keyring_id, keyctl_update_key, keyctl_handle_key_key,
keyctl_read_key, keyctl_keyring_search, keyctl_chown_key,
keyctl_instantiate_key, keyctl_instantiate_key_iov, keyctl_negate_key,
keyctl_reject_key, keyctl_set_timeout, keyctl_get_persistent,
keyctl_setperm_key): Change to return void.
Update for RVAL_DECODED.
(sys_keyctl): Update callers. Update for RVAL_DECODED.
2015-07-20 00:48:49 +00:00
break ;
2014-02-05 22:41:45 +00:00
case KEYCTL_GET_PERSISTENT :
2016-10-03 21:36:03 +03:00
keyctl_get_persistent ( tcp , arg2 , arg3 ) ;
keyctl.c: make use of RVAL_DECODED
* keyctl.c (sys_add_key, sys_request_key): Update for RVAL_DECODED.
(keyctl_join_session_keyring, keyctl_handle_key,
keyctl_set_reqkey_keyring): Remove.
(keyctl_get_keyring_id, keyctl_update_key, keyctl_handle_key_key,
keyctl_read_key, keyctl_keyring_search, keyctl_chown_key,
keyctl_instantiate_key, keyctl_instantiate_key_iov, keyctl_negate_key,
keyctl_reject_key, keyctl_set_timeout, keyctl_get_persistent,
keyctl_setperm_key): Change to return void.
Update for RVAL_DECODED.
(sys_keyctl): Update callers. Update for RVAL_DECODED.
2015-07-20 00:48:49 +00:00
break ;
2014-02-05 22:41:45 +00:00
2016-10-03 21:35:24 +03:00
case KEYCTL_DH_COMPUTE :
2017-09-01 16:14:25 +02:00
keyctl_dh_compute ( tcp , arg2 , arg3 , arg4 , arg5 ) ;
2016-10-03 21:35:24 +03:00
return 0 ;
2017-07-21 11:07:55 +00:00
case KEYCTL_RESTRICT_KEYRING :
keyctl_restrict_keyring ( tcp , arg2 , arg3 , arg4 ) ;
break ;
2014-02-05 22:41:45 +00:00
default :
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 " , %# " PRI_klx
" , %# " PRI_klx " , %# " PRI_klx ,
arg2 , arg3 , arg4 , arg5 ) ;
keyctl.c: make use of RVAL_DECODED
* keyctl.c (sys_add_key, sys_request_key): Update for RVAL_DECODED.
(keyctl_join_session_keyring, keyctl_handle_key,
keyctl_set_reqkey_keyring): Remove.
(keyctl_get_keyring_id, keyctl_update_key, keyctl_handle_key_key,
keyctl_read_key, keyctl_keyring_search, keyctl_chown_key,
keyctl_instantiate_key, keyctl_instantiate_key_iov, keyctl_negate_key,
keyctl_reject_key, keyctl_set_timeout, keyctl_get_persistent,
keyctl_setperm_key): Change to return void.
Update for RVAL_DECODED.
(sys_keyctl): Update callers. Update for RVAL_DECODED.
2015-07-20 00:48:49 +00:00
break ;
2014-02-05 22:41:45 +00:00
}
keyctl.c: make use of RVAL_DECODED
* keyctl.c (sys_add_key, sys_request_key): Update for RVAL_DECODED.
(keyctl_join_session_keyring, keyctl_handle_key,
keyctl_set_reqkey_keyring): Remove.
(keyctl_get_keyring_id, keyctl_update_key, keyctl_handle_key_key,
keyctl_read_key, keyctl_keyring_search, keyctl_chown_key,
keyctl_instantiate_key, keyctl_instantiate_key_iov, keyctl_negate_key,
keyctl_reject_key, keyctl_set_timeout, keyctl_get_persistent,
keyctl_setperm_key): Change to return void.
Update for RVAL_DECODED.
(sys_keyctl): Update callers. Update for RVAL_DECODED.
2015-07-20 00:48:49 +00:00
return RVAL_DECODED ;
2014-02-05 22:41:45 +00:00
}