Module Name:    src
Committed By:   knakahara
Date:           Thu Jan 23 09:09:59 UTC 2020

Modified Files:
        src/sys/netinet: ip_encap.c

Log Message:
Fix PR security/54881.  Pointed out by ohishi@IIJ, thanks.


To generate a diff of this commit:
cvs rdiff -u -r1.71 -r1.72 src/sys/netinet/ip_encap.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/netinet/ip_encap.c
diff -u src/sys/netinet/ip_encap.c:1.71 src/sys/netinet/ip_encap.c:1.72
--- src/sys/netinet/ip_encap.c:1.71	Wed May 15 03:33:41 2019
+++ src/sys/netinet/ip_encap.c	Thu Jan 23 09:09:59 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: ip_encap.c,v 1.71 2019/05/15 03:33:41 knakahara Exp $	*/
+/*	$NetBSD: ip_encap.c,v 1.72 2020/01/23 09:09:59 knakahara Exp $	*/
 /*	$KAME: ip_encap.c,v 1.73 2001/10/02 08:30:58 itojun Exp $	*/
 
 /*
@@ -68,7 +68,7 @@
 #define USE_RADIX
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ip_encap.c,v 1.71 2019/05/15 03:33:41 knakahara Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ip_encap.c,v 1.72 2020/01/23 09:09:59 knakahara Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_mrouting.h"
@@ -884,10 +884,11 @@ encap6_ctlinput(int cmd, const struct so
 		 	*/
 			match = encap6_lookup(m, off, nxt, OUTBOUND,
 			    &elem_psref);
-			if (match)
+			if (match) {
 				valid++;
-			psref_release(&elem_psref, &match->psref,
-			    encaptab.elem_class);
+				psref_release(&elem_psref, &match->psref,
+				    encaptab.elem_class);
+			}
 
 			/*
 		 	* Depending on the value of "valid" and routing table

Reply via email to