From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759575Ab2CMDky (ORCPT ); Mon, 12 Mar 2012 23:40:54 -0400 Received: from smarthost1.greenhost.nl ([195.190.28.78]:39887 "EHLO smarthost1.greenhost.nl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757366Ab2CMDkw (ORCPT ); Mon, 12 Mar 2012 23:40:52 -0400 Message-ID: <026393583fec46a9d4401604e596b164.squirrel@webmail.greenhost.nl> In-Reply-To: <1331587715-26069-1-git-send-email-wad@chromium.org> References: <1331587715-26069-1-git-send-email-wad@chromium.org> Date: Tue, 13 Mar 2012 04:40:50 +0100 Subject: Re: [PATCH v14 01/13] sk_run_filter: add BPF_S_ANC_SECCOMP_LD_W From: "Indan Zupancic" To: "Will Drewry" Cc: linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, linux-doc@vger.kernel.org, kernel-hardening@lists.openwall.com, netdev@vger.kernel.org, x86@kernel.org, arnd@arndb.de, davem@davemloft.net, hpa@zytor.com, mingo@redhat.com, oleg@redhat.com, peterz@infradead.org, rdunlap@xenotime.net, mcgrathr@chromium.org, tglx@linutronix.de, luto@mit.edu, eparis@redhat.com, serge.hallyn@canonical.com, djm@mindrot.org, scarybeasts@gmail.com, pmoore@redhat.com, akpm@linux-foundation.org, corbet@lwn.net, eric.dumazet@gmail.com, markus@chromium.org, coreyb@linux.vnet.ibm.com, keescook@chromium.org, "Will Drewry" User-Agent: SquirrelMail/1.4.22 MIME-Version: 1.0 Content-Type: text/plain;charset=UTF-8 Content-Transfer-Encoding: 8bit X-Priority: 3 (Normal) Importance: Normal X-Spam-Score: -0.6 X-Scan-Signature: d58e29c6f4e42f76447094ef3ccb23d2 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello, On Mon, March 12, 2012 22:28, Will Drewry wrote: > Introduces a new BPF ancillary instruction that all LD calls will be > mapped through when skb_run_filter() is being used for seccomp BPF. The > rewriting will be done using a secondary chk_filter function that is run > after skb_chk_filter. > > The code change is guarded by CONFIG_SECCOMP_FILTER which is added, > along with the seccomp_bpf_load() function later in this series. > > This is based on http://lkml.org/lkml/2012/3/2/141 > > v14: First cut using a single additional instruction > ... v13: made bpf functions generic. > > > Suggested-by: Indan Zupancic > Signed-off-by: Will Drewry > --- > include/linux/filter.h | 1 + > net/core/filter.c | 5 +++++ > 2 files changed, 6 insertions(+), 0 deletions(-) > > diff --git a/include/linux/filter.h b/include/linux/filter.h > index 8eeb205..aaa2e80 100644 > --- a/include/linux/filter.h > +++ b/include/linux/filter.h > @@ -228,6 +228,7 @@ enum { > BPF_S_ANC_HATYPE, > BPF_S_ANC_RXHASH, > BPF_S_ANC_CPU, > + BPF_S_ANC_SECCOMP_LD_W, > }; > > #endif /* __KERNEL__ */ > diff --git a/net/core/filter.c b/net/core/filter.c > index 5dea452..3000931 100644 > --- a/net/core/filter.c > +++ b/net/core/filter.c > @@ -350,6 +350,11 @@ load_b: > A = 0; > continue; > } > +#ifdef CONFIG_SECCOMP_FILTER > + case BPF_S_ANC_SECCOMP_LD_W: > + A = seccomp_bpf_load(fentry->k); I think you forgot to declare seccomp_bpf_load() anywhere filter.c can find. That is, filter.c probably needs to include seccomp.h, or maybe better, add "extern u32 seccomp_bpf_load(int off);" to filter.h instead. > + continue; > +#endif > default: > WARN_RATELIMIT(1, "Unknown code:%u jt:%u tf:%u k:%u\n", > fentry->code, fentry->jt, Reviewed-by: Indan Zupancic Greetings, Indan