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 /futility | |
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>
Diffstat (limited to 'futility')
-rw-r--r-- | futility/cmd_show.c | 3 | ||||
-rw-r--r-- | futility/cmd_vbutil_firmware.c | 3 | ||||
-rw-r--r-- | futility/cmd_vbutil_keyblock.c | 3 | ||||
-rw-r--r-- | futility/file_type_bios.c | 3 | ||||
-rw-r--r-- | futility/file_type_rwsig.c | 2 | ||||
-rw-r--r-- | futility/file_type_usbpd1.c | 2 | ||||
-rw-r--r-- | futility/kernel_blob.h | 4 | ||||
-rw-r--r-- | futility/updater.c | 3 | ||||
-rw-r--r-- | futility/vb1_helper.c | 6 |
9 files changed, 18 insertions, 11 deletions
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)); |