diff options
author | Jean-Sébastien Pédron <dumbbell@FreeBSD.org> | 2013-03-05 11:02:05 +0000 |
---|---|---|
committer | Jean-Sébastien Pédron <dumbbell@FreeBSD.org> | 2013-03-05 11:02:05 +0000 |
commit | 5943eed4b9e332276771bbd9fe625c7c0401ea83 (patch) | |
tree | a309f719f8dade17917a5bab650baf995a6ffd06 /sys/geom/label | |
parent | d49302aeadec18cf73a9c19e19e19b640451a3ad (diff) | |
download | src-5943eed4b9e332276771bbd9fe625c7c0401ea83.tar.gz src-5943eed4b9e332276771bbd9fe625c7c0401ea83.zip |
g_label_ntfs.c: Mark structures as __packed
Without this, read data is mis-interpreted. This could trigger a panic,
as was the case on one computer where computed "recsize" was zero,
leading to a call to g_read_page() asking for 0 bytes.
Notes
Notes:
svn path=/head/; revision=247837
Diffstat (limited to 'sys/geom/label')
-rw-r--r-- | sys/geom/label/g_label_ntfs.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/geom/label/g_label_ntfs.c b/sys/geom/label/g_label_ntfs.c index f00669edcb55..1ed4a07d58f8 100644 --- a/sys/geom/label/g_label_ntfs.c +++ b/sys/geom/label/g_label_ntfs.c @@ -55,7 +55,7 @@ struct ntfs_attr { uint16_t reserved3; uint16_t a_dataoff; uint16_t a_indexed; -}; +} __packed; struct ntfs_filerec { uint32_t fr_hdrmagic; @@ -70,7 +70,7 @@ struct ntfs_filerec { uint32_t fr_allocated; uint64_t fr_mainrec; uint16_t fr_attrnum; -}; +} __packed; struct ntfs_bootfile { uint8_t reserved1[3]; @@ -89,7 +89,7 @@ struct ntfs_bootfile { uint8_t bf_mftrecsz; uint32_t bf_ibsz; uint32_t bf_volsn; -}; +} __packed; static void g_label_ntfs_taste(struct g_consumer *cp, char *label, size_t size) |