All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] seccomp: don't block getters for resource control syscalls
@ 2021-06-30 16:05 Daniel P. Berrangé
  2021-06-30 17:13 ` Dr. David Alan Gilbert
  2021-07-01  7:15 ` Eduardo Otubo
  0 siblings, 2 replies; 3+ messages in thread
From: Daniel P. Berrangé @ 2021-06-30 16:05 UTC (permalink / raw)
  To: qemu-devel
  Cc: Eduardo Otubo, Florian Weimer, Daniel P. Berrangé,
	Dr . David Alan Gilbert

Recent GLibC calls sched_getaffinity in code paths related to malloc and
when QEMU blocks access, it sends it off into a bad codepath resulting
in stack exhaustion[1]. The GLibC bug is being fixed[2], but none the
less, GLibC has valid reasons to want to use sched_getaffinity.

It is not unreasonable for code to want to run many resource syscalls
for information gathering, so it is a bit too harsh for QEMU to block
them.

[1] https://bugzilla.redhat.com/show_bug.cgi?id=1975693
[2] https://sourceware.org/pipermail/libc-alpha/2021-June/128271.html
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
---
 softmmu/qemu-seccomp.c | 6 ------
 1 file changed, 6 deletions(-)

diff --git a/softmmu/qemu-seccomp.c b/softmmu/qemu-seccomp.c
index 9c29d9cf00..f50026778c 100644
--- a/softmmu/qemu-seccomp.c
+++ b/softmmu/qemu-seccomp.c
@@ -97,17 +97,11 @@ static const struct QemuSeccompSyscall denylist[] = {
     { SCMP_SYS(vfork),                  QEMU_SECCOMP_SET_SPAWN },
     { SCMP_SYS(execve),                 QEMU_SECCOMP_SET_SPAWN },
     /* resource control */
-    { SCMP_SYS(getpriority),            QEMU_SECCOMP_SET_RESOURCECTL },
     { SCMP_SYS(setpriority),            QEMU_SECCOMP_SET_RESOURCECTL },
     { SCMP_SYS(sched_setparam),         QEMU_SECCOMP_SET_RESOURCECTL },
-    { SCMP_SYS(sched_getparam),         QEMU_SECCOMP_SET_RESOURCECTL },
     { SCMP_SYS(sched_setscheduler),     QEMU_SECCOMP_SET_RESOURCECTL,
       ARRAY_SIZE(sched_setscheduler_arg), sched_setscheduler_arg },
-    { SCMP_SYS(sched_getscheduler),     QEMU_SECCOMP_SET_RESOURCECTL },
     { SCMP_SYS(sched_setaffinity),      QEMU_SECCOMP_SET_RESOURCECTL },
-    { SCMP_SYS(sched_getaffinity),      QEMU_SECCOMP_SET_RESOURCECTL },
-    { SCMP_SYS(sched_get_priority_max), QEMU_SECCOMP_SET_RESOURCECTL },
-    { SCMP_SYS(sched_get_priority_min), QEMU_SECCOMP_SET_RESOURCECTL },
 };
 
 static inline __attribute__((unused)) int
-- 
2.31.1



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] seccomp: don't block getters for resource control syscalls
  2021-06-30 16:05 [PATCH] seccomp: don't block getters for resource control syscalls Daniel P. Berrangé
@ 2021-06-30 17:13 ` Dr. David Alan Gilbert
  2021-07-01  7:15 ` Eduardo Otubo
  1 sibling, 0 replies; 3+ messages in thread
From: Dr. David Alan Gilbert @ 2021-06-30 17:13 UTC (permalink / raw)
  To: Daniel P. Berrangé; +Cc: Eduardo Otubo, Florian Weimer, qemu-devel

* Daniel P. Berrangé (berrange@redhat.com) wrote:
> Recent GLibC calls sched_getaffinity in code paths related to malloc and
> when QEMU blocks access, it sends it off into a bad codepath resulting
> in stack exhaustion[1]. The GLibC bug is being fixed[2], but none the
> less, GLibC has valid reasons to want to use sched_getaffinity.
> 
> It is not unreasonable for code to want to run many resource syscalls
> for information gathering, so it is a bit too harsh for QEMU to block
> them.
> 
> [1] https://bugzilla.redhat.com/show_bug.cgi?id=1975693
> [2] https://sourceware.org/pipermail/libc-alpha/2021-June/128271.html
> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>

Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>

