Commit 39376ccb authored by David S. Miller's avatar David S. Miller

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: default avatarDavid S. Miller <davem@davemloft.net>
parents 876a7ae6 547c4b54
...@@ -39,12 +39,24 @@ static inline void br_drop_fake_rtable(struct sk_buff *skb) ...@@ -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) 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) 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 * static inline struct net_device *
......
...@@ -4340,7 +4340,6 @@ static int nft_verdict_init(const struct nft_ctx *ctx, struct nft_data *data, ...@@ -4340,7 +4340,6 @@ static int nft_verdict_init(const struct nft_ctx *ctx, struct nft_data *data,
case NFT_CONTINUE: case NFT_CONTINUE:
case NFT_BREAK: case NFT_BREAK:
case NFT_RETURN: case NFT_RETURN:
desc->len = sizeof(data->verdict);
break; break;
case NFT_JUMP: case NFT_JUMP:
case NFT_GOTO: case NFT_GOTO:
...@@ -4355,10 +4354,10 @@ static int nft_verdict_init(const struct nft_ctx *ctx, struct nft_data *data, ...@@ -4355,10 +4354,10 @@ static int nft_verdict_init(const struct nft_ctx *ctx, struct nft_data *data,
chain->use++; chain->use++;
data->verdict.chain = chain; data->verdict.chain = chain;
desc->len = sizeof(data);
break; break;
} }
desc->len = sizeof(data->verdict);
desc->type = NFT_DATA_VERDICT; desc->type = NFT_DATA_VERDICT;
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment