Module Name:    src
Committed By:   rin
Date:           Tue Oct 13 07:04:49 UTC 2020

Modified Files:
        src/sys/arch/aarch64/aarch64: exec_machdep.c

Log Message:
BE32 binaries are no longer supported for ARMv7 and later, and
therefore for aarch64eb.

Reject them with ENOEXEC, rather than causing illegal instruction
exceptions due to unexpected binary format.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/aarch64/aarch64/exec_machdep.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/aarch64/aarch64/exec_machdep.c
diff -u src/sys/arch/aarch64/aarch64/exec_machdep.c:1.7 src/sys/arch/aarch64/aarch64/exec_machdep.c:1.8
--- src/sys/arch/aarch64/aarch64/exec_machdep.c:1.7	Sat May 23 18:08:59 2020
+++ src/sys/arch/aarch64/aarch64/exec_machdep.c	Tue Oct 13 07:04:49 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: exec_machdep.c,v 1.7 2020/05/23 18:08:59 ryo Exp $ */
+/* $NetBSD: exec_machdep.c,v 1.8 2020/10/13 07:04:49 rin Exp $ */
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
 
 #include <sys/cdefs.h>
 
-__KERNEL_RCSID(1, "$NetBSD: exec_machdep.c,v 1.7 2020/05/23 18:08:59 ryo Exp $");
+__KERNEL_RCSID(1, "$NetBSD: exec_machdep.c,v 1.8 2020/10/13 07:04:49 rin Exp $");
 
 #include "opt_compat_netbsd.h"
 #include "opt_compat_netbsd32.h"
@@ -77,6 +77,11 @@ aarch64_netbsd_elf32_probe(struct lwp *l
 	/* OABI not support */
 	if (!elf_aapcs_p)
 		return ENOEXEC;
+#ifdef __AARCH64EB__
+	/* BE32 not support */
+	if ((eh->e_flags & EF_ARM_BE8) == 0)
+		return ENOEXEC;
+#endif
 
 	/*
 	 * require aarch32 feature.

Reply via email to