diff options
author | Joel Kitching <kitching@google.com> | 2019-11-05 18:36:42 +0800 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2019-11-13 14:45:18 +0000 |
commit | 92ea19ae091482484c84d7b09049f7dc74bf6f42 (patch) | |
tree | 9bf82bffc462019bfc9e2b496d923dd070f4efad | |
parent | c48a593b26d2353eb8788dd85ba8618555180f55 (diff) | |
download | vboot-92ea19ae091482484c84d7b09049f7dc74bf6f42.tar.gz |
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>
46 files changed, 75 insertions, 57 deletions
diff --git a/firmware/2lib/include/2common.h b/firmware/2lib/include/2common.h index 6c5563a6..9177da71 100644 --- a/firmware/2lib/include/2common.h +++ b/firmware/2lib/include/2common.h @@ -81,10 +81,10 @@ struct vb2_public_key; __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 3f80b9ae..8560d0de 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 cf747f89..9a2eec19 100644 --- a/futility/cmd_show.c +++ b/futility/cmd_show.c @@ -40,7 +40,8 @@ struct show_option_s show_option = { }; /* 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 1c954aef..2b169a47 100644 --- a/futility/cmd_vbutil_firmware.c +++ b/futility/cmd_vbutil_firmware.c @@ -188,7 +188,8 @@ vblock_cleanup: 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 8e4b22d1..0bb59abe 100644 --- a/futility/cmd_vbutil_keyblock.c +++ b/futility/cmd_vbutil_keyblock.c @@ -178,7 +178,8 @@ static int Unpack(const char *infile, const char *datapubkey, /* 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 469e46eb..35a4f1dd 100644 --- a/futility/file_type_bios.c +++ b/futility/file_type_bios.c @@ -245,7 +245,8 @@ static int fmap_sign_fw_main(const char *name, uint8_t *buf, uint32_t len, 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 d2d67fac..c5616e57 100644 --- a/futility/file_type_rwsig.c +++ b/futility/file_type_rwsig.c @@ -64,7 +64,7 @@ int ft_show_rwsig(const char *name, uint8_t *buf, uint32_t len, void *nuthin) 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 f03feeca..80650413 100644 --- a/futility/file_type_usbpd1.c +++ b/futility/file_type_usbpd1.c @@ -372,7 +372,7 @@ static vb2_error_t try_our_own(enum vb2_signature_algorithm sig_alg, 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 332b1d35..9043bac4 100644 --- a/futility/kernel_blob.h +++ b/futility/kernel_blob.h @@ -35,7 +35,7 @@ struct linux_kernel_e820entry { 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 @@ struct linux_kernel_params { 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 27691404..97daf556 100644 --- a/futility/updater.c +++ b/futility/updater.c @@ -1259,7 +1259,8 @@ static struct vb2_keyblock *dupe_keyblock(const struct vb2_keyblock *block) 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 01c63ebd..d1d7535e 100644 --- a/futility/vb1_helper.c +++ b/futility/vb1_helper.c @@ -508,7 +508,8 @@ int VerifyKernelBlob(uint8_t *kernel_blob, 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 @@ uint8_t *CreateKernelBlob(uint8_t *vmlinuz_buf, uint32_t vmlinuz_size, 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 42b3a71d..6f3ae4f6 100644 --- a/host/lib/host_keyblock.c +++ b/host/lib/host_keyblock.c @@ -144,7 +144,8 @@ struct vb2_keyblock *vb2_create_keyblock_external( 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 a512201a..646f8ec4 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 8f8b11ac..e938d79c 100644 --- a/tests/vb20_common2_tests.c +++ b/tests/vb20_common2_tests.c @@ -83,7 +83,7 @@ static void test_verify_data(const struct vb2_packed_key *key1, 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 fb787d1f..2b0d1145 100644 --- a/tests/vb20_common3_tests.c +++ b/tests/vb20_common3_tests.c @@ -141,7 +141,7 @@ static void test_verify_keyblock(const struct vb2_public_key *public_key, 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 @@ static void test_verify_fw_preamble(struct vb2_packed_key *public_key, 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 @@ static void test_verify_kernel_preamble( 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 5099cfd8..73cb3729 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 5531f59c..73fae538 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 78fd05b2..be9d91b5 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_signatures(const struct vb2_public_key *key) */ 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 52d24489..e7058054 100644 --- a/tests/vb20_verify_fw.c +++ b/tests/vb20_verify_fw.c @@ -145,7 +145,7 @@ static void print_help(const char *progname) 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 5daeddb4..21de87d3 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 448d3372..b98b1ac8 100644 --- a/tests/vb21_common2_tests.c +++ b/tests/vb21_common2_tests.c @@ -170,7 +170,7 @@ static void test_verify_data(const struct vb2_public_key *pubk_orig, 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 797c934a..94fceadc 100644 --- a/tests/vb21_common_tests.c +++ b/tests/vb21_common_tests.c @@ -220,7 +220,7 @@ static void test_verify_hash(void) 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 @@ static void test_verify_keyblock(void) 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 @@ static void test_verify_fw_preamble(void) 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 d46fd05b..c93f714f 100644 --- a/tests/vb21_host_fw_preamble_tests.c +++ b/tests/vb21_host_fw_preamble_tests.c @@ -37,7 +37,7 @@ static void preamble_tests(const char *keys_dir) 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 451e3d3e..3a5f0f58 100644 --- a/tests/vb21_host_keyblock_tests.c +++ b/tests/vb21_host_keyblock_tests.c @@ -29,7 +29,7 @@ static void keyblock_tests(const char *keys_dir) 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 f275d2f3..b116c5ce 100644 --- a/tests/vb21_host_sig_tests.c +++ b/tests/vb21_host_sig_tests.c @@ -47,7 +47,7 @@ static void sig_tests(const struct alg_combo *combo, 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 f86d3f2e..f76ff292 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 40cd160e..a7143b7f 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 61ce1338..11c97635 100644 --- a/tests/vb2_common_tests.c +++ b/tests/vb2_common_tests.c @@ -148,7 +148,7 @@ static void test_align(void) */ 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 ecc00f37..a9060b00 100644 --- a/tests/vb2_ec_sync_tests.c +++ b/tests/vb2_ec_sync_tests.c @@ -48,7 +48,8 @@ static int mock_ec_rw_hash_size; 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 25691643..047fa423 100644 --- a/tests/vb2_gbb_tests.c +++ b/tests/vb2_gbb_tests.c @@ -15,7 +15,8 @@ static struct vb2_gbb_header *gbb = (struct vb2_gbb_header *)gbb_data; 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 53f2e7c5..9996afaf 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 26cf21e3..5f2b6c85 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 9909d7c4..269caa21 100644 --- a/tests/vb2_nvstorage_tests.c +++ b/tests/vb2_nvstorage_tests.c @@ -82,7 +82,7 @@ static void nv_storage_test(uint32_t ctxflags) 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 edc429a4..9568f45f 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 68a5ce21..c2d8e273 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 6c433db5..699f3fa7 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 d4ad3d2f..44d0603a 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 03454890..6cbcedec 100644 --- a/tests/vboot_api_devmode_tests.c +++ b/tests/vboot_api_devmode_tests.c @@ -92,7 +92,8 @@ test_case_t test[] = { }; /* 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 627a804c..2017b419 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 ed0758f8..584a134e 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 35d8ee9d..b5586801 100644 --- a/tests/vboot_api_kernel_tests.c +++ b/tests/vboot_api_kernel_tests.c @@ -302,7 +302,8 @@ static const char *got_find_disk; 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 5e040753..7ff49ee8 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 592c7850..58ccda07 100644 --- a/tests/vboot_display_tests.c +++ b/tests/vboot_display_tests.c @@ -27,7 +27,8 @@ static VbSharedDataHeader *shared = (VbSharedDataHeader *)shared_data; 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 3273b9f9..b43a2acd 100644 --- a/tests/vboot_kernel_tests.c +++ b/tests/vboot_kernel_tests.c @@ -70,7 +70,8 @@ static GptHeader *mock_gpt_primary = 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 fffd102c..051e629d 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 6069044d..8440b3a9 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)); |