From mboxrd@z Thu Jan 1 00:00:00 1970 From: Oleg Nesterov Subject: Re: [PATCH v8 1/2] seccomp: add a return code to trap to userspace Date: Tue, 30 Oct 2018 17:27:52 +0100 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 Return-path: Content-Disposition: inline In-Reply-To: <20181030155403.GC7343@cisco> Sender: linux-kernel-owner@vger.kernel.org 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 List-Id: linux-api@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.