Date: Thu, 3 Feb 2011 11:09:27 +0000 (UTC) From: "Andrey V. Elsukov" <ae@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r218216 - stable/8/sys/geom/part Message-ID: <201102031109.p13B9RIx043398@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
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); }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201102031109.p13B9RIx043398>