All of lore.kernel.org
 help / color / mirror / Atom feed
* Patch "netfilter: ipv6: fix use-after-free Write in nf_nat_ipv6_manip_pkt" has been added to the 4.15-stable tree
@ 2018-03-13 11:15 gregkh
  0 siblings, 0 replies; only message in thread
From: gregkh @ 2018-03-13 11:15 UTC (permalink / raw)
  To: fw, gregkh, pablo, syzbot+10005f4292fc9cc89de7; +Cc: stable, stable-commits


This is a note to let you know that I've just added the patch titled

    netfilter: ipv6: fix use-after-free Write in nf_nat_ipv6_manip_pkt

to the 4.15-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     netfilter-ipv6-fix-use-after-free-write-in-nf_nat_ipv6_manip_pkt.patch
and it can be found in the queue-4.15 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@vger.kernel.org> know about it.


>From b078556aecd791b0e5cb3a59f4c3a14273b52121 Mon Sep 17 00:00:00 2001
From: Florian Westphal <fw@strlen.de>
Date: Mon, 19 Feb 2018 08:10:17 +0100
Subject: netfilter: ipv6: fix use-after-free Write in nf_nat_ipv6_manip_pkt

From: Florian Westphal <fw@strlen.de>

commit b078556aecd791b0e5cb3a59f4c3a14273b52121 upstream.

l4proto->manip_pkt() can cause reallocation of skb head so pointer
to the ipv6 header must be reloaded.

Reported-and-tested-by: <syzbot+10005f4292fc9cc89de7@syzkaller.appspotmail.com>
Fixes: 58a317f1061c89 ("netfilter: ipv6: add IPv6 NAT support")
Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 net/ipv6/netfilter/nf_nat_l3proto_ipv6.c |    4 ++++
 1 file changed, 4 insertions(+)

--- a/net/ipv6/netfilter/nf_nat_l3proto_ipv6.c
+++ b/net/ipv6/netfilter/nf_nat_l3proto_ipv6.c
@@ -99,6 +99,10 @@ static bool nf_nat_ipv6_manip_pkt(struct
 	    !l4proto->manip_pkt(skb, &nf_nat_l3proto_ipv6, iphdroff, hdroff,
 				target, maniptype))
 		return false;
+
+	/* must reload, offset might have changed */
+	ipv6h = (void *)skb->data + iphdroff;
+
 manip_addr:
 	if (maniptype == NF_NAT_MANIP_SRC)
 		ipv6h->saddr = target->src.u3.in6;


Patches currently in stable-queue which might be from fw@strlen.de are

queue-4.15/netfilter-add-back-stackpointer-size-checks.patch
queue-4.15/netfilter-ipv6-fix-use-after-free-write-in-nf_nat_ipv6_manip_pkt.patch
queue-4.15/netfilter-ebtables-config_compat-don-t-trust-userland-offsets.patch
queue-4.15/netfilter-bridge-ebt_among-add-missing-match-size-checks.patch

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2018-03-13 11:15 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-03-13 11:15 Patch "netfilter: ipv6: fix use-after-free Write in nf_nat_ipv6_manip_pkt" has been added to the 4.15-stable tree gregkh

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.