diff options
author | Hendrik Brueckner <brueckner@linux.vnet.ibm.com> | 2013-12-05 14:48:22 +0100 |
---|---|---|
committer | David Howells <dhowells@redhat.com> | 2013-12-10 18:25:28 +0000 |
commit | 62226983da070f7e51068ec2e3a4da34672964c7 (patch) | |
tree | 04a0e1bc11282cc966f7c7c0521fa1e0f70b8956 /kernel/system_certificates.S | |
parent | 7cfe5b3310a1b45f385ff18647bddb487a6c5525 (diff) | |
download | talos-obmc-linux-62226983da070f7e51068ec2e3a4da34672964c7.tar.gz talos-obmc-linux-62226983da070f7e51068ec2e3a4da34672964c7.zip |
KEYS: correct alignment of system_certificate_list content in assembly file
Apart from data-type specific alignment constraints, there are also
architecture-specific alignment requirements.
For example, on s390 symbols must be on even addresses implying a 2-byte
alignment. If the system_certificate_list_end symbol is on an odd address
and if this address is loaded, the least-significant bit is ignored. As a
result, the load_system_certificate_list() fails to load the certificates
because of a wrong certificate length calculation.
To be safe, align system_certificate_list on an 8-byte boundary. Also improve
the length calculation of the system_certificate_list content. Introduce a
system_certificate_list_size (8-byte aligned because of unsigned long) variable
that stores the length. Let the linker calculate this size by introducing
a start and end label for the certificate content.
Signed-off-by: Hendrik Brueckner <brueckner@linux.vnet.ibm.com>
Signed-off-by: David Howells <dhowells@redhat.com>
Diffstat (limited to 'kernel/system_certificates.S')
-rw-r--r-- | kernel/system_certificates.S | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/kernel/system_certificates.S b/kernel/system_certificates.S index 4aef390671cb..3e9868d47535 100644 --- a/kernel/system_certificates.S +++ b/kernel/system_certificates.S @@ -3,8 +3,18 @@ __INITRODATA + .align 8 .globl VMLINUX_SYMBOL(system_certificate_list) VMLINUX_SYMBOL(system_certificate_list): +__cert_list_start: .incbin "kernel/x509_certificate_list" - .globl VMLINUX_SYMBOL(system_certificate_list_end) -VMLINUX_SYMBOL(system_certificate_list_end): +__cert_list_end: + + .align 8 + .globl VMLINUX_SYMBOL(system_certificate_list_size) +VMLINUX_SYMBOL(system_certificate_list_size): +#ifdef CONFIG_64BIT + .quad __cert_list_end - __cert_list_start +#else + .long __cert_list_end - __cert_list_start +#endif |