Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-8]: src/sys/netipsec Pull up following revision(s) (requested by ...



details:   https://anonhg.NetBSD.org/src/rev/9103cfc5cedd
branches:  netbsd-8
changeset: 434642:9103cfc5cedd
user:      martin <martin%NetBSD.org@localhost>
date:      Fri Feb 16 16:35:18 2018 +0000

description:
Pull up following revision(s) (requested by maxv in ticket #559):

        sys/netipsec/ipsec.c: revision 1.130

Fix inverted logic, otherwise the kernel crashes when receiving a 1-byte
AH packet. Triggerable before authentication when IPsec and forwarding
are both enabled.

diffstat:

 sys/netipsec/ipsec.c |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (27 lines):

diff -r f814693df8db -r 9103cfc5cedd sys/netipsec/ipsec.c
--- a/sys/netipsec/ipsec.c      Thu Feb 15 14:29:45 2018 +0000
+++ b/sys/netipsec/ipsec.c      Fri Feb 16 16:35:18 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ipsec.c,v 1.99.2.3 2018/02/05 14:55:16 martin Exp $    */
+/*     $NetBSD: ipsec.c,v 1.99.2.4 2018/02/16 16:35:18 martin Exp $    */
 /*     $FreeBSD: /usr/local/www/cvsroot/FreeBSD/src/sys/netipsec/ipsec.c,v 1.2.2.2 2003/07/01 01:38:13 sam Exp $       */
 /*     $KAME: ipsec.c,v 1.103 2001/05/24 07:14:18 sakane Exp $ */
 
@@ -32,7 +32,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ipsec.c,v 1.99.2.3 2018/02/05 14:55:16 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ipsec.c,v 1.99.2.4 2018/02/16 16:35:18 martin Exp $");
 
 /*
  * IPsec controller part.
@@ -1060,7 +1060,7 @@
                        spidx->dst.sin.sin_port = uh.uh_dport;
                        return;
                case IPPROTO_AH:
-                       if (m->m_pkthdr.len > off + sizeof(ip6e))
+                       if (off + sizeof(ip6e) > m->m_pkthdr.len)
                                goto done;
                        /* XXX sigh, this works but is totally bogus */
                        m_copydata(m, off, sizeof(ip6e), &ip6e);



Home | Main Index | Thread Index | Old Index