From owner-svn-src-projects@FreeBSD.ORG Tue Oct 7 18:22:06 2014 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 33F40205; Tue, 7 Oct 2014 18:22:06 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 1F152AC5; Tue, 7 Oct 2014 18:22:06 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s97IM5fG036331; Tue, 7 Oct 2014 18:22:05 GMT (envelope-from melifaro@FreeBSD.org) Received: (from melifaro@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s97IM5eO036330; Tue, 7 Oct 2014 18:22:05 GMT (envelope-from melifaro@FreeBSD.org) Message-Id: <201410071822.s97IM5eO036330@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: melifaro set sender to melifaro@FreeBSD.org using -f From: "Alexander V. Chernikov" Date: Tue, 7 Oct 2014 18:22:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r272714 - projects/ipfw/sys/netpfil/ipfw X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Oct 2014 18:22:06 -0000 Author: melifaro Date: Tue Oct 7 18:22:05 2014 New Revision: 272714 URL: https://svnweb.freebsd.org/changeset/base/272714 Log: Fix possible crash when old value pointer is not updated after array resize. Modified: projects/ipfw/sys/netpfil/ipfw/ip_fw_table_value.c Modified: projects/ipfw/sys/netpfil/ipfw/ip_fw_table_value.c ============================================================================== --- projects/ipfw/sys/netpfil/ipfw/ip_fw_table_value.c Tue Oct 7 18:00:34 2014 (r272713) +++ projects/ipfw/sys/netpfil/ipfw/ip_fw_table_value.c Tue Oct 7 18:22:05 2014 (r272714) @@ -555,8 +555,17 @@ ipfw_link_table_values(struct ip_fw_chai /* Let's try to link values */ for (i = 0; i < count; i++) { ptei = &tei[i]; - if (ptei->value != 0) + if (ptei->value != 0) { + + /* + * We may be here after several process restarts, + * so we need to update all fields that might + * have changed. + */ + ptv = (struct table_val_link *)ptei->ptv; + ptv->pval = &pval[i]; continue; + } /* Check if record has appeared */ mask_table_value(ptei->pvalue, &tval, ts->vmask);