Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/netbsd-6-0]: src/sys/netinet6 Pull up following revision(s) (requested b...
details: https://anonhg.NetBSD.org/src/rev/0b0a8f40fee1
branches: netbsd-6-0
changeset: 775321:0b0a8f40fee1
user: martin <martin%NetBSD.org@localhost>
date: Sun Apr 01 09:24:38 2018 +0000
description:
Pull up following revision(s) (requested by maxv in ticket #1541):
sys/netinet6/raw_ip6.c: revision 1.161
Fix use-after-free, the first m_copyback_cow may have freed the mbuf, so
it is wrong to read ip6->ip6_nxt.
diffstat:
sys/netinet6/raw_ip6.c | 7 ++++---
1 files changed, 4 insertions(+), 3 deletions(-)
diffs (35 lines):
diff -r 00057c2afc02 -r 0b0a8f40fee1 sys/netinet6/raw_ip6.c
--- a/sys/netinet6/raw_ip6.c Sun Apr 01 09:20:22 2018 +0000
+++ b/sys/netinet6/raw_ip6.c Sun Apr 01 09:24:38 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: raw_ip6.c,v 1.109.6.1 2018/01/30 18:47:35 martin Exp $ */
+/* $NetBSD: raw_ip6.c,v 1.109.6.2 2018/04/01 09:24:38 martin Exp $ */
/* $KAME: raw_ip6.c,v 1.82 2001/07/23 18:57:56 jinmei Exp $ */
/*
@@ -62,7 +62,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: raw_ip6.c,v 1.109.6.1 2018/01/30 18:47:35 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: raw_ip6.c,v 1.109.6.2 2018/04/01 09:24:38 martin Exp $");
#include "opt_ipsec.h"
@@ -502,6 +502,7 @@
if (so->so_proto->pr_protocol == IPPROTO_ICMPV6 ||
in6p->in6p_cksum != -1) {
+ const uint8_t nxt = ip6->ip6_nxt;
int off;
u_int16_t sum;
@@ -523,7 +524,7 @@
error = ENOBUFS;
goto bad;
}
- sum = in6_cksum(m, ip6->ip6_nxt, sizeof(*ip6), plen);
+ sum = in6_cksum(m, nxt, sizeof(*ip6), plen);
m = m_copyback_cow(m, off, sizeof(sum), (void *)&sum,
M_DONTWAIT);
if (m == NULL) {
Home |
Main Index |
Thread Index |
Old Index