From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Miller Subject: Re: [PATCH net-next] net: filter: rename 'struct sk_filter' to 'struct bpf_prog' Date: Mon, 28 Jul 2014 18:16:21 -0700 (PDT) Message-ID: <20140728.181621.1196619942413270695.davem@davemloft.net> References: <20140728214552.GA4049@salvia> Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: pablo@netfilter.org, dborkman@redhat.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, willemb@google.com, netfilter-devel@vger.kernel.org To: ast@plumgrid.com Return-path: Received: from shards.monkeyblade.net ([149.20.54.216]:35275 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751213AbaG2BQX (ORCPT ); Mon, 28 Jul 2014 21:16:23 -0400 In-Reply-To: Sender: netfilter-devel-owner@vger.kernel.org List-ID: From: Alexei Starovoitov Date: Mon, 28 Jul 2014 18:12:05 -0700 > On Mon, Jul 28, 2014 at 2:45 PM, Pablo Neira Ayuso wrote: >>> > struct sk_filter_cb { >>> > int type; >>> > struct module *me; >>> > void (*charge)(struct sock *sk, struct sk_filter *fp); >>> > void (*uncharge)(struct sock *sk, struct sk_filter *fp); >>> > unsigned int (*run_filter)(struct sk_filter *fp, struct sk_buff *skb); >>> > }; >>> >>> Pablo, >>> >>> I don't think you understand the scope of BPF. >>> 'struct module *'? to attach nft to sockets? ouch. >> >> The idea is that there will be one sk_filter_cb per socket filtering >> approach. The structure module is just there in case one of the >> approach is loadable as kernel module, it's the typical code pattern >> in the kernel. You can git grep for similar code. > > socket filtering is available to unprivileged users. > So you're proposing to let them increment refcnt of modules?! > That's not secure. It's impossible to avoid, and really is nothing new. Users can open sockets, and that holds a reference to the module implementing that protocol. Is that not secure too? This discussion is degenerating into nonsense, please stop ignoring Pablo's core points. Thanks.