Patchwork seccomp: exit if seccomp_init() fails

login
register
mail settings
Submitter Corey Bryant
Date Dec. 18, 2013, 4:48 p.m.
Message ID <1387385291-7825-1-git-send-email-coreyb@linux.vnet.ibm.com>
Download mbox | patch
Permalink /patch/302978/
State New
Headers show

Comments

Corey Bryant - Dec. 18, 2013, 4:48 p.m.
This fixes a bug where we weren't exiting if seccomp_init() failed.

Signed-off-by: Corey Bryant <coreyb@linux.vnet.ibm.com>
---
 qemu-seccomp.c | 1 +
 1 file changed, 1 insertion(+)
Eduardo Otubo - Dec. 19, 2013, 11:35 a.m.
On 12/18/2013 02:48 PM, Corey Bryant wrote:
> This fixes a bug where we weren't exiting if seccomp_init() failed.
>
> Signed-off-by: Corey Bryant <coreyb@linux.vnet.ibm.com>
> ---
>   qemu-seccomp.c | 1 +
>   1 file changed, 1 insertion(+)
>
> diff --git a/qemu-seccomp.c b/qemu-seccomp.c
> index cf07869..b7c1253 100644
> --- a/qemu-seccomp.c
> +++ b/qemu-seccomp.c
> @@ -231,6 +231,7 @@ int seccomp_start(void)
>
>       ctx = seccomp_init(SCMP_ACT_KILL);
>       if (ctx == NULL) {
> +        rc = -1;
>           goto seccomp_return;
>       }
>

ACK.

Reviewed-by: Eduardo Otubo <otubo@linux.vnet.ibm.com>
Paul Moore - Dec. 19, 2013, 3:59 p.m.
On Wednesday, December 18, 2013 11:48:11 AM Corey Bryant wrote:
> This fixes a bug where we weren't exiting if seccomp_init() failed.
> 
> Signed-off-by: Corey Bryant <coreyb@linux.vnet.ibm.com>
> ---
>  qemu-seccomp.c | 1 +
>  1 file changed, 1 insertion(+)

Acked-by: Paul Moore <pmoore@redhat.com>
 
> diff --git a/qemu-seccomp.c b/qemu-seccomp.c
> index cf07869..b7c1253 100644
> --- a/qemu-seccomp.c
> +++ b/qemu-seccomp.c
> @@ -231,6 +231,7 @@ int seccomp_start(void)
> 
>      ctx = seccomp_init(SCMP_ACT_KILL);
>      if (ctx == NULL) {
> +        rc = -1;
>          goto seccomp_return;
>      }
Michael Roth - Dec. 19, 2013, 8:41 p.m.
Quoting Corey Bryant (2013-12-18 10:48:11)
> This fixes a bug where we weren't exiting if seccomp_init() failed.
> 
> Signed-off-by: Corey Bryant <coreyb@linux.vnet.ibm.com>

Cc'ing qemu-stable

> ---
>  qemu-seccomp.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/qemu-seccomp.c b/qemu-seccomp.c
> index cf07869..b7c1253 100644
> --- a/qemu-seccomp.c
> +++ b/qemu-seccomp.c
> @@ -231,6 +231,7 @@ int seccomp_start(void)
> 
>      ctx = seccomp_init(SCMP_ACT_KILL);
>      if (ctx == NULL) {
> +        rc = -1;
>          goto seccomp_return;
>      }
> 
> -- 
> 1.8.1.4

Patch

diff --git a/qemu-seccomp.c b/qemu-seccomp.c
index cf07869..b7c1253 100644
--- a/qemu-seccomp.c
+++ b/qemu-seccomp.c
@@ -231,6 +231,7 @@  int seccomp_start(void)
 
     ctx = seccomp_init(SCMP_ACT_KILL);
     if (ctx == NULL) {
+        rc = -1;
         goto seccomp_return;
     }