> ---
>  softmmu/qemu-seccomp.c | 6 ------
>  1 file changed, 6 deletions(-)
> 
> diff --git a/softmmu/qemu-seccomp.c b/softmmu/qemu-seccomp.c
> index 9c29d9cf00..f50026778c 100644
> --- a/softmmu/qemu-seccomp.c
> +++ b/softmmu/qemu-seccomp.c
> @@ -97,17 +97,11 @@ static const struct QemuSeccompSyscall denylist[] = {
>      { SCMP_SYS(vfork),                  QEMU_SECCOMP_SET_SPAWN },
>      { SCMP_SYS(execve),                 QEMU_SECCOMP_SET_SPAWN },
>      /* resource control */
> -    { SCMP_SYS(getpriority),            QEMU_SECCOMP_SET_RESOURCECTL },
>      { SCMP_SYS(setpriority),            QEMU_SECCOMP_SET_RESOURCECTL },
>      { SCMP_SYS(sched_setparam),         QEMU_SECCOMP_SET_RESOURCECTL },
> -    { SCMP_SYS(sched_getparam),         QEMU_SECCOMP_SET_RESOURCECTL },
>      { SCMP_SYS(sched_setscheduler),     QEMU_SECCOMP_SET_RESOURCECTL,
>        ARRAY_SIZE(sched_setscheduler_arg), sched_setscheduler_arg },
> -    { SCMP_SYS(sched_getscheduler),     QEMU_SECCOMP_SET_RESOURCECTL },
>      { SCMP_SYS(sched_setaffinity),      QEMU_SECCOMP_SET_RESOURCECTL },
> -    { SCMP_SYS(sched_getaffinity),      QEMU_SECCOMP_SET_RESOURCECTL },
> -    { SCMP_SYS(sched_get_priority_max), QEMU_SECCOMP_SET_RESOURCECTL },
> -    { SCMP_SYS(sched_get_priority_min), QEMU_SECCOMP_SET_RESOURCECTL },
>  };
>  
>  static inline __attribute__((unused)) int
> -- 
> 2.31.1
> 
-- 
Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] seccomp: don't block getters for resource control syscalls
  2021-06-30 16:05 [PATCH] seccomp: don't block getters for resource control syscalls Daniel P. Berrangé
  2021-06-30 17:13 ` Dr. David Alan Gilbert
@ 2021-07-01  7:15 ` Eduardo Otubo
  1 sibling, 0 replies; 3+ messages in thread
From: Eduardo Otubo @ 2021-07-01  7:15 UTC (permalink / raw)
  To: Daniel P. Berrangé
  Cc: Florian Weimer, qemu-devel, Dr . David Alan Gilbert

[-- Attachment #1: Type: text/plain, Size: 2152 bytes --]

On 30/06/2021 - 17:05:26, Daniel P. Berrange wrote:
> Recent GLibC calls sched_getaffinity in code paths related to malloc and
> when QEMU blocks access, it sends it off into a bad codepath resulting
> in stack exhaustion[1]. The GLibC bug is being fixed[2], but none the
> less, GLibC has valid reasons to want to use sched_getaffinity.
> 
> It is not unreasonable for code to want to run many resource syscalls
> for information gathering, so it is a bit too harsh for QEMU to block
> them.
> 
> [1] https://bugzilla.redhat.com/show_bug.cgi?id=1975693
> [2] https://sourceware.org/pipermail/libc-alpha/2021-June/128271.html
> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
> ---
>  softmmu/qemu-seccomp.c | 6 ------
>  1 file changed, 6 deletions(-)
> 
> diff --git a/softmmu/qemu-seccomp.c b/softmmu/qemu-seccomp.c
> index 9c29d9cf00..f50026778c 100644
> --- a/softmmu/qemu-seccomp.c
> +++ b/softmmu/qemu-seccomp.c
> @@ -97,17 +97,11 @@ static const struct QemuSeccompSyscall denylist[] = {
>      { SCMP_SYS(vfork),                  QEMU_SECCOMP_SET_SPAWN },
>      { SCMP_SYS(execve),                 QEMU_SECCOMP_SET_SPAWN },
>      /* resource control */
> -    { SCMP_SYS(getpriority),            QEMU_SECCOMP_SET_RESOURCECTL },
>      { SCMP_SYS(setpriority),            QEMU_SECCOMP_SET_RESOURCECTL },
>      { SCMP_SYS(sched_setparam),         QEMU_SECCOMP_SET_RESOURCECTL },
> -    { SCMP_SYS(sched_getparam),         QEMU_SECCOMP_SET_RESOURCECTL },
>      { SCMP_SYS(sched_setscheduler),     QEMU_SECCOMP_SET_RESOURCECTL,
>        ARRAY_SIZE(sched_setscheduler_arg), sched_setscheduler_arg },
> -    { SCMP_SYS(sched_getscheduler),     QEMU_SECCOMP_SET_RESOURCECTL },
>      { SCMP_SYS(sched_setaffinity),      QEMU_SECCOMP_SET_RESOURCECTL },
> -    { SCMP_SYS(sched_getaffinity),      QEMU_SECCOMP_SET_RESOURCECTL },
> -    { SCMP_SYS(sched_get_priority_max), QEMU_SECCOMP_SET_RESOURCECTL },
> -    { SCMP_SYS(sched_get_priority_min), QEMU_SECCOMP_SET_RESOURCECTL },
>  };
>  
>  static inline __attribute__((unused)) int
> -- 
> 2.31.1
> 

Acked-by: Eduardo Otubo <otubo@redhat.com>

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-07-01  7:16 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-30 16:05 [PATCH] seccomp: don't block getters for resource control syscalls Daniel P. Berrangé
2021-06-30 17:13 ` Dr. David Alan Gilbert
2021-07-01  7:15 ` Eduardo Otubo

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.