[{"id":1761594,"web_url":"http://patchwork.ozlabs.org/comment/1761594/","msgid":"<20170901110541.GK31680@redhat.com>","list_archive_url":null,"date":"2017-09-01T11:05:41","subject":"Re: [Qemu-devel] [PATCHv4 2/6] seccomp: add obsolete argument to\n\tcommand line","submitter":{"id":2694,"url":"http://patchwork.ozlabs.org/api/people/2694/","name":"Daniel P. Berrangé","email":"berrange@redhat.com"},"content":"On Fri, Sep 01, 2017 at 12:58:14PM +0200, Eduardo Otubo wrote:\n> This patch introduces the argument [,obsolete=allow] to the `-sandbox on'\n> option. It allows Qemu to run safely on old system that still relies on\n> old system calls.\n> \n> Signed-off-by: Eduardo Otubo <otubo@redhat.com>\n> ---\n>  include/sysemu/seccomp.h |  3 ++-\n>  qemu-options.hx          | 12 ++++++++++--\n>  qemu-seccomp.c           | 23 ++++++++++++++++++++++-\n>  vl.c                     | 22 +++++++++++++++++++++-\n>  4 files changed, 55 insertions(+), 5 deletions(-)\n> \n\n> @@ -72,6 +85,14 @@ int seccomp_start(void)\n>  \n>      for (i = 0; i < ARRAY_SIZE(blacklist); i++) {\n>          switch (blacklist[i].set) {\n> +        case QEMU_SECCOMP_SET_OBSOLETE:\n> +            if (!(seccomp_opts & QEMU_SECCOMP_SET_OBSOLETE)) {\n> +                goto add_syscall;\n> +            } else {\n> +                continue;\n> +            }\n> +\n> +            break;\n\nTHis can be simplified:\n\n            if ((seccomp_opts & QEMU_SECCOMP_SET_OBSOLETE)) {\n                continue;\n            }\n\n            break;\n\nthus avoiding need to 'goto'\n\nLikewise for all following patches\n\n>          default:\n>              goto add_syscall;\n>          }\n\nRegards,\nDaniel","headers":{"Return-Path":"<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=nongnu.org\n\t(client-ip=2001:4830:134:3::11; helo=lists.gnu.org;\n\tenvelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n\treceiver=<UNKNOWN>)","ext-mx07.extmail.prod.ext.phx2.redhat.com;\n\tdmarc=none (p=none dis=none) header.from=redhat.com","ext-mx07.extmail.prod.ext.phx2.redhat.com;\n\tspf=fail smtp.mailfrom=berrange@redhat.com"],"Received":["from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11])\n\t(using TLSv1 with cipher AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xkGh24Jsyz9s7p\n\tfor <incoming@patchwork.ozlabs.org>;\n\tFri,  1 Sep 2017 21:08:34 +1000 (AEST)","from localhost ([::1]:35461 helo=lists.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.71) (envelope-from\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>)\n\tid 1dnjoO-0008K7-Kj\n\tfor incoming@patchwork.ozlabs.org; Fri, 01 Sep 2017 07:08:32 -0400","from eggs.gnu.org ([2001:4830:134:3::10]:53867)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <berrange@redhat.com>) id 1dnjlp-0006Yr-7y\n\tfor qemu-devel@nongnu.org; Fri, 01 Sep 2017 07:05:54 -0400","from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <berrange@redhat.com>) id 1dnjlk-00045f-In\n\tfor qemu-devel@nongnu.org; Fri, 01 Sep 2017 07:05:53 -0400","from mx1.redhat.com ([209.132.183.28]:57104)\n\tby eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)\n\t(Exim 4.71) (envelope-from <berrange@redhat.com>) id 1dnjlk-00045E-2w\n\tfor qemu-devel@nongnu.org; Fri, 01 Sep 2017 07:05:48 -0400","from smtp.corp.redhat.com\n\t(int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15])\n\t(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby mx1.redhat.com (Postfix) with ESMTPS id 27044C047B74\n\tfor <qemu-devel@nongnu.org>; Fri,  1 Sep 2017 11:05:47 +0000 (UTC)","from redhat.com (unknown [10.42.22.189])\n\tby smtp.corp.redhat.com (Postfix) with ESMTPS id 40F7496126;\n\tFri,  1 Sep 2017 11:05:44 +0000 (UTC)"],"DMARC-Filter":"OpenDMARC Filter v1.3.2 mx1.redhat.com 27044C047B74","Date":"Fri, 1 Sep 2017 12:05:41 +0100","From":"\"Daniel P. Berrange\" <berrange@redhat.com>","To":"Eduardo Otubo <otubo@redhat.com>","Message-ID":"<20170901110541.GK31680@redhat.com>","References":"<20170901105818.31956-1-otubo@redhat.com>\n\t<20170901105818.31956-3-otubo@redhat.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20170901105818.31956-3-otubo@redhat.com>","User-Agent":"Mutt/1.8.3 (2017-05-23)","X-Scanned-By":"MIMEDefang 2.79 on 10.5.11.15","X-Greylist":"Sender IP whitelisted, not delayed by milter-greylist-4.5.16\n\t(mx1.redhat.com [10.5.110.31]);\n\tFri, 01 Sep 2017 11:05:47 +0000 (UTC)","X-detected-operating-system":"by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]\n\t[fuzzy]","X-Received-From":"209.132.183.28","Subject":"Re: [Qemu-devel] [PATCHv4 2/6] seccomp: add obsolete argument to\n\tcommand line","X-BeenThere":"qemu-devel@nongnu.org","X-Mailman-Version":"2.1.21","Precedence":"list","List-Id":"<qemu-devel.nongnu.org>","List-Unsubscribe":"<https://lists.nongnu.org/mailman/options/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>","List-Archive":"<http://lists.nongnu.org/archive/html/qemu-devel/>","List-Post":"<mailto:qemu-devel@nongnu.org>","List-Help":"<mailto:qemu-devel-request@nongnu.org?subject=help>","List-Subscribe":"<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=subscribe>","Reply-To":"\"Daniel P. Berrange\" <berrange@redhat.com>","Cc":"thuth@redhat.com, qemu-devel@nongnu.org","Errors-To":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org","Sender":"\"Qemu-devel\"\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>"}},{"id":1764608,"web_url":"http://patchwork.ozlabs.org/comment/1764608/","msgid":"<20170907093104.GA25213@vader>","list_archive_url":null,"date":"2017-09-07T09:31:04","subject":"Re: [Qemu-devel] [PATCHv4 2/6] seccomp: add obsolete argument to\n\tcommand line","submitter":{"id":71779,"url":"http://patchwork.ozlabs.org/api/people/71779/","name":"Eduardo Otubo","email":"otubo@redhat.com"},"content":"On Fri, Sep 01, 2017 at 12:05:41PM +0100, Daniel P. Berrange wrote:\n> On Fri, Sep 01, 2017 at 12:58:14PM +0200, Eduardo Otubo wrote:\n> > This patch introduces the argument [,obsolete=allow] to the `-sandbox on'\n> > option. It allows Qemu to run safely on old system that still relies on\n> > old system calls.\n> > \n> > Signed-off-by: Eduardo Otubo <otubo@redhat.com>\n> > ---\n> >  include/sysemu/seccomp.h |  3 ++-\n> >  qemu-options.hx          | 12 ++++++++++--\n> >  qemu-seccomp.c           | 23 ++++++++++++++++++++++-\n> >  vl.c                     | 22 +++++++++++++++++++++-\n> >  4 files changed, 55 insertions(+), 5 deletions(-)\n> > \n> \n> > @@ -72,6 +85,14 @@ int seccomp_start(void)\n> >  \n> >      for (i = 0; i < ARRAY_SIZE(blacklist); i++) {\n> >          switch (blacklist[i].set) {\n> > +        case QEMU_SECCOMP_SET_OBSOLETE:\n> > +            if (!(seccomp_opts & QEMU_SECCOMP_SET_OBSOLETE)) {\n> > +                goto add_syscall;\n> > +            } else {\n> > +                continue;\n> > +            }\n> > +\n> > +            break;\n> \n> THis can be simplified:\n> \n>             if ((seccomp_opts & QEMU_SECCOMP_SET_OBSOLETE)) {\n>                 continue;\n>             }\n> \n>             break;\n> \n> thus avoiding need to 'goto'\n> \n> Likewise for all following patches\n\nDo you think there's anything else to fix on this series? if nothing\nelse emerges, I'll send the v5 tomorrow (also with the style fixes).","headers":{"Return-Path":"<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=nongnu.org\n\t(client-ip=2001:4830:134:3::11; helo=lists.gnu.org;\n\tenvelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n\treceiver=<UNKNOWN>)","ext-mx04.extmail.prod.ext.phx2.redhat.com;\n\tdmarc=none (p=none dis=none) header.from=redhat.com","ext-mx04.extmail.prod.ext.phx2.redhat.com;\n\tspf=fail smtp.mailfrom=otubo@redhat.com"],"Received":["from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11])\n\t(using TLSv1 with cipher AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xnwFk11hSz9sRV\n\tfor <incoming@patchwork.ozlabs.org>;\n\tThu,  7 Sep 2017 19:31:54 +1000 (AEST)","from localhost ([::1]:39553 helo=lists.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.71) (envelope-from\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>)\n\tid 1dptA8-0000b4-2d\n\tfor incoming@patchwork.ozlabs.org; Thu, 07 Sep 2017 05:31:52 -0400","from eggs.gnu.org ([2001:4830:134:3::10]:33618)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <otubo@redhat.com>) id 1dpt9W-0000WP-91\n\tfor qemu-devel@nongnu.org; Thu, 07 Sep 2017 05:31:22 -0400","from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <otubo@redhat.com>) id 1dpt9R-0004QK-KU\n\tfor qemu-devel@nongnu.org; Thu, 07 Sep 2017 05:31:14 -0400","from mx1.redhat.com ([209.132.183.28]:55794)\n\tby eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)\n\t(Exim 4.71) (envelope-from <otubo@redhat.com>) id 1dpt9R-0004Pk-Ej\n\tfor qemu-devel@nongnu.org; Thu, 07 Sep 2017 05:31:09 -0400","from smtp.corp.redhat.com\n\t(int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13])\n\t(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby mx1.redhat.com (Postfix) with ESMTPS id 70A9A8046A\n\tfor <qemu-devel@nongnu.org>; Thu,  7 Sep 2017 09:31:08 +0000 (UTC)","from vader (ovpn-117-116.ams2.redhat.com [10.36.117.116])\n\tby smtp.corp.redhat.com (Postfix) with SMTP id 25B526060A;\n\tThu,  7 Sep 2017 09:31:04 +0000 (UTC)"],"DMARC-Filter":"OpenDMARC Filter v1.3.2 mx1.redhat.com 70A9A8046A","Date":"Thu, 7 Sep 2017 11:31:04 +0200","From":"Eduardo Otubo <otubo@redhat.com>","To":"\"Daniel P. Berrange\" <berrange@redhat.com>","Message-ID":"<20170907093104.GA25213@vader>","References":"<20170901105818.31956-1-otubo@redhat.com>\n\t<20170901105818.31956-3-otubo@redhat.com>\n\t<20170901110541.GK31680@redhat.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20170901110541.GK31680@redhat.com>","User-Agent":"Mutt/1.8.3+47 (5f034395e53d) (2017-05-23)","X-Scanned-By":"MIMEDefang 2.79 on 10.5.11.13","X-Greylist":"Sender IP whitelisted, not delayed by milter-greylist-4.5.16\n\t(mx1.redhat.com [10.5.110.28]);\n\tThu, 07 Sep 2017 09:31:08 +0000 (UTC)","X-detected-operating-system":"by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]\n\t[fuzzy]","X-Received-From":"209.132.183.28","Subject":"Re: [Qemu-devel] [PATCHv4 2/6] seccomp: add obsolete argument to\n\tcommand line","X-BeenThere":"qemu-devel@nongnu.org","X-Mailman-Version":"2.1.21","Precedence":"list","List-Id":"<qemu-devel.nongnu.org>","List-Unsubscribe":"<https://lists.nongnu.org/mailman/options/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>","List-Archive":"<http://lists.nongnu.org/archive/html/qemu-devel/>","List-Post":"<mailto:qemu-devel@nongnu.org>","List-Help":"<mailto:qemu-devel-request@nongnu.org?subject=help>","List-Subscribe":"<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=subscribe>","Cc":"thuth@redhat.com, qemu-devel@nongnu.org","Errors-To":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org","Sender":"\"Qemu-devel\"\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>"}},{"id":1764624,"web_url":"http://patchwork.ozlabs.org/comment/1764624/","msgid":"<20170907095725.GF30609@redhat.com>","list_archive_url":null,"date":"2017-09-07T09:57:25","subject":"Re: [Qemu-devel] [PATCHv4 2/6] seccomp: add obsolete argument to\n\tcommand line","submitter":{"id":2694,"url":"http://patchwork.ozlabs.org/api/people/2694/","name":"Daniel P. Berrangé","email":"berrange@redhat.com"},"content":"On Fri, Sep 01, 2017 at 12:58:14PM +0200, Eduardo Otubo wrote:\n> This patch introduces the argument [,obsolete=allow] to the `-sandbox on'\n> option. It allows Qemu to run safely on old system that still relies on\n> old system calls.\n> \n> Signed-off-by: Eduardo Otubo <otubo@redhat.com>\n> ---\n>  include/sysemu/seccomp.h |  3 ++-\n>  qemu-options.hx          | 12 ++++++++++--\n>  qemu-seccomp.c           | 23 ++++++++++++++++++++++-\n>  vl.c                     | 22 +++++++++++++++++++++-\n>  4 files changed, 55 insertions(+), 5 deletions(-)\n> \n\n> @@ -1032,7 +1036,23 @@ static int parse_sandbox(void *opaque, QemuOpts *opts, Error **errp)\n>  {\n>      if (qemu_opt_get_bool(opts, \"enable\", false)) {\n>  #ifdef CONFIG_SECCOMP\n> -        if (seccomp_start() < 0) {\n> +        uint32_t seccomp_opts = 0x00000;\n> +        const char *value = NULL;\n> +\n> +        value = qemu_opt_get(opts, \"obsolete\");\n> +        if (value) {\n> +            if (strcmp(value, \"allow\") == 0) {\n\nI would have a slight preference for g_str_equal(value, \"allow\")\n\n> +                seccomp_opts |= QEMU_SECCOMP_SET_OBSOLETE;\n> +            } else if (strcmp(value, \"deny\")) {\n\nand  !g_str_equal(value, \"deny\")\n\n> +                /* this is the default option, this if is here\n> +\t\t * to provide a little bit of consistency for\n> +\t\t * the command line */\n> +\t    } else {\n> +\t\terror_report(\"invalid argument for obsolete\");\n> +\t    }\n\nThere seem to be tabs for indent here too\n\n> +        }\n> +\n> +        if (seccomp_start(seccomp_opts) < 0) {\n>              error_report(\"failed to install seccomp syscall filter \"\n>                           \"in the kernel\");\n>              return -1;\n> -- \n> 2.13.5\n> \n\nRegards,\nDaniel","headers":{"Return-Path":"<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=nongnu.org\n\t(client-ip=2001:4830:134:3::11; helo=lists.gnu.org;\n\tenvelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n\treceiver=<UNKNOWN>)","ext-mx10.extmail.prod.ext.phx2.redhat.com;\n\tdmarc=none (p=none dis=none) header.from=redhat.com","ext-mx10.extmail.prod.ext.phx2.redhat.com;\n\tspf=fail smtp.mailfrom=berrange@redhat.com"],"Received":["from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11])\n\t(using TLSv1 with cipher AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xnwqw54KMz9t2R\n\tfor <incoming@patchwork.ozlabs.org>;\n\tThu,  7 Sep 2017 19:58:01 +1000 (AEST)","from localhost ([::1]:39614 helo=lists.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.71) (envelope-from\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>)\n\tid 1dptZP-00024S-Ke\n\tfor incoming@patchwork.ozlabs.org; Thu, 07 Sep 2017 05:57:59 -0400","from eggs.gnu.org ([2001:4830:134:3::10]:42994)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <berrange@redhat.com>) id 1dptZ3-00023e-Bf\n\tfor qemu-devel@nongnu.org; Thu, 07 Sep 2017 05:57:42 -0400","from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <berrange@redhat.com>) id 1dptYz-00077c-G0\n\tfor qemu-devel@nongnu.org; Thu, 07 Sep 2017 05:57:37 -0400","from mx1.redhat.com ([209.132.183.28]:36374)\n\tby eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)\n\t(Exim 4.71) (envelope-from <berrange@redhat.com>) id 1dptYz-00077K-9x\n\tfor qemu-devel@nongnu.org; Thu, 07 Sep 2017 05:57:33 -0400","from smtp.corp.redhat.com\n\t(int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16])\n\t(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby mx1.redhat.com (Postfix) with ESMTPS id 093BD61470\n\tfor <qemu-devel@nongnu.org>; Thu,  7 Sep 2017 09:57:32 +0000 (UTC)","from redhat.com (unknown [10.33.36.82])\n\tby smtp.corp.redhat.com (Postfix) with ESMTPS id DEA5C68D25;\n\tThu,  7 Sep 2017 09:57:27 +0000 (UTC)"],"DMARC-Filter":"OpenDMARC Filter v1.3.2 mx1.redhat.com 093BD61470","Date":"Thu, 7 Sep 2017 10:57:25 +0100","From":"\"Daniel P. Berrange\" <berrange@redhat.com>","To":"Eduardo Otubo <otubo@redhat.com>","Message-ID":"<20170907095725.GF30609@redhat.com>","References":"<20170901105818.31956-1-otubo@redhat.com>\n\t<20170901105818.31956-3-otubo@redhat.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20170901105818.31956-3-otubo@redhat.com>","User-Agent":"Mutt/1.8.3 (2017-05-23)","X-Scanned-By":"MIMEDefang 2.79 on 10.5.11.16","X-Greylist":"Sender IP whitelisted, not delayed by milter-greylist-4.5.16\n\t(mx1.redhat.com [10.5.110.39]);\n\tThu, 07 Sep 2017 09:57:32 +0000 (UTC)","X-detected-operating-system":"by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]\n\t[fuzzy]","X-Received-From":"209.132.183.28","Subject":"Re: [Qemu-devel] [PATCHv4 2/6] seccomp: add obsolete argument to\n\tcommand line","X-BeenThere":"qemu-devel@nongnu.org","X-Mailman-Version":"2.1.21","Precedence":"list","List-Id":"<qemu-devel.nongnu.org>","List-Unsubscribe":"<https://lists.nongnu.org/mailman/options/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>","List-Archive":"<http://lists.nongnu.org/archive/html/qemu-devel/>","List-Post":"<mailto:qemu-devel@nongnu.org>","List-Help":"<mailto:qemu-devel-request@nongnu.org?subject=help>","List-Subscribe":"<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=subscribe>","Reply-To":"\"Daniel P. Berrange\" <berrange@redhat.com>","Cc":"thuth@redhat.com, qemu-devel@nongnu.org","Errors-To":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org","Sender":"\"Qemu-devel\"\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>"}},{"id":1764627,"web_url":"http://patchwork.ozlabs.org/comment/1764627/","msgid":"<20170907095942.GH30609@redhat.com>","list_archive_url":null,"date":"2017-09-07T09:59:42","subject":"Re: [Qemu-devel] [PATCHv4 2/6] seccomp: add obsolete argument to\n\tcommand line","submitter":{"id":2694,"url":"http://patchwork.ozlabs.org/api/people/2694/","name":"Daniel P. Berrangé","email":"berrange@redhat.com"},"content":"On Thu, Sep 07, 2017 at 11:31:04AM +0200, Eduardo Otubo wrote:\n> On Fri, Sep 01, 2017 at 12:05:41PM +0100, Daniel P. Berrange wrote:\n> > On Fri, Sep 01, 2017 at 12:58:14PM +0200, Eduardo Otubo wrote:\n> > > This patch introduces the argument [,obsolete=allow] to the `-sandbox on'\n> > > option. It allows Qemu to run safely on old system that still relies on\n> > > old system calls.\n> > > \n> > > Signed-off-by: Eduardo Otubo <otubo@redhat.com>\n> > > ---\n> > >  include/sysemu/seccomp.h |  3 ++-\n> > >  qemu-options.hx          | 12 ++++++++++--\n> > >  qemu-seccomp.c           | 23 ++++++++++++++++++++++-\n> > >  vl.c                     | 22 +++++++++++++++++++++-\n> > >  4 files changed, 55 insertions(+), 5 deletions(-)\n> > > \n> > \n> > > @@ -72,6 +85,14 @@ int seccomp_start(void)\n> > >  \n> > >      for (i = 0; i < ARRAY_SIZE(blacklist); i++) {\n> > >          switch (blacklist[i].set) {\n> > > +        case QEMU_SECCOMP_SET_OBSOLETE:\n> > > +            if (!(seccomp_opts & QEMU_SECCOMP_SET_OBSOLETE)) {\n> > > +                goto add_syscall;\n> > > +            } else {\n> > > +                continue;\n> > > +            }\n> > > +\n> > > +            break;\n> > \n> > THis can be simplified:\n> > \n> >             if ((seccomp_opts & QEMU_SECCOMP_SET_OBSOLETE)) {\n> >                 continue;\n> >             }\n> > \n> >             break;\n> > \n> > thus avoiding need to 'goto'\n> > \n> > Likewise for all following patches\n> \n> Do you think there's anything else to fix on this series? if nothing\n> else emerges, I'll send the v5 tomorrow (also with the style fixes).\n\nI just sent one more comment, but apart from the that & the style fixes\nit looks good to me.\n\nRegards,\nDaniel","headers":{"Return-Path":"<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=nongnu.org\n\t(client-ip=2001:4830:134:3::11; helo=lists.gnu.org;\n\tenvelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n\treceiver=<UNKNOWN>)","ext-mx03.extmail.prod.ext.phx2.redhat.com;\n\tdmarc=none (p=none dis=none) header.from=redhat.com","ext-mx03.extmail.prod.ext.phx2.redhat.com;\n\tspf=fail smtp.mailfrom=berrange@redhat.com"],"Received":["from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11])\n\t(using TLSv1 with cipher AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xnwtd1bbpz9t2R\n\tfor <incoming@patchwork.ozlabs.org>;\n\tThu,  7 Sep 2017 20:00:25 +1000 (AEST)","from localhost ([::1]:39619 helo=lists.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.71) (envelope-from\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>)\n\tid 1dptbj-00035R-Bi\n\tfor incoming@patchwork.ozlabs.org; Thu, 07 Sep 2017 06:00:23 -0400","from eggs.gnu.org ([2001:4830:134:3::10]:43739)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <berrange@redhat.com>) id 1dptbC-00032G-HL\n\tfor qemu-devel@nongnu.org; Thu, 07 Sep 2017 05:59:55 -0400","from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <berrange@redhat.com>) id 1dptbA-0008AU-QU\n\tfor qemu-devel@nongnu.org; Thu, 07 Sep 2017 05:59:50 -0400","from mx1.redhat.com ([209.132.183.28]:58980)\n\tby eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)\n\t(Exim 4.71) (envelope-from <berrange@redhat.com>) id 1dptbA-00089k-KE\n\tfor qemu-devel@nongnu.org; Thu, 07 Sep 2017 05:59:48 -0400","from smtp.corp.redhat.com\n\t(int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16])\n\t(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby mx1.redhat.com (Postfix) with ESMTPS id A138D83F45\n\tfor <qemu-devel@nongnu.org>; Thu,  7 Sep 2017 09:59:47 +0000 (UTC)","from redhat.com (unknown [10.33.36.82])\n\tby smtp.corp.redhat.com (Postfix) with ESMTPS id 997415C89A;\n\tThu,  7 Sep 2017 09:59:44 +0000 (UTC)"],"DMARC-Filter":"OpenDMARC Filter v1.3.2 mx1.redhat.com A138D83F45","Date":"Thu, 7 Sep 2017 10:59:42 +0100","From":"\"Daniel P. Berrange\" <berrange@redhat.com>","To":"Eduardo Otubo <otubo@redhat.com>","Message-ID":"<20170907095942.GH30609@redhat.com>","References":"<20170901105818.31956-1-otubo@redhat.com>\n\t<20170901105818.31956-3-otubo@redhat.com>\n\t<20170901110541.GK31680@redhat.com> <20170907093104.GA25213@vader>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20170907093104.GA25213@vader>","User-Agent":"Mutt/1.8.3 (2017-05-23)","X-Scanned-By":"MIMEDefang 2.79 on 10.5.11.16","X-Greylist":"Sender IP whitelisted, not delayed by milter-greylist-4.5.16\n\t(mx1.redhat.com [10.5.110.27]);\n\tThu, 07 Sep 2017 09:59:47 +0000 (UTC)","X-detected-operating-system":"by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]\n\t[fuzzy]","X-Received-From":"209.132.183.28","Subject":"Re: [Qemu-devel] [PATCHv4 2/6] seccomp: add obsolete argument to\n\tcommand line","X-BeenThere":"qemu-devel@nongnu.org","X-Mailman-Version":"2.1.21","Precedence":"list","List-Id":"<qemu-devel.nongnu.org>","List-Unsubscribe":"<https://lists.nongnu.org/mailman/options/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>","List-Archive":"<http://lists.nongnu.org/archive/html/qemu-devel/>","List-Post":"<mailto:qemu-devel@nongnu.org>","List-Help":"<mailto:qemu-devel-request@nongnu.org?subject=help>","List-Subscribe":"<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=subscribe>","Reply-To":"\"Daniel P. Berrange\" <berrange@redhat.com>","Cc":"thuth@redhat.com, qemu-devel@nongnu.org","Errors-To":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org","Sender":"\"Qemu-devel\"\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>"}}]