Module Name: src
Committed By: martin
Date: Fri Mar 30 11:53:13 UTC 2018
Modified Files:
src/sys/netipsec [netbsd-8]: xform_esp.c
Log Message:
Pull up following revision(s) (requested by maxv in ticket #670):
sys/netipsec/xform_esp.c: revision 1.73
Add missing NULL check. Normally that's not triggerable remotely, since we
are guaranteed that 8 bytes are valid at mbuf+skip.
To generate a diff of this commit:
cvs rdiff -u -r1.55.2.2 -r1.55.2.3 src/sys/netipsec/xform_esp.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/netipsec/xform_esp.c
diff -u src/sys/netipsec/xform_esp.c:1.55.2.2 src/sys/netipsec/xform_esp.c:1.55.2.3
--- src/sys/netipsec/xform_esp.c:1.55.2.2 Mon Feb 26 13:10:52 2018
+++ src/sys/netipsec/xform_esp.c Fri Mar 30 11:53:13 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: xform_esp.c,v 1.55.2.2 2018/02/26 13:10:52 martin Exp $ */
+/* $NetBSD: xform_esp.c,v 1.55.2.3 2018/03/30 11:53:13 martin Exp $ */
/* $FreeBSD: src/sys/netipsec/xform_esp.c,v 1.2.2.1 2003/01/24 05:11:36 sam Exp $ */
/* $OpenBSD: ip_esp.c,v 1.69 2001/06/26 06:18:59 angelos Exp $ */
@@ -39,7 +39,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: xform_esp.c,v 1.55.2.2 2018/02/26 13:10:52 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xform_esp.c,v 1.55.2.3 2018/03/30 11:53:13 martin Exp $");
#if defined(_KERNEL_OPT)
#include "opt_inet.h"
@@ -319,6 +319,10 @@ esp_input(struct mbuf *m, struct secasva
/* XXX don't pullup, just copy header */
IP6_EXTHDR_GET(esp, struct newesp *, m, skip, sizeof(struct newesp));
+ if (esp == NULL) {
+ /* m already freed */
+ return EINVAL;
+ }
esph = sav->tdb_authalgxform;
espx = sav->tdb_encalgxform;