vboot: align workbuf to VB2_WORKBUF_ALIGN

Also standardize on position and spacing of __attribute__.

BUG=b:124141368
TEST=make clean && make runtests
BRANCH=none

Change-Id: Ic61d6193c2413824837a51af98eb2dcd9ea4ab85
Signed-off-by: Joel Kitching <kitching@google.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/1902843
Commit-Queue: Joel Kitching <kitching@chromium.org>
Tested-by: Joel Kitching <kitching@chromium.org>
Reviewed-by: Julius Werner <jwerner@chromium.org>
diff --git a/firmware/2lib/include/2common.h b/firmware/2lib/include/2common.h
index 6c5563a..9177da7 100644
--- a/firmware/2lib/include/2common.h
+++ b/firmware/2lib/include/2common.h
@@ -81,10 +81,10 @@
     __GNUC__ >= 7
 #define VBOOT_FALLTHROUGH [[gnu::fallthrough]]
 #elif defined(__GNUC__) && __GNUC__ >= 7 // gcc 7
-#define VBOOT_FALLTHROUGH __attribute__ ((fallthrough))
+#define VBOOT_FALLTHROUGH __attribute__((fallthrough))
 #elif defined(__clang__)
 #if __has_attribute(fallthrough)
-#define VBOOT_FALLTHROUGH __attribute__ ((fallthrough))
+#define VBOOT_FALLTHROUGH __attribute__((fallthrough))
 #else // clang versions that do not support fallthrough.
 #define VBOOT_FALLTHROUGH
 #endif
diff --git a/firmware/2lib/include/2constants.h b/firmware/2lib/include/2constants.h
index 3f80b9a..8560d0d 100644
--- a/firmware/2lib/include/2constants.h
+++ b/firmware/2lib/include/2constants.h
@@ -61,7 +61,7 @@
  *    int foo(void)
  *    {
  *        struct vb2_workbuf wb;
- *        uint8_t buf[NUM] __attribute__ ((aligned (VB2_WORKBUF_ALIGN)));
+ *        uint8_t buf[NUM] __attribute__((aligned(VB2_WORKBUF_ALIGN)));
  *        wb.buf = buf;
  *        wb.size = sizeof(buf);
  */
diff --git a/futility/cmd_show.c b/futility/cmd_show.c
index cf747f8..9a2eec1 100644
--- a/futility/cmd_show.c
+++ b/futility/cmd_show.c
@@ -40,7 +40,8 @@
 };
 
 /* Shared work buffer */
-static uint8_t workbuf[VB2_KERNEL_WORKBUF_RECOMMENDED_SIZE];
+static uint8_t workbuf[VB2_KERNEL_WORKBUF_RECOMMENDED_SIZE]
+	__attribute__((aligned(VB2_WORKBUF_ALIGN)));
 static struct vb2_workbuf wb;
 
 void show_pubkey(const struct vb2_packed_key *pubkey, const char *sp)
