Blame SOURCES/0266-Use-GRUB_PROPERLY_ALIGNED_ARRAY-in-grub-core-disk-cr.patch

f96e0b
From 830a8f214176981d1947534daa362a1fcb28e540 Mon Sep 17 00:00:00 2001
f96e0b
From: Vladimir 'phcoder' Serbinenko <phcoder@gmail.com>
f96e0b
Date: Fri, 5 Apr 2013 13:26:10 +0200
f96e0b
Subject: [PATCH 266/482] 	Use GRUB_PROPERLY_ALIGNED_ARRAY in
f96e0b
 grub-core/disk/cryptodisk.c and 	grub-core/disk/geli.c.
f96e0b
f96e0b
---
f96e0b
 ChangeLog                   | 5 +++++
f96e0b
 grub-core/disk/cryptodisk.c | 2 +-
f96e0b
 grub-core/disk/geli.c       | 2 +-
f96e0b
 3 files changed, 7 insertions(+), 2 deletions(-)
f96e0b
f96e0b
diff --git a/ChangeLog b/ChangeLog
f96e0b
index 41370a1..2f2f7a3 100644
f96e0b
--- a/ChangeLog
f96e0b
+++ b/ChangeLog
f96e0b
@@ -1,5 +1,10 @@
f96e0b
 2013-04-05  Vladimir Serbinenko  <phcoder@gmail.com>
f96e0b
 
f96e0b
+	Use GRUB_PROPERLY_ALIGNED_ARRAY in grub-core/disk/cryptodisk.c and
f96e0b
+	grub-core/disk/geli.c.
f96e0b
+
f96e0b
+2013-04-05  Vladimir Serbinenko  <phcoder@gmail.com>
f96e0b
+
f96e0b
 	* util/grub-mkfont.c: Prefer enum to #define.
f96e0b
 
f96e0b
 2013-04-05  Vladimir Serbinenko  <phcoder@gmail.com>
f96e0b
diff --git a/grub-core/disk/cryptodisk.c b/grub-core/disk/cryptodisk.c
f96e0b
index 5b12a23..6fbfc4a 100644
f96e0b
--- a/grub-core/disk/cryptodisk.c
f96e0b
+++ b/grub-core/disk/cryptodisk.c
f96e0b
@@ -256,7 +256,7 @@ grub_cryptodisk_endecrypt (struct grub_cryptodisk *dev,
f96e0b
 	case GRUB_CRYPTODISK_MODE_IV_BYTECOUNT64_HASH:
f96e0b
 	  {
f96e0b
 	    grub_uint64_t tmp;
f96e0b
-	    grub_uint64_t ctx[(dev->iv_hash->contextsize + 7) / 8];
f96e0b
+	    GRUB_PROPERLY_ALIGNED_ARRAY (ctx, dev->iv_hash->contextsize);
f96e0b
 
f96e0b
 	    grub_memset (ctx, 0, sizeof (ctx));
f96e0b
 
f96e0b
diff --git a/grub-core/disk/geli.c b/grub-core/disk/geli.c
f96e0b
index 55aa5b9..2aa1ae0 100644
f96e0b
--- a/grub-core/disk/geli.c
f96e0b
+++ b/grub-core/disk/geli.c
f96e0b
@@ -146,7 +146,7 @@ geli_rekey (struct grub_cryptodisk *dev, grub_uint64_t zoneno)
f96e0b
     grub_uint64_t zone;
f96e0b
   } __attribute__ ((packed)) tohash
f96e0b
       = { {'e', 'k', 'e', 'y'}, grub_cpu_to_le64 (zoneno) };
f96e0b
-  grub_uint64_t key[(dev->hash->mdlen + 7) / 8];
f96e0b
+  GRUB_PROPERLY_ALIGNED_ARRAY (key, dev->hash->mdlen);
f96e0b
 
f96e0b
   grub_dprintf ("geli", "rekeying %" PRIuGRUB_UINT64_T " keysize=%d\n",
f96e0b
 		zoneno, dev->rekey_derived_size);
f96e0b
-- 
f96e0b
1.8.2.1
f96e0b