diff mbox series

virtiofsd: Add restart_syscall to the seccomp whitelist

Message ID 20210201193305.136390-1-groug@kaod.org (mailing list archive)
State New, archived
Headers show
Series virtiofsd: Add restart_syscall to the seccomp whitelist | expand

Commit Message

Greg Kurz Feb. 1, 2021, 7:33 p.m. UTC
This is how linux restarts some system calls after SIGSTOP/SIGCONT.
This is needed to avoid virtiofsd termination when resuming execution
under GDB for example.

Signed-off-by: Greg Kurz <groug@kaod.org>
---

This has passed Travis and gitlab CI without errors.

 tools/virtiofsd/passthrough_seccomp.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Dr. David Alan Gilbert Feb. 1, 2021, 7:52 p.m. UTC | #1
* Greg Kurz (groug@kaod.org) wrote:
> This is how linux restarts some system calls after SIGSTOP/SIGCONT.
> This is needed to avoid virtiofsd termination when resuming execution
> under GDB for example.

Ah!


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

> Signed-off-by: Greg Kurz <groug@kaod.org>
> ---
> 
> This has passed Travis and gitlab CI without errors.
> 
>  tools/virtiofsd/passthrough_seccomp.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/tools/virtiofsd/passthrough_seccomp.c b/tools/virtiofsd/passthrough_seccomp.c
> index a60d7da4b4e2..da03e97d35e4 100644
> --- a/tools/virtiofsd/passthrough_seccomp.c
> +++ b/tools/virtiofsd/passthrough_seccomp.c
> @@ -88,6 +88,7 @@ static const int syscall_whitelist[] = {
>      SCMP_SYS(renameat),
>      SCMP_SYS(renameat2),
>      SCMP_SYS(removexattr),
> +    SCMP_SYS(restart_syscall),
>      SCMP_SYS(rt_sigaction),
>      SCMP_SYS(rt_sigprocmask),
>      SCMP_SYS(rt_sigreturn),
> -- 
> 2.26.2
>
Stefan Hajnoczi Feb. 3, 2021, 2:27 p.m. UTC | #2
On Mon, Feb 01, 2021 at 08:33:05PM +0100, Greg Kurz wrote:
> This is how linux restarts some system calls after SIGSTOP/SIGCONT.
> This is needed to avoid virtiofsd termination when resuming execution
> under GDB for example.
> 
> Signed-off-by: Greg Kurz <groug@kaod.org>
> ---
> 
> This has passed Travis and gitlab CI without errors.
> 
>  tools/virtiofsd/passthrough_seccomp.c | 1 +
>  1 file changed, 1 insertion(+)

Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
diff mbox series

Patch

diff --git a/tools/virtiofsd/passthrough_seccomp.c b/tools/virtiofsd/passthrough_seccomp.c
index a60d7da4b4e2..da03e97d35e4 100644
--- a/tools/virtiofsd/passthrough_seccomp.c
+++ b/tools/virtiofsd/passthrough_seccomp.c
@@ -88,6 +88,7 @@  static const int syscall_whitelist[] = {
     SCMP_SYS(renameat),
     SCMP_SYS(renameat2),
     SCMP_SYS(removexattr),
+    SCMP_SYS(restart_syscall),
     SCMP_SYS(rt_sigaction),
     SCMP_SYS(rt_sigprocmask),
     SCMP_SYS(rt_sigreturn),