qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 2/6] linux-user: Disable more prctl subcodes


From: Laurent Vivier
Subject: Re: [PATCH 2/6] linux-user: Disable more prctl subcodes
Date: Wed, 22 Dec 2021 21:50:44 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.4.0

Le 20/12/2021 à 23:41, Philippe Mathieu-Daudé a écrit :
On 12/20/21 22:41, Richard Henderson wrote:
Create a list of subcodes that we want to pass on, a list of
subcodes that should not be passed on because they would affect
the running qemu itself, and a list that probably could be
implemented but require extra work. Do not pass on unknown subcodes.

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

+    case PR_SET_SYSCALL_USER_DISPATCH:
+    case PR_GET_THP_DISABLE:
+    case PR_SET_THP_DISABLE:
+    case PR_GET_TSC:
+    case PR_SET_TSC:
+    case PR_GET_UNALIGN:
+    case PR_SET_UNALIGN:
      default:

Unfortunately prctl values are not enumerated, so we can't remove
the default case to catch new values at build time.

Maybe a qemu_log_mask(LOG_UNIMP) call would help here? (only

Yes, I think a qemu_log_mask(LOG_UNIMP) for the default case would help.
for default?)

Regardless:
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>

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


-        /* Most prctl options have no pointer arguments */
-        return get_errno(prctl(option, arg2, arg3, arg4, arg5));
+        /* Disable to prevent the target disabling stuff we need. */
+        return -TARGET_EINVAL;
      }
  }





reply via email to

[Prev in Thread] Current Thread [Next in Thread]