* [PATCH net] netfilter: xt_TEE: fix NULL dereference
@ 2015-10-20 1:02 Eric Dumazet
2015-10-20 10:19 ` Pablo Neira Ayuso
0 siblings, 1 reply; 2+ messages in thread
From: Eric Dumazet @ 2015-10-20 1:02 UTC (permalink / raw)
To: Pablo Neira Ayuso; +Cc: netfilter-devel, netdev
From: Eric Dumazet <edumazet@google.com>
iptables -I INPUT ... -j TEE --gateway 10.1.2.3
<crash> because --oif was not specified
tee_tg_check() sets ->priv pointer to NULL in this case.
Fixes: bbde9fc1824a ("netfilter: factor out packet duplication for IPv4/IPv6")
Signed-off-by: Eric Dumazet <edumazet@google.com>
---
net/netfilter/xt_TEE.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/net/netfilter/xt_TEE.c b/net/netfilter/xt_TEE.c
index fd980aa7715d..c5fdea18a9af 100644
--- a/net/netfilter/xt_TEE.c
+++ b/net/netfilter/xt_TEE.c
@@ -31,8 +31,9 @@ static unsigned int
tee_tg4(struct sk_buff *skb, const struct xt_action_param *par)
{
const struct xt_tee_tginfo *info = par->targinfo;
+ int oif = info->priv ? info->priv->oif : 0;
- nf_dup_ipv4(skb, par->hooknum, &info->gw.in, info->priv->oif);
+ nf_dup_ipv4(skb, par->hooknum, &info->gw.in, oif);
return XT_CONTINUE;
}
@@ -42,8 +43,9 @@ static unsigned int
tee_tg6(struct sk_buff *skb, const struct xt_action_param *par)
{
const struct xt_tee_tginfo *info = par->targinfo;
+ int oif = info->priv ? info->priv->oif : 0;
- nf_dup_ipv6(skb, par->hooknum, &info->gw.in6, info->priv->oif);
+ nf_dup_ipv6(skb, par->hooknum, &info->gw.in6, oif);
return XT_CONTINUE;
}
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH net] netfilter: xt_TEE: fix NULL dereference
2015-10-20 1:02 [PATCH net] netfilter: xt_TEE: fix NULL dereference Eric Dumazet
@ 2015-10-20 10:19 ` Pablo Neira Ayuso
0 siblings, 0 replies; 2+ messages in thread
From: Pablo Neira Ayuso @ 2015-10-20 10:19 UTC (permalink / raw)
To: Eric Dumazet; +Cc: netfilter-devel, netdev
On Mon, Oct 19, 2015 at 06:02:01PM -0700, Eric Dumazet wrote:
> From: Eric Dumazet <edumazet@google.com>
>
> iptables -I INPUT ... -j TEE --gateway 10.1.2.3
>
> <crash> because --oif was not specified
>
> tee_tg_check() sets ->priv pointer to NULL in this case.
Applied here, will push it out after the pending pull request.
Thanks Eric.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-10-20 10:19 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-10-20 1:02 [PATCH net] netfilter: xt_TEE: fix NULL dereference Eric Dumazet
2015-10-20 10:19 ` Pablo Neira Ayuso
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).