Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp2261445imm; Thu, 27 Sep 2018 09:52:43 -0700 (PDT) X-Google-Smtp-Source: ACcGV63OTqn1QZep6rjOIk5m5kd4lqo8DsjpTV2VbZvm3kpDBLB4Lp9Uttit62b5JPe33a1cGTvv X-Received: by 2002:a17:902:7582:: with SMTP id j2-v6mr12113989pll.76.1538067163878; Thu, 27 Sep 2018 09:52:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538067163; cv=none; d=google.com; s=arc-20160816; b=Syckd81iMg6AXS55hnOhgxsaZBrdPh3CbW3O3eWPExxLiua9Zfo/rg/UyL/GQOzSgM 9tRLhEGhE/59VvUBvv+NdcBif36pGZ67vXJaGzAPPQUfqbULSwM45VWFZ1PgFOs3h6pc agtmGF26mCGjL74bzMKIG0aVXX02nbwepBCiwnlSvkXMLWfjUmivRx3ON3YslFkQTqws OZjdJJRxFNcZre+XGq1sRgjbcW/6A7/rggVkoyCs3VdcmnFYS1NIpx3D877bQeTGTYSL X2qhCrAirKGb3pVKAcJsEXVYiYF3ZESdv8z5SdQ7SK6xmdJZlT5CrUPsZoS+X0Q/UrCI uD9w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=zjgEBjeMZkDXjOXNUaEg8wy8xbWViFb+frjvCZaeJkI=; b=X2Z+Nz5lMAuqKCP+12mwIS0QcYFgzM7xCHj/mcywCRk+9eXFHQIJ48HLlsXbnKGn0G 2/dO3+/n0OJmRwO4QQklVDZD+bFuRkyBh81n15kug7ewAYVNf81YYFiFUIL5IxRl+xy8 AZJQvExi9DOAjsAq6zqUQ7Xnp1dV1Og0TQsYcv23sqomrjPeXfMKunmP9hwP1TnS2xPv U5jV73Ncv0UKkLM8zDjkNowAAOgmGdKCUe7nzJK+VzaT9KIADWfA7HrzvW0n5uIfKNa9 jumQ242D0dpKtJWUEsl3HcvFvaClxTzNr47zoC/OzMv5ljNNoJN3dWtBM6whpiDWQeN4 1JEQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b="H5tGp/oM"; 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=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f8-v6si2318646plt.408.2018.09.27.09.52.20; Thu, 27 Sep 2018 09:52:43 -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; dkim=pass header.i=@google.com header.s=20161025 header.b="H5tGp/oM"; 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=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728251AbeI0XKq (ORCPT + 99 others); Thu, 27 Sep 2018 19:10:46 -0400 Received: from mail-oi1-f196.google.com ([209.85.167.196]:46373 "EHLO mail-oi1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727320AbeI0XKq (ORCPT ); Thu, 27 Sep 2018 19:10:46 -0400 Received: by mail-oi1-f196.google.com with SMTP id k64-v6so2736074oia.13 for ; Thu, 27 Sep 2018 09:51:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=zjgEBjeMZkDXjOXNUaEg8wy8xbWViFb+frjvCZaeJkI=; b=H5tGp/oM+4fcxwl2/RhDdsE96XNRO++OCWzCKI768zDg7BuPRiAmrpcimp+8NvYnZd 1eTdak/mId7rZpLDJ5Q6NrCmb/0fQbuQXsXgvF8kGaoba2Frci467rUSbHob7QJeDjs5 Cdn+vaVKST13MFu0nvGhGJnrCRfIZ8+Y3u7UIBm7pnX7y0wsOq/K4rBJBYe15II1jTPo AotMUyCklM4ni4I/HT+mABpFOsf3qTu2MfncWRakauMkNCDK37ccJgjCxZhG6l0rpp03 YGr/2c+UFt91OuMnARjUzsknS5OseiKsi5liecF1n2Ht8LrjNGFDwRb9bmszkm8BUi47 DZrg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=zjgEBjeMZkDXjOXNUaEg8wy8xbWViFb+frjvCZaeJkI=; b=qxRSgvMXQLHlxmHBPFYQ5pFeGb7j7WCDSSCg+AOU0QRGL9DlFhtsBjg587C+dwUGSL fue6i6VEDcYtLAE0vVQl8re9qfdPPtx6LTDQAYsXmFFGlGQTlG/OM/sTkD2QUd3lf8Dw n6BMmSremrNeXtGxTWJ4BJdxODjBqUNfERjHNBE5feHA0T7X/YIO1Ih6QtdSxdRUHs7M +dwjaxQT6j0QWPVSE7vtuXE1PFf9uD0HL1m+A3sNLKc3rO+r21tMDTuLbz4vI4aSqIc3 aD4ESMGYzuNW2lf2gQnhUXSefbI3yxJzfUs4zohBoAthNOdHj6BKWFqk10TF8YH9a1Tp 04Yg== X-Gm-Message-State: ABuFfojE/jAxgdZH45HSQQFtsJrD9z8499JEmlmDG5zzSr+lOe769Fkx tgNJLe9h2iWFe+UMtiN0lySuAZ71KSKC91YlVpznQw== X-Received: by 2002:aca:4d13:: with SMTP id a19-v6mr3386701oib.205.1538067096854; Thu, 27 Sep 2018 09:51:36 -0700 (PDT) MIME-Version: 1.0 References: <20180927151119.9989-1-tycho@tycho.ws> <20180927151119.9989-3-tycho@tycho.ws> In-Reply-To: <20180927151119.9989-3-tycho@tycho.ws> From: Jann Horn Date: Thu, 27 Sep 2018 18:51:10 +0200 Message-ID: Subject: Re: [PATCH v7 2/6] seccomp: make get_nth_filter available outside of CHECKPOINT_RESTORE To: Tycho Andersen Cc: Kees Cook , kernel list , containers@lists.linux-foundation.org, Linux API , Andy Lutomirski , Oleg Nesterov , "Eric W. Biederman" , "Serge E. Hallyn" , Christian Brauner , Tyler Hicks , suda.akihiro@lab.ntt.co.jp, linux-fsdevel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Sep 27, 2018 at 5:11 PM Tycho Andersen wrote: > In the next commit we'll use this same mnemonic to get a listener for the > nth filter, so we need it available outside of CHECKPOINT_RESTORE in the > USER_NOTIFICATION case as well. > > v2: new in v2 > v3: no changes > v4: no changes > v5: switch to CHECKPOINT_RESTORE || USER_NOTIFICATION to avoid warning when > only CONFIG_SECCOMP_FILTER is enabled. > v7: drop USER_NOTIFICATION bits > > Signed-off-by: Tycho Andersen > CC: Kees Cook > CC: Andy Lutomirski > CC: Oleg Nesterov > CC: Eric W. Biederman > CC: "Serge E. Hallyn" > CC: Christian Brauner > CC: Tyler Hicks > CC: Akihiro Suda Reviewed-by: Jann Horn > --- > kernel/seccomp.c | 6 ++++-- > 1 file changed, 4 insertions(+), 2 deletions(-) > > diff --git a/kernel/seccomp.c b/kernel/seccomp.c > index fa6fe9756c80..44a31ac8373a 100644 > --- a/kernel/seccomp.c > +++ b/kernel/seccomp.c > @@ -1158,7 +1158,7 @@ long prctl_set_seccomp(unsigned long seccomp_mode, char __user *filter) > return do_seccomp(op, 0, uargs); > } > > -#if defined(CONFIG_SECCOMP_FILTER) && defined(CONFIG_CHECKPOINT_RESTORE) > +#if defined(CONFIG_SECCOMP_FILTER) > static struct seccomp_filter *get_nth_filter(struct task_struct *task, > unsigned long filter_off) > { > @@ -1205,6 +1205,7 @@ static struct seccomp_filter *get_nth_filter(struct task_struct *task, > return filter; > } > > +#if defined(CONFIG_CHECKPOINT_RESTORE) > long seccomp_get_filter(struct task_struct *task, unsigned long filter_off, > void __user *data) > { > @@ -1277,7 +1278,8 @@ long seccomp_get_metadata(struct task_struct *task, > __put_seccomp_filter(filter); > return ret; > } > -#endif > +#endif /* CONFIG_CHECKPOINT_RESTORE */ > +#endif /* CONFIG_SECCOMP_FILTER */ > > #ifdef CONFIG_SYSCTL > > -- > 2.17.1 >