Source-Changes-HG archive

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

[src/netbsd-1-6]: src/sys/netinet6 Pull up revision 1.30 (requested by itojun...



details:   https://anonhg.NetBSD.org/src/rev/d4b8d175ac60
branches:  netbsd-1-6
changeset: 530506:d4b8d175ac60
user:      tron <tron%NetBSD.org@localhost>
date:      Thu Jul 10 15:47:36 2003 +0000

description:
Pull up revision 1.30 (requested by itojun in ticket #1364):
fix missing check for taillen against pkthdr.len.  markus@openbsd

diffstat:

 sys/netinet6/esp_input.c |  8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diffs (29 lines):

diff -r 55c4b9035650 -r d4b8d175ac60 sys/netinet6/esp_input.c
--- a/sys/netinet6/esp_input.c  Thu Jul 10 15:45:55 2003 +0000
+++ b/sys/netinet6/esp_input.c  Thu Jul 10 15:47:36 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: esp_input.c,v 1.21.6.2 2002/12/10 07:08:36 jmc Exp $   */
+/*     $NetBSD: esp_input.c,v 1.21.6.3 2003/07/10 15:47:36 tron Exp $  */
 /*     $KAME: esp_input.c,v 1.60 2001/09/04 08:43:19 itojun Exp $      */
 
 /*
@@ -35,7 +35,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: esp_input.c,v 1.21.6.2 2002/12/10 07:08:36 jmc Exp $");
+__KERNEL_RCSID(0, "$NetBSD: esp_input.c,v 1.21.6.3 2003/07/10 15:47:36 tron Exp $");
 
 #include "opt_inet.h"
 
@@ -330,8 +330,8 @@
        nxt = esptail.esp_nxt;
        taillen = esptail.esp_padlen + sizeof(esptail);
 
-       if (m->m_pkthdr.len < taillen
-        || m->m_pkthdr.len - taillen < hlen) { /* ? */
+       if (m->m_pkthdr.len < taillen ||
+           m->m_pkthdr.len - taillen < off + esplen + ivlen + sizeof(esptail)) {
                ipseclog((LOG_WARNING,
                    "bad pad length in IPv4 ESP input: %s %s\n",
                    ipsec4_logpacketstr(ip, spi), ipsec_logsastr(sav)));



Home | Main Index | Thread Index | Old Index