2015-12-17 20:56:48 +03:00
/*
* Copyright ( c ) 2014 - 2015 Dmitry V . Levin < ldv @ altlinux . org >
2017-05-22 20:14:52 +03:00
* Copyright ( c ) 2014 - 2017 The strace developers .
2015-12-17 20:56:48 +03:00
* 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-02-06 02:41:45 +04:00
# include "defs.h"
2017-09-01 17:14:25 +03:00
# include "keyctl_kdf_params.h"
# include "print_fields.h"
2014-02-06 02:41:45 +04:00
typedef int32_t key_serial_t ;
2014-04-26 03:30:54 +04:00
# include "xlat/key_spec.h"
2014-02-06 02:41:45 +04:00
2016-10-03 21:35:24 +03:00
struct keyctl_dh_params {
int32_t private ;
int32_t prime ;
int32_t base ;
} ;
2014-02-06 02:41:45 +04:00
static void
print_keyring_serial_number ( key_serial_t id )
{
2016-05-15 00:46:05 +03:00
const char * str = xlookup ( key_spec , ( unsigned int ) id ) ;
2014-02-06 02:41:45 +04:00
if ( str )
tprints ( str ) ;
else
tprintf ( " %d " , id ) ;
}
2015-04-07 04:36:50 +03:00
SYS_FUNC ( add_key )
2014-02-06 02:41:45 +04: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 03:48:49 +03:00
/* type */
2016-12-20 19:43:26 +03: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 03:48:49 +03:00
/* description */
tprints ( " , " ) ;
2016-12-20 19:43:26 +03: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 03:48:49 +03:00
/* payload */
tprints ( " , " ) ;
2016-12-20 19:43:26 +03: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 03:48:49 +03:00
/* payload length */
2016-12-26 13:16:35 +03: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 03:48:49 +03:00
/* keyring serial number */
print_keyring_serial_number ( tcp - > u_arg [ 4 ] ) ;
return RVAL_DECODED ;
2014-02-06 02:41:45 +04:00
}
2015-04-07 04:36:50 +03:00
SYS_FUNC ( request_key )
2014-02-06 02:41:45 +04: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 03:48:49 +03:00
/* type */
2016-12-20 19:43:26 +03: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 03:48:49 +03:00
/* description */
tprints ( " , " ) ;
2016-12-20 19:43:26 +03: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 03:48:49 +03:00
/* callout_info */
tprints ( " , " ) ;
2016-12-20 19:43:26 +03: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 03:48:49 +03:00
/* keyring serial number */
tprints ( " , " ) ;
print_keyring_serial_number ( tcp - > u_arg [ 3 ] ) ;
return RVAL_DECODED ;
2014-02-06 02:41:45 +04: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 03:48:49 +03:00
static void
2014-02-06 02:41:45 +04: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 03:48:49 +03:00
print_keyring_serial_number ( id ) ;
tprintf ( " , %d " , create ) ;
2014-02-06 02:41:45 +04: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 03:48:49 +03: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-06 02:41:45 +04: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 03:48:49 +03:00
print_keyring_serial_number ( id ) ;
tprints ( " , " ) ;
2016-12-20 19:43:26 +03:00
printstrn ( tcp , addr , len ) ;
2016-10-03 21:36:03 +03:00
tprintf ( " , %llu " , zero_extend_signed_to_ull ( len ) ) ;
2014-02-06 02:41:45 +04: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 03:48:49 +03:00
static void
2014-02-06 02:41:45 +04: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 03:48:49 +03:00
print_keyring_serial_number ( id1 ) ;
tprints ( " , " ) ;
print_keyring_serial_number ( id2 ) ;
2014-02-06 02:41:45 +04: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 03:48:49 +03: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-06 02:41:45 +04:00
{
if ( entering ( tcp ) ) {
print_keyring_serial_number ( id ) ;
tprints ( " , " ) ;
} else {
2015-07-20 03:26:23 +03:00
if ( syserror ( tcp ) )
printaddr ( addr ) ;
2014-02-06 02:41:45 +04: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-06 02:41:45 +04:00
}
2016-10-03 21:36:03 +03:00
tprintf ( " , %llu " , zero_extend_signed_to_ull ( len ) ) ;
2014-02-06 02:41:45 +04: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 03:48:49 +03: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-06 02:41:45 +04: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 03:48:49 +03:00
print_keyring_serial_number ( id1 ) ;
tprints ( " , " ) ;
2016-12-20 19:43:26 +03: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 03:48:49 +03:00
tprints ( " , " ) ;
2016-12-20 19:43:26 +03: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 03:48:49 +03:00
tprints ( " , " ) ;
print_keyring_serial_number ( id2 ) ;
2014-02-06 02:41:45 +04: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 03:48:49 +03: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-06 02:41:45 +04: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 03:48:49 +03:00
print_keyring_serial_number ( id ) ;
2016-09-29 15:56:02 +03:00
printuid ( " , " , user ) ;
printuid ( " , " , group ) ;
2014-02-06 02:41:45 +04: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 03:48:49 +03: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-06 02:41:45 +04: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 03:48:49 +03:00
print_keyring_serial_number ( id1 ) ;
tprints ( " , " ) ;
2016-12-20 19:43:26 +03: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 03:48:49 +03:00
print_keyring_serial_number ( id2 ) ;
2014-02-06 02:41:45 +04: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 03:48:49 +03:00
static void
2014-02-06 02:41:45 +04: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-06 02:41:45 +04: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 03:48:49 +03:00
print_keyring_serial_number ( id1 ) ;
tprints ( " , " ) ;
2016-06-22 16:27:03 +03: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 03:48:49 +03:00
print_keyring_serial_number ( id2 ) ;
2014-02-06 02:41:45 +04: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 03:48:49 +03:00
static void
2014-02-06 02:41:45 +04: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 03:48:49 +03:00
print_keyring_serial_number ( id1 ) ;
tprintf ( " , %u, " , timeout ) ;
print_keyring_serial_number ( id2 ) ;
2014-02-06 02:41:45 +04: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 03:48:49 +03:00
static void
2014-02-06 02:41:45 +04: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 03:48:49 +03:00
print_keyring_serial_number ( id1 ) ;
2016-09-29 15:56:35 +03:00
tprintf ( " , %u, " , timeout ) ;
if ( err_str )
tprintf ( " %s, " , err_str ) ;
else
tprintf ( " %u, " , 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 03:48:49 +03:00
print_keyring_serial_number ( id2 ) ;
2014-02-06 02:41:45 +04: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 03:48:49 +03:00
static void
2014-02-06 02:41:45 +04: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 03:48:49 +03:00
print_keyring_serial_number ( id ) ;
tprintf ( " , %u " , timeout ) ;
2014-02-06 02:41:45 +04: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 03:48:49 +03: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-06 02:41:45 +04: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 03:48:49 +03:00
print_keyring_serial_number ( id ) ;
2014-02-06 02:41:45 +04:00
}
2014-04-26 03:30:54 +04:00
# include "xlat/key_perms.h"
2014-02-06 02:41:45 +04: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 03:48:49 +03:00
static void
2014-02-06 02:41:45 +04: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 03:48:49 +03:00
print_keyring_serial_number ( id ) ;
tprints ( " , " ) ;
printflags ( key_perms , perm , " KEY_??? " ) ;
2014-02-06 02:41:45 +04: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 17:14:25 +03: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 17:14:25 +03: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 19:43:26 +03:00
printstrn ( tcp , buf , rval ) ;
2016-10-03 21:35:24 +03:00
}
2017-09-01 17:14:25 +03: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 14:07:55 +03: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-26 03:30:54 +04:00
# include "xlat/key_reqkeys.h"
# include "xlat/keyctl_commands.h"
2014-02-06 02:41:45 +04:00
2015-04-07 04:36:50 +03:00
SYS_FUNC ( keyctl )
2014-02-06 02:41:45 +04: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-06 02:41:45 +04: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 03:48:49 +03:00
if ( entering ( tcp ) ) {
2014-02-06 02:41:45 +04: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 03:48:49 +03:00
}
2014-02-06 02:41:45 +04: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 03:48:49 +03:00
break ;
2014-02-06 02:41:45 +04:00
case KEYCTL_JOIN_SESSION_KEYRING :
2016-12-20 19:43:26 +03: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 03:48:49 +03:00
break ;
2014-02-06 02:41:45 +04: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 03:48:49 +03:00
break ;
2014-02-06 02:41:45 +04: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 03:48:49 +03:00
break ;
2014-02-06 02:41:45 +04: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 03:48:49 +03:00
break ;
2014-02-06 02:41:45 +04: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 03:48:49 +03:00
return 0 ;
2014-02-06 02:41:45 +04: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 03:48:49 +03:00
break ;
2014-02-06 02:41:45 +04: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 03:48:49 +03:00
break ;
2014-02-06 02:41:45 +04: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 03:48:49 +03:00
break ;
2014-02-06 02:41:45 +04: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 03:48:49 +03:00
break ;
2014-02-06 02:41:45 +04: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 03:48:49 +03:00
break ;
2014-02-06 02:41:45 +04:00
case KEYCTL_SET_REQKEY_KEYRING :
2016-10-03 21:36:03 +03:00
printxval ( key_reqkeys , arg2 , " KEY_REQKEY_DEFL_??? " ) ;
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 03:48:49 +03:00
break ;
2014-02-06 02:41:45 +04: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 03:48:49 +03:00
break ;
2014-02-06 02:41:45 +04: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 03:48:49 +03:00
break ;
2014-02-06 02:41:45 +04: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 03:48:49 +03:00
break ;
2014-02-06 02:41:45 +04: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 03:48:49 +03:00
break ;
2014-02-06 02:41:45 +04: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 03:48:49 +03:00
break ;
2014-02-06 02:41:45 +04:00
2016-10-03 21:35:24 +03:00
case KEYCTL_DH_COMPUTE :
2017-09-01 17:14:25 +03:00
keyctl_dh_compute ( tcp , arg2 , arg3 , arg4 , arg5 ) ;
2016-10-03 21:35:24 +03:00
return 0 ;
2017-07-21 14:07:55 +03:00
case KEYCTL_RESTRICT_KEYRING :
keyctl_restrict_keyring ( tcp , arg2 , arg3 , arg4 ) ;
break ;
2014-02-06 02:41:45 +04: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 19:56:45 +03: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 03:48:49 +03:00
break ;
2014-02-06 02:41:45 +04: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 03:48:49 +03:00
return RVAL_DECODED ;
2014-02-06 02:41:45 +04:00
}