[PATCH 5/5] x86_64: allow ELFCLASS32 for x32 support

Ahelenia Ziemiańska nabijaczleweli at nabijaczleweli.xyz
Fri Oct 9 11:40:07 EDT 2020


Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli at nabijaczleweli.xyz>
---
 kexec/arch/x86_64/kexec-elf-rel-x86_64.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/kexec/arch/x86_64/kexec-elf-rel-x86_64.c b/kexec/arch/x86_64/kexec-elf-rel-x86_64.c
index db85b44..0d22f3b 100644
--- a/kexec/arch/x86_64/kexec-elf-rel-x86_64.c
+++ b/kexec/arch/x86_64/kexec-elf-rel-x86_64.c
@@ -8,7 +8,8 @@ int machine_verify_elf_rel(struct mem_ehdr *ehdr)
 	if (ehdr->ei_data != ELFDATA2LSB) {
 		return 0;
 	}
-	if (ehdr->ei_class != ELFCLASS64) {
+	if (ehdr->ei_class != ELFCLASS64 &&
+	    ehdr->ei_class != ELFCLASS32) {  /* x32 */
 		return 0;
 	}
 	if (ehdr->e_machine != EM_X86_64) {
-- 
2.28.0
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/kexec/attachments/20201009/d6fa1189/attachment-0001.sig>


More information about the kexec mailing list