Received: by 2002:ac0:98c7:0:0:0:0:0 with SMTP id g7-v6csp5066057imd; Tue, 30 Oct 2018 11:25:17 -0700 (PDT) X-Google-Smtp-Source: AJdET5c7ZV0GnF43JUcNXkl494PSYEYQOX/SXxIpAT/af9wS0YhjrzjU8gdLfsqLWt8VfcVHLCmh X-Received: by 2002:a63:608f:: with SMTP id u137mr19156116pgb.203.1540923917761; Tue, 30 Oct 2018 11:25:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540923917; cv=none; d=google.com; s=arc-20160816; b=JjjDeD1kTcsOoSmNWYl0omkO8YTr9ZzhKUUHkYqn01NRraSGMIm+vymRcIgLTFYK4J ggFD5IGKcRso0uwjp3q6mLbPiFUwKYOpsLuYpMXse4xWDjiWrqCDFusSqXxqxqrhj4C8 IYhLp9UBecSSDx9E4yvPr0MkeWug2BTiyj5KAfkLH71Zame0iP0zBRnHpe7q5byd5xBd q1BkM3ZRH/5Uf67+IN3MfpZ2i5K5TUrD0LV0nxqWa6g+ZaXJUIL2iZhUkxLCjSsX2DGI T8ySFsXgbA1B1kimTBi43YdRuktLv2qY8UIF0RVmb65pvMhuj4pEpAUDLhwU3MoVLdaJ xECQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=domwNfWWRNeBauiDLZtnpqqFS96oCDb8qwouQYtfdJA=; b=kP/v5i6flDD+y3UJWwpTJk94zxHz3FcGldApTTijNSREFb5XDjSSx+4W2EY1nh2zD5 ImmPGvRywzyCY/mX2BU8GcYTduOm3zAVzvTzNE0HAoDQgyGjbd4oKBsvZV9pRuS25X8+ ZTdfvIYjlUE2HTWnU96LwOsMd2wrUuw7sd9DXaN4boaMpktmtOJqVaB5o2zmCA5X885i 93D8pMRCilkS+0LlW/4iCSXbwiwbREf8l8HkgMVCto5AcmFhykl+f4kg4wHi9SoEAzJi 0LZ4cd/VRxPOPYzMBqK6EyOUQvGgPgjM/hgCRILYZJ6knXezbu+IgN3yr32MKgR3nNq0 kliw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b6-v6si25444196pgh.542.2018.10.30.11.25.01; Tue, 30 Oct 2018 11:25:17 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727784AbeJaBWH (ORCPT + 99 others); Tue, 30 Oct 2018 21:22:07 -0400 Received: from mx1.redhat.com ([209.132.183.28]:45208 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727721AbeJaBWG (ORCPT ); Tue, 30 Oct 2018 21:22:06 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 7089630832EA; Tue, 30 Oct 2018 16:27:56 +0000 (UTC) Received: from dhcp-27-174.brq.redhat.com (unknown [10.43.17.31]) by smtp.corp.redhat.com (Postfix) with SMTP id CB3F55F703; Tue, 30 Oct 2018 16:27:53 +0000 (UTC) Received: by dhcp-27-174.brq.redhat.com (nbSMTP-1.00) for uid 1000 oleg@redhat.com; Tue, 30 Oct 2018 17:27:55 +0100 (CET) Date: Tue, 30 Oct 2018 17:27:52 +0100 From: Oleg Nesterov To: Tycho Andersen Cc: Kees Cook , Andy Lutomirski , "Eric W . Biederman" , "Serge E . Hallyn" , Christian Brauner , Tyler Hicks , Akihiro Suda , Aleksa Sarai , linux-kernel@vger.kernel.org, containers@lists.linux-foundation.org, linux-api@vger.kernel.org Subject: Re: [PATCH v8 1/2] seccomp: add a return code to trap to userspace Message-ID: <20181030162752.GB7643@redhat.com> References: <20181029224031.29809-1-tycho@tycho.ws> <20181029224031.29809-2-tycho@tycho.ws> <20181030150254.GB3385@redhat.com> <20181030155403.GC7343@cisco> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20181030155403.GC7343@cisco> User-Agent: Mutt/1.5.24 (2015-08-30) X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.44]); Tue, 30 Oct 2018 16:27:56 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 10/30, Tycho Andersen wrote: > > @@ -828,6 +823,11 @@ static int __seccomp_filter(int this_syscall, const struct seccomp_data *sd, > */ > rmb(); > > + if (!sd) { > + populate_seccomp_data(&sd_local); > + sd = &sd_local; > + } > + To me it would be more clean to remove the "if (!sd)" check, case(SECCOMP_RET_TRACE) in __seccomp_filter() can simply do populate_seccomp_data(&sd_local) unconditionally and pass &sd_local to __seccomp_filter(). Oleg.