Skip to content

Commit

Permalink
Merge git://git.kernel.org/pub/scm/linux/kernel/git/pablo/nf
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
davem330 committed Apr 28, 2015
2 parents 876a7ae + 547c4b5 commit 39376cc
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
16 changes: 14 additions & 2 deletions include/linux/netfilter_bridge.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 *
Expand Down
3 changes: 1 addition & 2 deletions net/netfilter/nf_tables_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -4340,7 +4340,6 @@ static int nft_verdict_init(const struct nft_ctx *ctx, struct nft_data *data,
case NFT_CONTINUE:
case NFT_BREAK:
case NFT_RETURN:
desc->len = sizeof(data->verdict);
break;
case NFT_JUMP:
case NFT_GOTO:
Expand All @@ -4355,10 +4354,10 @@ static int nft_verdict_init(const struct nft_ctx *ctx, struct nft_data *data,

chain->use++;
data->verdict.chain = chain;
desc->len = sizeof(data);
break;
}

desc->len = sizeof(data->verdict);
desc->type = NFT_DATA_VERDICT;
return 0;
}
Expand Down

0 comments on commit 39376cc

Please sign in to comment.