From owner-svn-src-stable@freebsd.org Wed Sep 6 10:21:30 2017 Return-Path: Delivered-To: svn-src-stable@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 89DABE1F27A; Wed, 6 Sep 2017 10:21:30 +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 6DC9873780; Wed, 6 Sep 2017 10:21:29 +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 v86ALSvx087269; Wed, 6 Sep 2017 10:21:28 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v86ALSvx087268; Wed, 6 Sep 2017 10:21:28 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201709061021.v86ALSvx087268@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Wed, 6 Sep 2017 10:21:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r323216 - stable/11/sys/netipsec X-SVN-Group: stable-11 X-SVN-Commit-Author: ae X-SVN-Commit-Paths: stable/11/sys/netipsec X-SVN-Commit-Revision: 323216 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Sep 2017 10:21:30 -0000 Author: ae Date: Wed Sep 6 10:21:28 2017 New Revision: 323216 URL: https://svnweb.freebsd.org/changeset/base/323216 Log: MFC r323086: 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 Modified: stable/11/sys/netipsec/udpencap.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/netipsec/udpencap.c ============================================================================== --- stable/11/sys/netipsec/udpencap.c Wed Sep 6 09:19:54 2017 (r323215) +++ stable/11/sys/netipsec/udpencap.c Wed Sep 6 10:21:28 2017 (r323216) @@ -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. */ }