From: David Miller <davem@davemloft.net>
To: pablo@netfilter.org
Cc: ast@plumgrid.com, dborkman@redhat.com, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org, willemb@google.com,
netfilter-devel@vger.kernel.org
Subject: Re: [PATCH net-next] net: filter: rename 'struct sk_filter' to 'struct bpf_prog'
Date: Mon, 28 Jul 2014 17:12:13 -0700 (PDT) [thread overview]
Message-ID: <20140728.171213.1219772609929469928.davem@davemloft.net> (raw)
In-Reply-To: <20140728214552.GA4049@salvia>
From: Pablo Neira Ayuso <pablo@netfilter.org>
Date: Mon, 28 Jul 2014 23:45:52 +0200
> By renaming this, you're not fixing up things the semantics. It seems
> to me you just want to find a quick path to solve inconsistencies in
> your code.
Agreed, this looks just like messing around with naming to me.
But to the original issue, that of xt_bpf, I wonder about a few things:
1) If we have a kernel pointer embedded in a user provided datastructure,
what takes care of 32-bit compat applications uploading xt_bpf rules
on a 64-bit kernel? Won't the size be wrong or does it not matter
and is in some way helped by that 8-byte alignment thing there?
2) The user can't care about the type of "filter" in xt_bpf_info, so
we can use whatever name we want for the type.
Therefore you can just do something like:
struct bpf_prog;
struct xt_bpf_info {
__u16 bpf_program_num_elem;
struct sock_filter bpf_program[XT_BPF_MAX_NUM_INSTR];
/* only used in the kernel */
struct bpf_prog *filter __attribute__((aligned(8)));
};
and then you won't need any casting.
next prev parent reply other threads:[~2014-07-29 0:12 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1406275499-7822-1-git-send-email-ast@plumgrid.com>
[not found] ` <53D23EAF.4000001@redhat.com>
2014-07-25 11:54 ` [PATCH net-next] net: filter: rename 'struct sk_filter' to 'struct bpf_prog' Pablo Neira Ayuso
2014-07-25 13:00 ` Daniel Borkmann
2014-07-25 17:24 ` Alexei Starovoitov
2014-07-25 22:17 ` Pablo Neira Ayuso
2014-07-27 5:41 ` Alexei Starovoitov
2014-07-28 21:45 ` Pablo Neira Ayuso
2014-07-29 0:12 ` David Miller [this message]
2014-07-29 1:12 ` Alexei Starovoitov
2014-07-29 1:16 ` David Miller
2014-07-25 13:53 ` Willem de Bruijn
2014-07-25 17:27 ` Alexei Starovoitov
2014-07-25 18:32 ` Willem de Bruijn
2014-07-25 18:43 ` Alexei Starovoitov
2014-07-25 18:50 ` Willem de Bruijn
2014-07-25 18:58 ` Alexei Starovoitov
2014-07-25 19:02 ` Alexei Starovoitov
2014-07-25 22:20 ` Pablo Neira Ayuso
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20140728.171213.1219772609929469928.davem@davemloft.net \
--to=davem@davemloft.net \
--cc=ast@plumgrid.com \
--cc=dborkman@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=netfilter-devel@vger.kernel.org \
--cc=pablo@netfilter.org \
--cc=willemb@google.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).