Module Name:    src
Committed By:   ryo
Date:           Wed Nov 28 08:12:16 UTC 2018

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

Log Message:
don't exec 32bit binary on the cpu that has no aarch32.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 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.3 src/sys/arch/aarch64/aarch64/exec_machdep.c:1.4
--- src/sys/arch/aarch64/aarch64/exec_machdep.c:1.3	Fri Oct 12 01:28:57 2018
+++ src/sys/arch/aarch64/aarch64/exec_machdep.c	Wed Nov 28 08:12:15 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: exec_machdep.c,v 1.3 2018/10/12 01:28:57 ryo Exp $ */
+/* $NetBSD: exec_machdep.c,v 1.4 2018/11/28 08:12:15 ryo 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.3 2018/10/12 01:28:57 ryo Exp $");
+__KERNEL_RCSID(1, "$NetBSD: exec_machdep.c,v 1.4 2018/11/28 08:12:15 ryo Exp $");
 
 #include "opt_compat_netbsd.h"
 #include "opt_compat_netbsd32.h"
@@ -75,6 +75,14 @@ aarch64_netbsd_elf32_probe(struct lwp *l
 	if (!elf_aapcs_p)
 		return ENOEXEC;
 
+	/*
+	 * require aarch32 feature.
+	 * XXX should consider some cluster may have no aarch32?
+	 */
+	if (__SHIFTOUT(l->l_cpu->ci_id.ac_aa64pfr0, ID_AA64PFR0_EL1_EL0) !=
+	    ID_AA64PFR0_EL1_EL0_64_32)
+		return ENOEXEC;
+
 	return 0;
 }
 #endif

Reply via email to