Date: Mon, 7 Jan 2013 07:49:39 +0100 (CET) From: Andre Albsmeier <Andre.Albsmeier@siemens.com> To: FreeBSD-gnats-submit@freebsd.org Subject: bin/175086: 9.1 does not boot from GPT partition that can have more that 128 partition entries (worked under 7.4-STABLE, bug in sys/boot/common/gpt.c) Message-ID: <201301070649.r076nd7q018805@curry.mchp.siemens.de> Resent-Message-ID: <201301070700.r07700Qq037270@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 175086 >Category: bin >Synopsis: 9.1 does not boot from GPT partition that can have more that 128 partition entries (worked under 7.4-STABLE, bug in sys/boot/common/gpt.c) >Confidential: no >Severity: critical >Priority: high >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Mon Jan 07 07:00:00 UTC 2013 >Closed-Date: >Last-Modified: >Originator: Andre Albsmeier >Release: FreeBSD 9.1-PRERELEASE i386 >Organization: >Environment: System: FreeBSD 9.1-PRERELEASE >Description: Booting from a GPT partitioned disk that can have more than 128 parition entries (e.g. 248 in this case) fails under 9.1 but worked under 7.4. This is due to a test that was introduced in sys/boot/common/gpt.c: ... #define MAXTBLENTS 128 ... if (bcmp(hdr->hdr_sig, GPT_HDR_SIG, sizeof(hdr->hdr_sig)) != 0 || hdr->hdr_lba_self != hdrlba || hdr->hdr_revision < 0x00010000 || hdr->hdr_entsz < sizeof(struct gpt_ent) || hdr->hdr_entries > MAXTBLENTS || DEV_BSIZE % hdr->hdr_entsz != 0) { printf("%s: invalid %s GPT header\n", BOOTPROG, which); return (-1); } >How-To-Repeat: Create a disk using gpart create -s gpt -n 248 $disk and add bootcode and system to it. Add some delay into gptinit() of sys/boot/i386/gptboot/gptboot.c so you can read the error messages before reset occurs: invalid primary GPT header invalid backup GPT header unable to load GPT >Fix: The check should be removed since a GPT header with more than 128 possible parition entries is not invalid and can legally be created with gpart. >Release-Note: >Audit-Trail: >Unformatted:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201301070649.r076nd7q018805>