diff mbox series

[4/4] linux-user: Implement capability prctls

Message ID 20220106225738.103012-5-richard.henderson@linaro.org
State New
Headers show
Series linux-user: prctl follow-ups | expand

Commit Message

Richard Henderson Jan. 6, 2022, 10:57 p.m. UTC
This is PR_CAPBSET_READ, PR_CAPBSET_DROP and the "legacy"
PR_CAP_AMBIENT PR_GET_SECUREBITS, PR_SET_SECUREBITS.

All of these arguments are integer values only, and do not
require mapping of values between host and guest.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 linux-user/syscall.c | 5 +++++
 1 file changed, 5 insertions(+)

Comments

Laurent Vivier Jan. 8, 2022, 5:17 p.m. UTC | #1
Le 06/01/2022 à 23:57, Richard Henderson a écrit :
> This is PR_CAPBSET_READ, PR_CAPBSET_DROP and the "legacy"
> PR_CAP_AMBIENT PR_GET_SECUREBITS, PR_SET_SECUREBITS.
> 
> All of these arguments are integer values only, and do not
> require mapping of values between host and guest.
> 
> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
> ---
>   linux-user/syscall.c | 5 +++++
>   1 file changed, 5 insertions(+)
> 
> diff --git a/linux-user/syscall.c b/linux-user/syscall.c
> index 8495f5e08e..4711afaf8c 100644
> --- a/linux-user/syscall.c
> +++ b/linux-user/syscall.c
> @@ -6504,10 +6504,15 @@ static abi_long do_prctl(CPUArchState *env, abi_long option, abi_long arg2,
>       case PR_SET_UNALIGN:
>           return do_prctl_set_unalign(env, arg2);
>   
> +    case PR_CAP_AMBIENT:
> +    case PR_CAPBSET_READ:
> +    case PR_CAPBSET_DROP:
>       case PR_GET_DUMPABLE:
>       case PR_SET_DUMPABLE:
>       case PR_GET_KEEPCAPS:
>       case PR_SET_KEEPCAPS:
> +    case PR_GET_SECUREBITS:
> +    case PR_SET_SECUREBITS:
>       case PR_GET_TIMING:
>       case PR_SET_TIMING:
>       case PR_GET_TIMERSLACK:

Reviewed-by: Laurent Vivier <laurent@vivier.eu>
diff mbox series

Patch

diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 8495f5e08e..4711afaf8c 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -6504,10 +6504,15 @@  static abi_long do_prctl(CPUArchState *env, abi_long option, abi_long arg2,
     case PR_SET_UNALIGN:
         return do_prctl_set_unalign(env, arg2);
 
+    case PR_CAP_AMBIENT:
+    case PR_CAPBSET_READ:
+    case PR_CAPBSET_DROP:
     case PR_GET_DUMPABLE:
     case PR_SET_DUMPABLE:
     case PR_GET_KEEPCAPS:
     case PR_SET_KEEPCAPS:
+    case PR_GET_SECUREBITS:
+    case PR_SET_SECUREBITS:
     case PR_GET_TIMING:
     case PR_SET_TIMING:
     case PR_GET_TIMERSLACK: