qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
To: "Daniel P. Berrangé" <berrange@redhat.com>
Cc: Eduardo Otubo <otubo@redhat.com>,
	Florian Weimer <fweimer@redhat.com>,
	qemu-devel@nongnu.org
Subject: Re: [PATCH] seccomp: don't block getters for resource control syscalls
Date: Wed, 30 Jun 2021 18:13:17 +0100	[thread overview]
Message-ID: <YNymLV4m+B58rvek@work-vm> (raw)
In-Reply-To: <20210630160526.977225-1-berrange@redhat.com>

* 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



  reply	other threads:[~2021-06-30 17:14 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
2021-07-01  7:15 ` Eduardo Otubo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YNymLV4m+B58rvek@work-vm \
    --to=dgilbert@redhat.com \
    --cc=berrange@redhat.com \
    --cc=fweimer@redhat.com \
    --cc=otubo@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).