NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

kern/39897: sizeof(struct gpt_hdr);

>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 4.99.71 NetBSD 4.99.71 (SIWENNA) #37: Tue 
Oct 28 02:14:53 UTC 2008 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


Home | Main Index | Thread Index | Old Index