From owner-svn-src-stable@freebsd.org Mon Mar 6 23:43:46 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 CB38AD00484; Mon, 6 Mar 2017 23:43:46 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from venus.codepro.be (venus.codepro.be [IPv6:2a01:4f8:162:1127::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.codepro.be", Issuer "Gandi Standard SSL CA 2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 976A512A6; Mon, 6 Mar 2017 23:43:46 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from [172.16.1.189] (s224.GtokyoFL6.vectant.ne.jp [222.228.90.224]) (Authenticated sender: kp) by venus.codepro.be (Postfix) with ESMTPSA id ACB2C1E438; Tue, 7 Mar 2017 00:43:41 +0100 (CET) From: "Kristof Provost" To: "Gleb Smirnoff" Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: Re: svn commit: r314702 - stable/11/sys/netpfil/pf Date: Tue, 07 Mar 2017 08:43:38 +0900 Message-ID: <144CFF47-7384-401C-A4A7-B36155C97929@FreeBSD.org> In-Reply-To: <20170306230138.GD1044@FreeBSD.org> References: <201703051314.v25DEIj6076074@repo.freebsd.org> <20170306230138.GD1044@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed; markup=markdown Content-Transfer-Encoding: 8bit X-Mailer: MailMate (2.0BETAr6080) 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: Mon, 06 Mar 2017 23:43:46 -0000 Oops. That’ll teach me to commit things while jet-lagged. It’s been committed on head in r314810. Thanks for the heads up. Regards, Kristof On 7 Mar 2017, at 8:01, Gleb Smirnoff wrote: > Kristof, > > this seems accidentially committed to stable branch. Please add it > to head. > > And thanks a lot for the fix. Very likely this is my mistake back from > 2012. > > On Sun, Mar 05, 2017 at 01:14:18PM +0000, Kristof Provost wrote: > K> Author: kp > K> Date: Sun Mar 5 13:14:18 2017 > K> New Revision: 314702 > K> URL: https://svnweb.freebsd.org/changeset/base/314702 > K> > K> Log: > K> pf: Fix a crash in low-memory situations > K> > K> If the call to pf_state_key_clone() in pf_get_translation() fails > (i.e. there's > K> no more memory for it) it frees skp. This is wrong, because skp > is a > K> pf_state_key **, so we need to free *skp, as is done later in the > function. > K> Getting it wrong means we try to free a stack variable of the > calling > K> pf_test_rule() function, and we panic. > K> > K> Modified: > K> stable/11/sys/netpfil/pf/pf_lb.c > K> > K> Modified: stable/11/sys/netpfil/pf/pf_lb.c > K> > ============================================================================== > K> --- stable/11/sys/netpfil/pf/pf_lb.c Sun Mar 5 12:06:45 > 2017 (r314701) > K> +++ stable/11/sys/netpfil/pf/pf_lb.c Sun Mar 5 13:14:18 > 2017 (r314702) > K> @@ -553,7 +553,7 @@ pf_get_translation(struct pf_pdesc *pd, > K> return (NULL); > K> *nkp = pf_state_key_clone(*skp); > K> if (*nkp == NULL) { > K> - uma_zfree(V_pf_state_key_z, skp); > K> + uma_zfree(V_pf_state_key_z, *skp); > K> *skp = NULL; > K> return (NULL); > K> } > K> _______________________________________________ > K> svn-src-all@freebsd.org mailing list > K> https://lists.freebsd.org/mailman/listinfo/svn-src-all > K> To unsubscribe, send any mail to > "svn-src-all-unsubscribe@freebsd.org" > > -- > Totus tuus, Glebius.