summaryrefslogtreecommitdiffstats
path: root/sys/geom
diff options
context:
space:
mode:
authorpjd <pjd@FreeBSD.org>2005-08-20 10:43:03 +0000
committerpjd <pjd@FreeBSD.org>2005-08-20 10:43:03 +0000
commita2f0d0b06bec596c2d0e3a49bc0842be23b94d91 (patch)
tree05d5baae924c32979b4648da129214cf107a01eb /sys/geom
parent0a274a0672ead9a4840343fdeba5b7229410af39 (diff)
downloadFreeBSD-src-a2f0d0b06bec596c2d0e3a49bc0842be23b94d91.zip
FreeBSD-src-a2f0d0b06bec596c2d0e3a49bc0842be23b94d91.tar.gz
Add a __packed keyword to g_eli_metadata struct definition, so
sizeof(struct g_eli_metadata) will return the exact number of bytes needed for storing it on the disk. Without this change GELI was unusable on amd64 (and probably other 64-bit archs), because sizeof(struct g_eli_metadata) was greater than 512 bytes and geli(8) was failing on assertion. Reported by: Michael Reifenberger <mike@Reifenberger.com> MFC after: 3 days
Diffstat (limited to 'sys/geom')
-rw-r--r--sys/geom/eli/g_eli.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/geom/eli/g_eli.h b/sys/geom/eli/g_eli.h
index 8a8fb4a..f78ba19 100644
--- a/sys/geom/eli/g_eli.h
+++ b/sys/geom/eli/g_eli.h
@@ -153,7 +153,7 @@ struct g_eli_metadata {
/* Encrypted master key (IV-key, Data-key, HMAC). */
uint8_t md_mkeys[G_ELI_MAXMKEYS * G_ELI_MKEYLEN];
u_char md_hash[16]; /* MD5 hash. */
-};
+} __packed;
#ifndef _OpenSSL_
static __inline void
eli_metadata_encode(struct g_eli_metadata *md, u_char *data)
OpenPOWER on IntegriCloud