diff --git a/futility/cmd_vbutil_firmware.c b/futility/cmd_vbutil_firmware.c
index 1c954ae..2b169a4 100644
--- a/futility/cmd_vbutil_firmware.c
+++ b/futility/cmd_vbutil_firmware.c
@@ -188,7 +188,8 @@
 static int do_verify(const char *infile, const char *signpubkey,
 		     const char *fv_file, const char *kernelkey_file)
 {
-	uint8_t workbuf[VB2_FIRMWARE_WORKBUF_RECOMMENDED_SIZE];
+	uint8_t workbuf[VB2_FIRMWARE_WORKBUF_RECOMMENDED_SIZE]
+		__attribute__((aligned(VB2_WORKBUF_ALIGN)));
 	struct vb2_workbuf wb;
 	vb2_workbuf_init(&wb, workbuf, sizeof(workbuf));
 
diff --git a/futility/cmd_vbutil_keyblock.c b/futility/cmd_vbutil_keyblock.c
index 8e4b22d..0bb59ab 100644
--- a/futility/cmd_vbutil_keyblock.c
+++ b/futility/cmd_vbutil_keyblock.c
@@ -178,7 +178,8 @@
 	/* If the signing public key is provided, then verify the block
 	 * signature, since vb2_read_keyblock() only verified the hash. */
 	if (signpubkey) {
-		static uint8_t workbuf[VB2_FIRMWARE_WORKBUF_RECOMMENDED_SIZE];
+		static uint8_t workbuf[VB2_FIRMWARE_WORKBUF_RECOMMENDED_SIZE]
+			__attribute__((aligned(VB2_WORKBUF_ALIGN)));
 		static struct vb2_workbuf wb;
 
 		if (block->keyblock_signature.sig_size == 0) {
diff --git a/futility/file_type_bios.c b/futility/file_type_bios.c
index 469e46e..35a4f1d 100644
--- a/futility/file_type_bios.c
+++ b/futility/file_type_bios.c
@@ -245,7 +245,8 @@
 static int fmap_sign_fw_preamble(const char *name, uint8_t *buf, uint32_t len,
 				 void *data)
 {
-	static uint8_t workbuf[VB2_FIRMWARE_WORKBUF_RECOMMENDED_SIZE];
+	static uint8_t workbuf[VB2_FIRMWARE_WORKBUF_RECOMMENDED_SIZE]
+		__attribute__((aligned(VB2_WORKBUF_ALIGN)));
 	static struct vb2_workbuf wb;
 	vb2_workbuf_init(&wb, workbuf, sizeof(workbuf));
 
diff --git a/futility/file_type_rwsig.c b/futility/file_type_rwsig.c
index d2d67fa..c5616e5 100644
--- a/futility/file_type_rwsig.c
+++ b/futility/file_type_rwsig.c
@@ -64,7 +64,7 @@
 	const struct vb21_packed_key *pkey = show_option.pkey;
 	struct vb2_public_key key;
 	uint8_t workbuf[VB2_VERIFY_DATA_WORKBUF_BYTES]
-		 __attribute__ ((aligned (VB2_WORKBUF_ALIGN)));
+		 __attribute__((aligned(VB2_WORKBUF_ALIGN)));
 	struct vb2_workbuf wb;
 	uint32_t data_size, sig_size = SIGNATURE_RSVD_SIZE;
 	uint32_t total_data_size = 0;
diff --git a/futility/file_type_usbpd1.c b/futility/file_type_usbpd1.c
index f03feec..8065041 100644
--- a/futility/file_type_usbpd1.c
+++ b/futility/file_type_usbpd1.c
@@ -372,7 +372,7 @@
 	struct vb2_public_key pubkey;
 	struct vb21_signature *sig;
 	uint8_t buf[VB2_FIRMWARE_WORKBUF_RECOMMENDED_SIZE]
-		__attribute__ ((aligned (VB2_WORKBUF_ALIGN)));
+		__attribute__((aligned(VB2_WORKBUF_ALIGN)));
 	struct vb2_workbuf wb = {
 		.buf = buf,
 		.size = sizeof(buf),
diff --git a/futility/kernel_blob.h b/futility/kernel_blob.h
index 332b1d3..9043bac 100644
--- a/futility/kernel_blob.h
+++ b/futility/kernel_blob.h
@@ -35,7 +35,7 @@
 	uint64_t start_addr;
 	uint64_t segment_size;
 	uint32_t segment_type;
-} __attribute__ ((packed));
+} __attribute__((packed));
 
 /* Simplified version of the x86 kernel zeropage table */
 struct linux_kernel_params {
@@ -62,6 +62,6 @@
 	uint8_t pad6[0x2d0 - 0x236];
 	struct linux_kernel_e820entry
 		e820_entries[E820_ENTRY_MAX];	/* 2d0-cd0 */
-} __attribute__ ((packed));
+} __attribute__((packed));
 
 #endif  /* VBOOT_REFERENCE_KERNEL_BLOB_H_ */
diff --git a/futility/updater.c b/futility/updater.c
index 2769140..97daf55 100644
--- a/futility/updater.c
+++ b/futility/updater.c
@@ -1259,7 +1259,8 @@
 static int verify_keyblock(const struct vb2_keyblock *block,
 			   const struct vb2_packed_key *sign_key) {
 	int r;
-	uint8_t workbuf[VB2_FIRMWARE_WORKBUF_RECOMMENDED_SIZE];
+	uint8_t workbuf[VB2_FIRMWARE_WORKBUF_RECOMMENDED_SIZE]
+		__attribute__((aligned(VB2_WORKBUF_ALIGN)));
 	struct vb2_workbuf wb;
 	struct vb2_public_key key;
 	struct vb2_keyblock *new_block;
diff --git a/futility/vb1_helper.c b/futility/vb1_helper.c
index 01c63eb..d1d7535 100644
--- a/futility/vb1_helper.c
+++ b/futility/vb1_helper.c
@@ -508,7 +508,8 @@
 	uint32_t vmlinuz_header_size = 0;
 	uint64_t vmlinuz_header_address = 0;
 
-	uint8_t workbuf[VB2_KERNEL_WORKBUF_RECOMMENDED_SIZE];
+	uint8_t workbuf[VB2_KERNEL_WORKBUF_RECOMMENDED_SIZE]
+		__attribute__((aligned(VB2_WORKBUF_ALIGN)));
 	struct vb2_workbuf wb;
 	vb2_workbuf_init(&wb, workbuf, sizeof(workbuf));
 
@@ -740,7 +741,8 @@
 
 enum futil_file_type ft_recognize_vblock1(uint8_t *buf, uint32_t len)
 {
-	uint8_t workbuf[VB2_KERNEL_WORKBUF_RECOMMENDED_SIZE];
+	uint8_t workbuf[VB2_KERNEL_WORKBUF_RECOMMENDED_SIZE]
+		__attribute__((aligned(VB2_WORKBUF_ALIGN)));
 	struct vb2_workbuf wb;
 	vb2_workbuf_init(&wb, workbuf, sizeof(workbuf));
 
diff --git a/host/lib/host_keyblock.c b/host/lib/host_keyblock.c
index 42b3a71..6f3ae4f 100644
--- a/host/lib/host_keyblock.c
+++ b/host/lib/host_keyblock.c
@@ -144,7 +144,8 @@
 
 struct vb2_keyblock *vb2_read_keyblock(const char *filename)
 {
-	uint8_t workbuf[VB2_FIRMWARE_WORKBUF_RECOMMENDED_SIZE];
+	uint8_t workbuf[VB2_FIRMWARE_WORKBUF_RECOMMENDED_SIZE]
+		__attribute__((aligned(VB2_WORKBUF_ALIGN)));
 	struct vb2_workbuf wb;
 	vb2_workbuf_init(&wb, workbuf, sizeof(workbuf));
 
diff --git a/tests/vb20_api_kernel_tests.c b/tests/vb20_api_kernel_tests.c
index a512201..646f8ec 100644
--- a/tests/vb20_api_kernel_tests.c
+++ b/tests/vb20_api_kernel_tests.c
@@ -19,7 +19,7 @@
 
 /* Common context for tests */
 static uint8_t workbuf[VB2_KERNEL_WORKBUF_RECOMMENDED_SIZE]
-	__attribute__ ((aligned (VB2_WORKBUF_ALIGN)));
+	__attribute__((aligned(VB2_WORKBUF_ALIGN)));
 static struct vb2_context *ctx;
 static struct vb2_shared_data *sd;
 static struct vb2_fw_preamble *fwpre;
diff --git a/tests/vb20_common2_tests.c b/tests/vb20_common2_tests.c
index 8f8b11a..e938d79 100644
--- a/tests/vb20_common2_tests.c
+++ b/tests/vb20_common2_tests.c
@@ -83,7 +83,7 @@
 			     const struct vb2_signature *sig)
 {
 	uint8_t workbuf[VB2_VERIFY_DATA_WORKBUF_BYTES]
-		 __attribute__ ((aligned (VB2_WORKBUF_ALIGN)));
+		 __attribute__((aligned(VB2_WORKBUF_ALIGN)));
 	struct vb2_workbuf wb;
 
 	struct vb2_public_key pubk, pubk_orig;
diff --git a/tests/vb20_common3_tests.c b/tests/vb20_common3_tests.c
index fb787d1..2b0d114 100644
--- a/tests/vb20_common3_tests.c
+++ b/tests/vb20_common3_tests.c
@@ -141,7 +141,7 @@
 				const struct vb2_packed_key *data_key)
 {
 	uint8_t workbuf[VB2_KEYBLOCK_VERIFY_WORKBUF_BYTES]
-		__attribute__ ((aligned (VB2_WORKBUF_ALIGN)));
+		__attribute__((aligned(VB2_WORKBUF_ALIGN)));
 	struct vb2_workbuf wb;
 	struct vb2_keyblock *hdr;
 	struct vb2_keyblock *h;
@@ -206,7 +206,7 @@
 	struct vb2_fw_preamble *h;
 	struct vb2_public_key rsa;
 	uint8_t workbuf[VB2_VERIFY_FIRMWARE_PREAMBLE_WORKBUF_BYTES]
-		 __attribute__ ((aligned (VB2_WORKBUF_ALIGN)));
+		 __attribute__((aligned(VB2_WORKBUF_ALIGN)));
 	struct vb2_workbuf wb;
 	uint32_t hsize;
 
@@ -348,7 +348,7 @@
 	struct vb2_public_key rsa;
 	// TODO: how many workbuf bytes?
 	uint8_t workbuf[VB2_VERIFY_FIRMWARE_PREAMBLE_WORKBUF_BYTES]
-		 __attribute__ ((aligned (VB2_WORKBUF_ALIGN)));
+		 __attribute__((aligned(VB2_WORKBUF_ALIGN)));
 	struct vb2_workbuf wb;
 	uint32_t hsize;
 
diff --git a/tests/vb20_kernel_tests.c b/tests/vb20_kernel_tests.c
index 5099cfd..73cb372 100644
--- a/tests/vb20_kernel_tests.c
+++ b/tests/vb20_kernel_tests.c
@@ -19,7 +19,7 @@
 
 /* Common context for tests */
 static uint8_t workbuf[VB2_KERNEL_WORKBUF_RECOMMENDED_SIZE]
-	__attribute__ ((aligned (VB2_WORKBUF_ALIGN)));
+	__attribute__((aligned(VB2_WORKBUF_ALIGN)));
 static struct vb2_workbuf wb;
 static struct vb2_context *ctx;
 static struct vb2_shared_data *sd;
diff --git a/tests/vb20_misc_tests.c b/tests/vb20_misc_tests.c
index 5531f59..73fae53 100644
--- a/tests/vb20_misc_tests.c
+++ b/tests/vb20_misc_tests.c
@@ -19,7 +19,7 @@
 
 /* Common context for tests */
 static uint8_t workbuf[VB2_FIRMWARE_WORKBUF_RECOMMENDED_SIZE]
-	__attribute__ ((aligned (VB2_WORKBUF_ALIGN)));
+	__attribute__((aligned(VB2_WORKBUF_ALIGN)));
 static struct vb2_context *ctx;
 static struct vb2_shared_data *sd;
 static struct vb2_gbb_header gbb;
diff --git a/tests/vb20_rsa_padding_tests.c b/tests/vb20_rsa_padding_tests.c
index 78fd05b..be9d91b 100644
--- a/tests/vb20_rsa_padding_tests.c
+++ b/tests/vb20_rsa_padding_tests.c
@@ -21,7 +21,7 @@
 static void test_signatures(const struct vb2_public_key *key)
 {
 	uint8_t workbuf[VB2_VERIFY_DIGEST_WORKBUF_BYTES]
-		 __attribute__ ((aligned (VB2_WORKBUF_ALIGN)));
+		 __attribute__((aligned(VB2_WORKBUF_ALIGN)));
 	uint8_t sig[RSA1024NUMBYTES];
 	struct vb2_workbuf wb;
 	int unexpected_success;
@@ -54,7 +54,7 @@
  */
 static void test_verify_digest(struct vb2_public_key *key) {
 	uint8_t workbuf[VB2_VERIFY_DIGEST_WORKBUF_BYTES]
-		 __attribute__ ((aligned (VB2_WORKBUF_ALIGN)));
+		 __attribute__((aligned(VB2_WORKBUF_ALIGN)));
 	uint8_t sig[RSA1024NUMBYTES];
 	struct vb2_workbuf wb;
 	enum vb2_signature_algorithm orig_key_alg = key->sig_alg;
diff --git a/tests/vb20_verify_fw.c b/tests/vb20_verify_fw.c
index 52d2448..e705805 100644
--- a/tests/vb20_verify_fw.c
+++ b/tests/vb20_verify_fw.c
@@ -145,7 +145,7 @@
 
 int main(int argc, char *argv[])
 {
-	uint8_t workbuf[16384] __attribute__ ((aligned (VB2_WORKBUF_ALIGN)));
+	uint8_t workbuf[16384] __attribute__((aligned(VB2_WORKBUF_ALIGN)));
 	struct vb2_context *ctx;
 	struct vb2_shared_data *sd;
 	vb2_error_t rv;
diff --git a/tests/vb21_api_tests.c b/tests/vb21_api_tests.c
index 5daeddb..21de87d 100644
--- a/tests/vb21_api_tests.c
+++ b/tests/vb21_api_tests.c
@@ -21,7 +21,7 @@
 
 /* Common context for tests */
 static uint8_t workbuf[VB2_FIRMWARE_WORKBUF_RECOMMENDED_SIZE]
-	__attribute__ ((aligned (VB2_WORKBUF_ALIGN)));
+	__attribute__((aligned(VB2_WORKBUF_ALIGN)));
 static struct vb2_context *ctx;
 static struct vb2_shared_data *sd;
 
diff --git a/tests/vb21_common2_tests.c b/tests/vb21_common2_tests.c
index 448d337..b98b1ac 100644
--- a/tests/vb21_common2_tests.c
+++ b/tests/vb21_common2_tests.c
@@ -170,7 +170,7 @@
 			      const struct vb21_signature *sig)
 {
 	uint8_t workbuf[VB2_VERIFY_DATA_WORKBUF_BYTES]
-		 __attribute__ ((aligned (VB2_WORKBUF_ALIGN)));
+		 __attribute__((aligned(VB2_WORKBUF_ALIGN)));
 	struct vb2_workbuf wb;
 
 	struct vb2_public_key pubk;
diff --git a/tests/vb21_common_tests.c b/tests/vb21_common_tests.c
index 797c934..94fcead 100644
--- a/tests/vb21_common_tests.c
+++ b/tests/vb21_common_tests.c
@@ -220,7 +220,7 @@
 	const struct vb2_private_key *prik;
 	struct vb2_public_key pubk;
 	uint8_t workbuf[VB2_VERIFY_DATA_WORKBUF_BYTES]
-		 __attribute__ ((aligned (VB2_WORKBUF_ALIGN)));
+		 __attribute__((aligned(VB2_WORKBUF_ALIGN)));
 	struct vb2_workbuf wb;
 
 	vb2_workbuf_init(&wb, workbuf, sizeof(workbuf));
@@ -260,7 +260,7 @@
 	uint8_t *buf, *buf2;
 
 	uint8_t workbuf[VB2_KEYBLOCK_VERIFY_WORKBUF_BYTES]
-		 __attribute__ ((aligned (VB2_WORKBUF_ALIGN)));
+		 __attribute__((aligned(VB2_WORKBUF_ALIGN)));
 	struct vb2_workbuf wb;
 
 	TEST_SUCC(vb2_public_key_hash(&pubk, VB2_HASH_SHA256),
@@ -387,7 +387,7 @@
 	uint8_t *buf, *buf2;
 
 	uint8_t workbuf[VB2_VERIFY_FIRMWARE_PREAMBLE_WORKBUF_BYTES]
-		 __attribute__ ((aligned (VB2_WORKBUF_ALIGN)));
+		 __attribute__((aligned(VB2_WORKBUF_ALIGN)));
 	struct vb2_workbuf wb;
 
 	/*
diff --git a/tests/vb21_host_fw_preamble_tests.c b/tests/vb21_host_fw_preamble_tests.c
index d46fd05..c93f714 100644
--- a/tests/vb21_host_fw_preamble_tests.c
+++ b/tests/vb21_host_fw_preamble_tests.c
@@ -37,7 +37,7 @@
 	int i;
 
 	uint8_t workbuf[VB2_VERIFY_FIRMWARE_PREAMBLE_WORKBUF_BYTES]
-		 __attribute__ ((aligned (VB2_WORKBUF_ALIGN)));
+		 __attribute__((aligned(VB2_WORKBUF_ALIGN)));
 	struct vb2_workbuf wb;
 
 	vb2_workbuf_init(&wb, workbuf, sizeof(workbuf));
diff --git a/tests/vb21_host_keyblock_tests.c b/tests/vb21_host_keyblock_tests.c
index 451e3d3..3a5f0f5 100644
--- a/tests/vb21_host_keyblock_tests.c
+++ b/tests/vb21_host_keyblock_tests.c
@@ -29,7 +29,7 @@
 	const char test_desc[] = "Test keyblock";
 
 	uint8_t workbuf[VB2_KEYBLOCK_VERIFY_WORKBUF_BYTES]
-		 __attribute__ ((aligned (VB2_WORKBUF_ALIGN)));
+		 __attribute__((aligned(VB2_WORKBUF_ALIGN)));
 	struct vb2_workbuf wb;
 
 	vb2_workbuf_init(&wb, workbuf, sizeof(workbuf));
diff --git a/tests/vb21_host_sig_tests.c b/tests/vb21_host_sig_tests.c
index f275d2f..b116c5c 100644
--- a/tests/vb21_host_sig_tests.c
+++ b/tests/vb21_host_sig_tests.c
@@ -47,7 +47,7 @@
 	uint32_t size;
 
 	uint8_t workbuf[VB2_VERIFY_DATA_WORKBUF_BYTES]
-		 __attribute__ ((aligned (VB2_WORKBUF_ALIGN)));
+		 __attribute__((aligned(VB2_WORKBUF_ALIGN)));
 	struct vb2_workbuf wb;
 
 	uint8_t *buf;
diff --git a/tests/vb21_misc_tests.c b/tests/vb21_misc_tests.c
index f86d3f2..f76ff29 100644
--- a/tests/vb21_misc_tests.c
+++ b/tests/vb21_misc_tests.c
@@ -18,7 +18,7 @@
 
 /* Common context for tests */
 static uint8_t workbuf[VB2_FIRMWARE_WORKBUF_RECOMMENDED_SIZE]
-	__attribute__ ((aligned (VB2_WORKBUF_ALIGN)));
+	__attribute__((aligned(VB2_WORKBUF_ALIGN)));
 static struct vb2_context *ctx;
 static struct vb2_shared_data *sd;
 static struct vb2_gbb_header gbb;
diff --git a/tests/vb2_api_tests.c b/tests/vb2_api_tests.c
index 40cd160..a7143b7 100644
--- a/tests/vb2_api_tests.c
+++ b/tests/vb2_api_tests.c
@@ -21,7 +21,7 @@
 /* Common context for tests */
 
 static uint8_t workbuf[VB2_FIRMWARE_WORKBUF_RECOMMENDED_SIZE]
-	__attribute__ ((aligned (VB2_WORKBUF_ALIGN)));
+	__attribute__((aligned(VB2_WORKBUF_ALIGN)));
 static struct vb2_context *ctx;
 static struct vb2_shared_data *sd;
 static struct vb2_gbb_header gbb;
diff --git a/tests/vb2_common_tests.c b/tests/vb2_common_tests.c
index 61ce133..11c9763 100644
--- a/tests/vb2_common_tests.c
+++ b/tests/vb2_common_tests.c
@@ -148,7 +148,7 @@
  */
 static void test_workbuf(void)
 {
-	uint64_t buf[8] __attribute__ ((aligned (VB2_WORKBUF_ALIGN)));
+	uint64_t buf[8] __attribute__((aligned(VB2_WORKBUF_ALIGN)));
 	uint8_t *p0 = (uint8_t *)buf, *ptr;
 	struct vb2_workbuf wb;
 
diff --git a/tests/vb2_ec_sync_tests.c b/tests/vb2_ec_sync_tests.c
index ecc00f3..a9060b0 100644
--- a/tests/vb2_ec_sync_tests.c
+++ b/tests/vb2_ec_sync_tests.c
@@ -48,7 +48,8 @@
 static uint8_t want_ec_hash[32];
 static uint8_t update_hash;
 static int want_ec_hash_size;
-static uint8_t workbuf[VB2_KERNEL_WORKBUF_RECOMMENDED_SIZE];
+static uint8_t workbuf[VB2_KERNEL_WORKBUF_RECOMMENDED_SIZE]
+	__attribute__((aligned(VB2_WORKBUF_ALIGN)));
 static struct vb2_context *ctx;
 static struct vb2_shared_data *sd;
 static struct vb2_gbb_header gbb;
diff --git a/tests/vb2_gbb_tests.c b/tests/vb2_gbb_tests.c
index 2569164..047fa42 100644
--- a/tests/vb2_gbb_tests.c
+++ b/tests/vb2_gbb_tests.c
@@ -15,7 +15,8 @@
 static struct vb2_packed_key *rootkey;
 static struct vb2_context *ctx;
 static struct vb2_workbuf wb;
-static uint8_t workbuf[VB2_KERNEL_WORKBUF_RECOMMENDED_SIZE];
+static uint8_t workbuf[VB2_KERNEL_WORKBUF_RECOMMENDED_SIZE]
+	__attribute__((aligned(VB2_WORKBUF_ALIGN)));
 
 static void set_gbb_hwid(const char *hwid, size_t size)
 {
diff --git a/tests/vb2_keyblock_fuzzer.c b/tests/vb2_keyblock_fuzzer.c
index 53f2e7c..9996afa 100644
--- a/tests/vb2_keyblock_fuzzer.c
+++ b/tests/vb2_keyblock_fuzzer.c
@@ -11,8 +11,8 @@
 #include "vboot_test.h"
 
 static struct vb2_context *ctx;
-__attribute__((aligned(VB2_WORKBUF_ALIGN)))
-static uint8_t workbuf[VB2_FIRMWARE_WORKBUF_RECOMMENDED_SIZE];
+static uint8_t workbuf[VB2_FIRMWARE_WORKBUF_RECOMMENDED_SIZE]
+	__attribute__((aligned(VB2_WORKBUF_ALIGN)));
 static struct {
 	struct vb2_gbb_header h;
 	uint8_t rootkey[4096];
diff --git a/tests/vb2_misc_tests.c b/tests/vb2_misc_tests.c
index 26cf21e..5f2b6c8 100644
--- a/tests/vb2_misc_tests.c
+++ b/tests/vb2_misc_tests.c
@@ -15,9 +15,9 @@
 
 /* Common context for tests */
 static uint8_t workbuf[VB2_FIRMWARE_WORKBUF_RECOMMENDED_SIZE]
-	__attribute__ ((aligned (VB2_WORKBUF_ALIGN)));
+	__attribute__((aligned(VB2_WORKBUF_ALIGN)));
 static uint8_t workbuf2[VB2_FIRMWARE_WORKBUF_RECOMMENDED_SIZE]
-	__attribute__ ((aligned (VB2_WORKBUF_ALIGN)));
+	__attribute__((aligned(VB2_WORKBUF_ALIGN)));
 static struct vb2_context *ctx;
 static struct vb2_shared_data *sd;
 static struct vb2_gbb_header gbb;
diff --git a/tests/vb2_nvstorage_tests.c b/tests/vb2_nvstorage_tests.c
index 9909d7c..269caa2 100644
--- a/tests/vb2_nvstorage_tests.c
+++ b/tests/vb2_nvstorage_tests.c
@@ -82,7 +82,7 @@
 	struct nv_field *vnf;
 	uint8_t goodcrc;
 	uint8_t workbuf[VB2_FIRMWARE_WORKBUF_RECOMMENDED_SIZE]
-		__attribute__ ((aligned (VB2_WORKBUF_ALIGN)));
+		__attribute__((aligned(VB2_WORKBUF_ALIGN)));
 	struct vb2_context *ctx;
 
 	TEST_SUCC(vb2api_init(workbuf, sizeof(workbuf), &ctx),
diff --git a/tests/vb2_preamble_fuzzer.c b/tests/vb2_preamble_fuzzer.c
index edc429a..9568f45 100644
--- a/tests/vb2_preamble_fuzzer.c
+++ b/tests/vb2_preamble_fuzzer.c
@@ -12,8 +12,8 @@
 #include "vboot_test.h"
 
 static struct vb2_context *ctx;
-__attribute__((aligned(VB2_WORKBUF_ALIGN)))
-static uint8_t workbuf[VB2_FIRMWARE_WORKBUF_RECOMMENDED_SIZE];
+static uint8_t workbuf[VB2_FIRMWARE_WORKBUF_RECOMMENDED_SIZE]
+	__attribute__((aligned(VB2_WORKBUF_ALIGN)));
 
 static const uint8_t *mock_preamble;
 static size_t mock_preamble_size;
diff --git a/tests/vb2_secdata_firmware_tests.c b/tests/vb2_secdata_firmware_tests.c
index 68a5ce2..c2d8e27 100644
--- a/tests/vb2_secdata_firmware_tests.c
+++ b/tests/vb2_secdata_firmware_tests.c
@@ -16,7 +16,7 @@
 #include "vboot_common.h"
 
 static uint8_t workbuf[VB2_FIRMWARE_WORKBUF_RECOMMENDED_SIZE]
-	__attribute__ ((aligned (VB2_WORKBUF_ALIGN)));
+	__attribute__((aligned(VB2_WORKBUF_ALIGN)));
 static struct vb2_context *ctx;
 static struct vb2_shared_data *sd;
 static struct vb2_secdata_firmware *sec;
diff --git a/tests/vb2_secdata_fwmp_tests.c b/tests/vb2_secdata_fwmp_tests.c
index 6c433db..699f3fa 100644
--- a/tests/vb2_secdata_fwmp_tests.c
+++ b/tests/vb2_secdata_fwmp_tests.c
@@ -12,7 +12,7 @@
 #include "test_common.h"
 
 static uint8_t workbuf[VB2_FIRMWARE_WORKBUF_RECOMMENDED_SIZE]
-	__attribute__ ((aligned (VB2_WORKBUF_ALIGN)));
+	__attribute__((aligned(VB2_WORKBUF_ALIGN)));
 static struct vb2_context *ctx;
 static struct vb2_gbb_header gbb;
 static struct vb2_shared_data *sd;
diff --git a/tests/vb2_secdata_kernel_tests.c b/tests/vb2_secdata_kernel_tests.c
index d4ad3d2..44d0603 100644
--- a/tests/vb2_secdata_kernel_tests.c
+++ b/tests/vb2_secdata_kernel_tests.c
@@ -16,7 +16,7 @@
 #include "vboot_common.h"
 
 static uint8_t workbuf[VB2_FIRMWARE_WORKBUF_RECOMMENDED_SIZE]
-	__attribute__ ((aligned (VB2_WORKBUF_ALIGN)));
+	__attribute__((aligned(VB2_WORKBUF_ALIGN)));
 static struct vb2_context *ctx;
 static struct vb2_shared_data *sd;
 static struct vb2_secdata_kernel *sec;
diff --git a/tests/vboot_api_devmode_tests.c b/tests/vboot_api_devmode_tests.c
index 0345489..6cbcede 100644
--- a/tests/vboot_api_devmode_tests.c
+++ b/tests/vboot_api_devmode_tests.c
@@ -92,7 +92,8 @@
 };
 
 /* Mock data */
-static uint8_t workbuf[VB2_KERNEL_WORKBUF_RECOMMENDED_SIZE];
+static uint8_t workbuf[VB2_KERNEL_WORKBUF_RECOMMENDED_SIZE]
+	__attribute__((aligned(VB2_WORKBUF_ALIGN)));
 static struct vb2_context *ctx;
 static struct vb2_shared_data *sd;
 static struct vb2_gbb_header gbb;
diff --git a/tests/vboot_api_kernel2_tests.c b/tests/vboot_api_kernel2_tests.c
index 627a804..2017b41 100644
--- a/tests/vboot_api_kernel2_tests.c
+++ b/tests/vboot_api_kernel2_tests.c
@@ -25,7 +25,8 @@
 static uint8_t shared_data[VB_SHARED_DATA_MIN_SIZE];
 static VbSharedDataHeader *shared = (VbSharedDataHeader *)shared_data;
 static LoadKernelParams lkp;
-static uint8_t workbuf[VB2_KERNEL_WORKBUF_RECOMMENDED_SIZE];
+static uint8_t workbuf[VB2_KERNEL_WORKBUF_RECOMMENDED_SIZE]
+	__attribute__((aligned(VB2_WORKBUF_ALIGN)));
 static struct vb2_context *ctx;
 static struct vb2_shared_data *sd;
 static struct vb2_gbb_header gbb;
diff --git a/tests/vboot_api_kernel4_tests.c b/tests/vboot_api_kernel4_tests.c
index ed0758f..584a134 100644
--- a/tests/vboot_api_kernel4_tests.c
+++ b/tests/vboot_api_kernel4_tests.c
@@ -24,7 +24,8 @@
 #include "vboot_struct.h"
 
 /* Mock data */
-static uint8_t workbuf[VB2_KERNEL_WORKBUF_RECOMMENDED_SIZE];
+static uint8_t workbuf[VB2_KERNEL_WORKBUF_RECOMMENDED_SIZE]
+	__attribute__((aligned(VB2_WORKBUF_ALIGN)));
 static struct vb2_context *ctx;
 static struct vb2_context ctx_nvram_backend;
 static struct vb2_shared_data *sd;
diff --git a/tests/vboot_api_kernel_tests.c b/tests/vboot_api_kernel_tests.c
index 35d8ee9..b558680 100644
--- a/tests/vboot_api_kernel_tests.c
+++ b/tests/vboot_api_kernel_tests.c
@@ -302,7 +302,8 @@
 static const char *got_load_disk;
 static uint32_t got_return_val;
 static uint32_t got_external_mismatch;
-static uint8_t workbuf[VB2_KERNEL_WORKBUF_RECOMMENDED_SIZE];
+static uint8_t workbuf[VB2_KERNEL_WORKBUF_RECOMMENDED_SIZE]
+	__attribute__((aligned(VB2_WORKBUF_ALIGN)));
 static struct vb2_context *ctx;
 
 /**
diff --git a/tests/vboot_detach_menu_tests.c b/tests/vboot_detach_menu_tests.c
index 5e04075..7ff49ee 100644
--- a/tests/vboot_detach_menu_tests.c
+++ b/tests/vboot_detach_menu_tests.c
@@ -27,7 +27,8 @@
 static uint8_t shared_data[VB_SHARED_DATA_MIN_SIZE];
 static VbSharedDataHeader *shared = (VbSharedDataHeader *)shared_data;
 static LoadKernelParams lkp;
-static uint8_t workbuf[VB2_KERNEL_WORKBUF_RECOMMENDED_SIZE];
+static uint8_t workbuf[VB2_KERNEL_WORKBUF_RECOMMENDED_SIZE]
+	__attribute__((aligned(VB2_WORKBUF_ALIGN)));
 static struct vb2_context *ctx;
 static struct vb2_shared_data *sd;
 static struct vb2_gbb_header gbb;
diff --git a/tests/vboot_display_tests.c b/tests/vboot_display_tests.c
index 592c785..58ccda0 100644
--- a/tests/vboot_display_tests.c
+++ b/tests/vboot_display_tests.c
@@ -27,7 +27,8 @@
 static char debug_info[4096];
 static struct vb2_context *ctx;
 static struct vb2_shared_data *sd;
-static uint8_t workbuf[VB2_KERNEL_WORKBUF_RECOMMENDED_SIZE];
+static uint8_t workbuf[VB2_KERNEL_WORKBUF_RECOMMENDED_SIZE]
+	__attribute__((aligned(VB2_WORKBUF_ALIGN)));
 static uint32_t mock_localization_count;
 static uint32_t mock_altfw_mask;
 
diff --git a/tests/vboot_kernel_tests.c b/tests/vboot_kernel_tests.c
index 3273b9f..b43a2ac 100644
--- a/tests/vboot_kernel_tests.c
+++ b/tests/vboot_kernel_tests.c
@@ -70,7 +70,8 @@
 static GptHeader *mock_gpt_secondary =
 	(GptHeader*)&mock_disk[MOCK_SECTOR_SIZE * (MOCK_SECTOR_COUNT - 1)];
 static uint8_t mock_digest[VB2_SHA256_DIGEST_SIZE] = {12, 34, 56, 78};
-static uint8_t workbuf[VB2_KERNEL_WORKBUF_RECOMMENDED_SIZE];
+static uint8_t workbuf[VB2_KERNEL_WORKBUF_RECOMMENDED_SIZE]
+	__attribute__((aligned(VB2_WORKBUF_ALIGN)));
 static struct vb2_context *ctx;
 static struct vb2_packed_key mock_key;
 
diff --git a/tests/verify_kernel.c b/tests/verify_kernel.c
index fffd102..051e629 100644
--- a/tests/verify_kernel.c
+++ b/tests/verify_kernel.c
@@ -19,7 +19,8 @@
 #include "vboot_api.h"
 #include "vboot_kernel.h"
 
-static uint8_t workbuf[VB2_KERNEL_WORKBUF_RECOMMENDED_SIZE];
+static uint8_t workbuf[VB2_KERNEL_WORKBUF_RECOMMENDED_SIZE]
+	__attribute__((aligned(VB2_WORKBUF_ALIGN)));
 static struct vb2_context *ctx;
 static struct vb2_shared_data *sd;
 
diff --git a/utility/verify_data.c b/utility/verify_data.c
index 6069044..8440b3a 100644
--- a/utility/verify_data.c
+++ b/utility/verify_data.c
@@ -31,7 +31,7 @@
 int main(int argc, char* argv[])
 {
 	uint8_t workbuf[VB2_VERIFY_DIGEST_WORKBUF_BYTES]
-		 __attribute__ ((aligned (VB2_WORKBUF_ALIGN)));
+		 __attribute__((aligned(VB2_WORKBUF_ALIGN)));
 	struct vb2_workbuf wb;
 	vb2_workbuf_init(&wb, workbuf, sizeof(workbuf));