Skip to contentSkip to conversation

netfilter: xt_bpf: add mising opaque struct sk_filter definition

PATCH Applied Pablo Neira Ayuso 3 participants 3 messages Jul 29, 2014 – Jul 31, 2014

Subsystems (3)
lore
Share & tools
lore

Pablo Neira Ayuso

author maintainer
#0 lore raw

PATCH 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.

Fixes e6f30c7 ("netfilter: x_tables: add xt_bpf match")

---
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
index 5dda450..2ec9fbc 100644
@@ -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
Acked-by on v2 1/2
#1 lore raw
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")
Quoted 23 lines

---
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 -1
index 5dda450..2ec9fbc 100644
@@ -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

maintainer Applied
#2 lore raw
In reply to Pablo Neira Ayuso

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")

---
v2: address Willem's feedback, we still need uapi/linux/filter.h for
userspace iptables builds.

Applied.