[email protected]
[Top] [All Lists]

kern/39897: sizeof(struct gpt_hdr);

Subject: kern/39897: sizeof(struct gpt_hdr);
Date: Tue, 11 Nov 2008 19:00:01 +0000 UTC
>Number:         39897
>Category:       kern
>Synopsis:       sizeof(struct gpt_hdr); is "wrong" on amd64
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Nov 11 19:00:00 +0000 2008
>Originator:     Jonathan A. Kollasch
>Release:        NetBSD 4.99.71
System: NetBSD siwenna.kollasch.net 4.99.71 NetBSD 4.99.71 (SIWENNA) #37: Tue 
Oct 28 02:14:53 UTC 2008 
[email protected]:/usr/src/sys/arch/i386/compile/SIWENNA i386
Architecture: i386
Machine: i386
src/sys/sys/disklabel_gpt.h defines on-disk data structures without '__packed'.
gpt(8) takes sizeof(struct gpt_hdr) and uses it to populate that structure's
size field.  On i386 this comes out to a correct 0x5c, on amd64 this comes out
to 0x60.  GPT-aware Windows only recognizes the non-padded size as a valid
size.  NetBSD only validates that this field is less than DEV_BSIZE.
Create a GPT disk on NetBSD/amd64, try to get Windows (x64) to recognize the
disk as having a valid partition table.
Perhaps add a '__packed' attribute to the GPT structures.
Additionally, maybe use CTASSERT() to detect this sort of


<Prev in Thread] Current Thread [Next in Thread>