* [PATCH] netfilter: nf_conntrack_ipv6: Plug sk_buff leak in fragment handling
@ 2013-06-19 10:49 Phil Oester
2013-06-20 9:20 ` Florian Westphal
0 siblings, 1 reply; 3+ messages in thread
From: Phil Oester @ 2013-06-19 10:49 UTC (permalink / raw)
To: netfilter-devel; +Cc: pablo, kaber
[-- Attachment #1: Type: text/plain, Size: 618 bytes --]
In commit 4cdd3408 ("netfilter: nf_conntrack_ipv6: improve fragmentation
handling"), an sk_buff leak was introduced when dealing with reassembled
packets by grabbing a reference to the original skb instead of the
reassembled skb. At this point, the leak only impacted conntracks with an
associated helper.
In commit 58a317f1 ("netfilter: ipv6: add IPv6 NAT support"), the bug was
expanded to include all reassembled packets with unconfirmed conntracks.
Fix this by grabbing a reference to the proper reassembled skb. This closes
netfilter bugzilla #823.
Phil
Signed-off-by: Phil Oester <kernel@linuxace.com>
[-- Attachment #2: patch-ipv6_skb_leak --]
[-- Type: text/plain, Size: 654 bytes --]
diff --git a/net/ipv6/netfilter/nf_conntrack_l3proto_ipv6.c b/net/ipv6/netfilter/nf_conntrack_l3proto_ipv6.c
index 97bcf2b..c9b6a6e 100644
--- a/net/ipv6/netfilter/nf_conntrack_l3proto_ipv6.c
+++ b/net/ipv6/netfilter/nf_conntrack_l3proto_ipv6.c
@@ -204,7 +204,7 @@ static unsigned int __ipv6_conntrack_in(struct net *net,
if (ct != NULL && !nf_ct_is_untracked(ct)) {
help = nfct_help(ct);
if ((help && help->helper) || !nf_ct_is_confirmed(ct)) {
- nf_conntrack_get_reasm(skb);
+ nf_conntrack_get_reasm(reasm);
NF_HOOK_THRESH(NFPROTO_IPV6, hooknum, reasm,
(struct net_device *)in,
(struct net_device *)out,
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] netfilter: nf_conntrack_ipv6: Plug sk_buff leak in fragment handling
2013-06-19 10:49 [PATCH] netfilter: nf_conntrack_ipv6: Plug sk_buff leak in fragment handling Phil Oester
@ 2013-06-20 9:20 ` Florian Westphal
2013-06-20 9:56 ` Pablo Neira Ayuso
0 siblings, 1 reply; 3+ messages in thread
From: Florian Westphal @ 2013-06-20 9:20 UTC (permalink / raw)
To: Phil Oester; +Cc: netfilter-devel, pablo, kaber, davem, security
Phil Oester <kernel@linuxace.com> wrote:
> In commit 4cdd3408 ("netfilter: nf_conntrack_ipv6: improve fragmentation
> handling"), an sk_buff leak was introduced when dealing with reassembled
> packets by grabbing a reference to the original skb instead of the
> reassembled skb. At this point, the leak only impacted conntracks with an
> associated helper.
David, could you please apply this patch directly in case Pablo doesn't
apply it first? This fixes a remote DoS, so it better hit -stable ASAP.
Thanks.
[ archive link: http://patchwork.ozlabs.org/patch/252692/ ]
> diff --git a/net/ipv6/netfilter/nf_conntrack_l3proto_ipv6.c b/net/ipv6/netfilter/nf_conntrack_l3proto_ipv6.c
> index 97bcf2b..c9b6a6e 100644
> --- a/net/ipv6/netfilter/nf_conntrack_l3proto_ipv6.c
> +++ b/net/ipv6/netfilter/nf_conntrack_l3proto_ipv6.c
> @@ -204,7 +204,7 @@ static unsigned int __ipv6_conntrack_in(struct net *net,
> if (ct != NULL && !nf_ct_is_untracked(ct)) {
> help = nfct_help(ct);
> if ((help && help->helper) || !nf_ct_is_confirmed(ct)) {
> - nf_conntrack_get_reasm(skb);
> + nf_conntrack_get_reasm(reasm);
> NF_HOOK_THRESH(NFPROTO_IPV6, hooknum, reasm,
> (struct net_device *)in,
> (struct net_device *)out,
Thanks for fixing it, but personally I would have preferred a short early
warning period.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] netfilter: nf_conntrack_ipv6: Plug sk_buff leak in fragment handling
2013-06-20 9:20 ` Florian Westphal
@ 2013-06-20 9:56 ` Pablo Neira Ayuso
0 siblings, 0 replies; 3+ messages in thread
From: Pablo Neira Ayuso @ 2013-06-20 9:56 UTC (permalink / raw)
To: Florian Westphal; +Cc: Phil Oester, netfilter-devel, kaber, davem, security
On Thu, Jun 20, 2013 at 11:20:31AM +0200, Florian Westphal wrote:
> Phil Oester <kernel@linuxace.com> wrote:
> > In commit 4cdd3408 ("netfilter: nf_conntrack_ipv6: improve fragmentation
> > handling"), an sk_buff leak was introduced when dealing with reassembled
> > packets by grabbing a reference to the original skb instead of the
> > reassembled skb. At this point, the leak only impacted conntracks with an
> > associated helper.
>
> David, could you please apply this patch directly in case Pablo doesn't
> apply it first? This fixes a remote DoS, so it better hit -stable ASAP.
I'll take care of it.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2013-06-20 9:56 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-06-19 10:49 [PATCH] netfilter: nf_conntrack_ipv6: Plug sk_buff leak in fragment handling Phil Oester
2013-06-20 9:20 ` Florian Westphal
2013-06-20 9:56 ` 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).