From owner-svn-src-stable@FreeBSD.ORG Thu Feb 3 11:09:27 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7CDFA106566C; Thu, 3 Feb 2011 11:09:27 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6BC858FC0A; Thu, 3 Feb 2011 11:09:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p13B9RdS043400; Thu, 3 Feb 2011 11:09:27 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p13B9RIx043398; Thu, 3 Feb 2011 11:09:27 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201102031109.p13B9RIx043398@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Thu, 3 Feb 2011 11:09:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r218216 - stable/8/sys/geom/part X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 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: Thu, 03 Feb 2011 11:09:27 -0000 Author: ae Date: Thu Feb 3 11:09:27 2011 New Revision: 218216 URL: http://svn.freebsd.org/changeset/base/218216 Log: MFC r217924: While inspecting the disklabel check that start offset of partition is within provider's bounds. If not then reject this disklabel. Mark bbarea as NULL to do not free it again in destroy method. Modified: stable/8/sys/geom/part/g_part_bsd.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/geom/part/g_part_bsd.c ============================================================================== --- stable/8/sys/geom/part/g_part_bsd.c Thu Feb 3 10:44:40 2011 (r218215) +++ stable/8/sys/geom/part/g_part_bsd.c Thu Feb 3 11:09:27 2011 (r218216) @@ -426,6 +426,8 @@ g_part_bsd_read(struct g_part_table *bas continue; if (part.p_offset < table->offset) continue; + if (part.p_offset - table->offset > basetable->gpt_last) + goto invalid_label; baseentry = g_part_new_entry(basetable, index + 1, part.p_offset - table->offset, part.p_offset - table->offset + part.p_size - 1); @@ -440,6 +442,7 @@ g_part_bsd_read(struct g_part_table *bas invalid_label: printf("GEOM: %s: invalid disklabel.\n", pp->name); g_free(table->bbarea); + table->bbarea = NULL; return (EINVAL); }