Netfilter fixes for net
Subsystems (3)
Pablo Neira Ayuso
maintainercover Netfilter fixes for net
Hi David,
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.
You can pull these changes from:
git://git.kernel.org/pub/scm/linux/kernel/git/pablo/nf.git
Thanks!
----------------------------------------------------------------
The following changes since commit b357a364c57c940ddb932224542494363df37378:
inet: fix possible panic in reqsk_queue_unlink() (2015-04-24 11:39:15 -0400)
are available in the git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/pablo/nf.git master
for you to fetch changes up to 547c4b547e07dcc60874b6ef6252dd49ff74aec1:
netfilter: bridge: fix NULL deref in physin/out ifindex helpers (2015-04-24 20:51:40 +0200)
----------------------------------------------------------------
Florian Westphal (2):
netfilter: nf_tables: fix wrong length for jump/goto verdicts
netfilter: bridge: fix NULL deref in physin/out ifindex helpers
include/linux/netfilter_bridge.h | 16 ++++++++++++++-- net/netfilter/nf_tables_api.c | 3 +-- 2 files changed, 15 insertions(+), 4 deletions(-)
Pablo Neira Ayuso
maintainerPATCH 1/2 netfilter: nf_tables: fix wrong length for jump/goto verdicts
From: Florian Westphal <[email protected]>
NFT_JUMP/GOTO erronously sets length to sizeof(void *).
We then allocate insufficient memory when such element is added to a vmap.
--- net/netfilter/nf_tables_api.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
net/netfilter/nf_tables_api.c +1 -2
@@ -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 :
@@ -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 ; }
Signature · 1 line
1.7.10.4
Pablo Neira Ayuso
maintainerPATCH 2/2 netfilter: bridge: fix NULL deref in physin/out ifindex helpers
In reply to Pablo Neira AyusoFrom: Florian Westphal <[email protected]>
Might not have an outdev yet. We'll oops when iface goes down while skbs are still nfqueue'd:
RIP: 0010:[<ffffffff81422a2f>] [<ffffffff81422a2f>] dev_cmp+0x4f/0x80 nfqnl_rcv_dev_event+0xe2/0x150 notifier_call_chain+0x53/0xa0
--- include/linux/netfilter_bridge.h | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-)
include/linux/netfilter_bridge.h +14 -2
@@ -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 *
Signature · 1 line
1.7.10.4
David Miller
maintainerFrom: Pablo Neira Ayuso <[email protected]>
Date: Mon, 27 Apr 2015 20:41:55 +0200
Quoted 10 lines
The following patchset contains Netfilter fixes for your net tree, they are:
1) Fix a crash in
nf_tableswhen dictionaries are used from the ruleset, due to memory corruption, from Florian Westphal.2) Fix another crash in
nf_queuewhen used withbr_netfilter. Also from Florian.Both fixes are related to new stuff that got in 4.0-rc.
Pulled, thanks Pablo.