diff options
author | David S. Miller <davem@davemloft.net> | 2015-04-28 05:12:34 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2015-04-28 05:12:34 +0200 |
commit | 39376ccb1968ba9f83e2a880a8bf02ad5dea44e1 (patch) | |
tree | 8f1299a1ac38bd64415482212a33510eb94b3f56 /include | |
parent | bpf: fix 64-bit divide (diff) | |
parent | netfilter: bridge: fix NULL deref in physin/out ifindex helpers (diff) | |
download | linux-39376ccb1968ba9f83e2a880a8bf02ad5dea44e1.tar.xz linux-39376ccb1968ba9f83e2a880a8bf02ad5dea44e1.zip |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/pablo/nf
Pablo Neira Ayuso says:
====================
Netfilter fixes for net
The following patchset contains Netfilter fixes for your net tree,
they are:
1) Fix a crash in nf_tables when dictionaries are used from the ruleset,
due to memory corruption, from Florian Westphal.
2) Fix another crash in nf_queue when used with br_netfilter. Also from
Florian.
Both fixes are related to new stuff that got in 4.0-rc.
====================
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/netfilter_bridge.h | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/include/linux/netfilter_bridge.h b/include/linux/netfilter_bridge.h index ab8f76dba668..f2fdb5a52070 100644 --- a/include/linux/netfilter_bridge.h +++ b/include/linux/netfilter_bridge.h @@ -39,12 +39,24 @@ static inline void br_drop_fake_rtable(struct sk_buff *skb) static inline int nf_bridge_get_physinif(const struct sk_buff *skb) { - return skb->nf_bridge ? skb->nf_bridge->physindev->ifindex : 0; + struct nf_bridge_info *nf_bridge; + + if (skb->nf_bridge == NULL) + return 0; + + nf_bridge = skb->nf_bridge; + return nf_bridge->physindev ? nf_bridge->physindev->ifindex : 0; } static inline int nf_bridge_get_physoutif(const struct sk_buff *skb) { - return skb->nf_bridge ? skb->nf_bridge->physoutdev->ifindex : 0; + struct nf_bridge_info *nf_bridge; + + if (skb->nf_bridge == NULL) + return 0; + + nf_bridge = skb->nf_bridge; + return nf_bridge->physoutdev ? nf_bridge->physoutdev->ifindex : 0; } static inline struct net_device * |