netfilter: xt_bpf: add mising opaque struct sk_filter definition
Subsystems (3)
Pablo Neira Ayuso
maintainerPATCH v2 1/2 netfilter: xt_bpf: add mising opaque struct sk_filter definition
This structure is not exposed to userspace, so fix this by defining struct sk_filter; so we skip the casting in kernelspace. This is safe since userspace has no way to lurk with that internal pointer.
---
v2: address Willem's feedback, we still need uapi/linux/filter.h for
userspace iptables builds.
include/uapi/linux/netfilter/xt_bpf.h | 2 ++ 1 file changed, 2 insertions(+)
include/uapi/linux/netfilter/xt_bpf.h +2 -0
@@ -6,6 +6,8 @@#define XT_BPF_MAX_NUM_INSTR 64 +struct sk_filter ; +struct xt_bpf_info {__u16 bpf_program_num_elem;struct sock_filter bpf_program[XT_BPF_MAX_NUM_INSTR ];
Signature · 1 line
1.7.10.4
Quoted 6 lines · Pablo Neira Ayuso
This structure is not exposed to userspace, so fix this by defining struct
sk_filter; so we skip the casting in kernelspace. This is safe since userspace has no way to lurk with that internal pointer.Fixes e6f30c7 ("netfilter: x_tables: add xt_bpf match")Signed-off-by Pablo Neira Ayuso <[email protected]>
Quoted 23 lines
---
v2: address Willem's feedback, we still needuapi/linux/filter.hfor
userspace iptables builds.include/uapi/linux/netfilter/xt_bpf.h | 2 ++ 1 file changed, 2 insertions(+)include/uapi/linux/netfilter/xt_bpf.h +2
-1@@ -6,6 +6,8 @@#define XT_BPF_MAX_NUM_INSTR 64 +struct sk_filter ; +struct xt_bpf_info {__u16 bpf_program_num_elem;struct sock_filter bpf_program[XT_BPF_MAX_NUM_INSTR ]; --1.7.10.4
From: Pablo Neira Ayuso <[email protected]>
Date: Tue, 29 Jul 2014 18:12:15 +0200
Quoted 9 lines
This structure is not exposed to userspace, so fix this by defining struct
sk_filter; so we skip the casting in kernelspace. This is safe since userspace has no way to lurk with that internal pointer.Fixes e6f30c7 ("netfilter: x_tables: add xt_bpf match")Signed-off-by Pablo Neira Ayuso <[email protected]>---
v2: address Willem's feedback, we still needuapi/linux/filter.hfor
userspace iptables builds.
Applied.