From owner-svn-src-head@freebsd.org Fri Sep 1 11:51:09 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1D36FE095A3; Fri, 1 Sep 2017 11:51:09 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DBF006ED3A; Fri, 1 Sep 2017 11:51:08 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v81Bp73W081651; Fri, 1 Sep 2017 11:51:07 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v81Bp7aX081650; Fri, 1 Sep 2017 11:51:07 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201709011151.v81Bp7aX081650@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Fri, 1 Sep 2017 11:51:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323086 - head/sys/netipsec X-SVN-Group: head X-SVN-Commit-Author: ae X-SVN-Commit-Paths: head/sys/netipsec X-SVN-Commit-Revision: 323086 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Sep 2017 11:51:09 -0000 Author: ae Date: Fri Sep 1 11:51:07 2017 New Revision: 323086 URL: https://svnweb.freebsd.org/changeset/base/323086 Log: Fix possible double releasing for SA reference. This is missing part of r318734. When crypto subsystem returns error the xform code handles an error independently. PR: 221849 MFC after: 5 days Modified: head/sys/netipsec/udpencap.c Modified: head/sys/netipsec/udpencap.c ============================================================================== --- head/sys/netipsec/udpencap.c Fri Sep 1 11:14:30 2017 (r323085) +++ head/sys/netipsec/udpencap.c Fri Sep 1 11:51:07 2017 (r323086) @@ -120,7 +120,7 @@ udp_ipsec_input(struct mbuf *m, int off, int af) struct udphdr *udp; struct ip *ip; uint32_t spi; - int error, hlen; + int hlen; /* * Just return if packet doesn't have enough data. @@ -205,10 +205,7 @@ udp_ipsec_input(struct mbuf *m, int off, int af) * will do this anyway, so don't touch them here. */ ESPSTAT_INC(esps_input); - error = (*sav->tdb_xform->xf_input)(m, sav, hlen, off); - if (error != 0) - key_freesav(&sav); - + (*sav->tdb_xform->xf_input)(m, sav, hlen, off); return (EINPROGRESS); /* Consumed by IPsec. */ }