From f49c9159a241601a9087acee2feabd98cad220b6 Mon Sep 17 00:00:00 2001 From: chs Date: Sun, 12 Feb 2017 21:02:19 +0000 Subject: [PATCH] es_arglen is now in units of bytes, update the emulations accordingly. --- sys/compat/linux/arch/alpha/linux_exec.h | 4 ++-- sys/compat/linux/arch/arm/linux_exec.h | 4 ++-- sys/compat/linux/arch/i386/linux_exec.h | 4 ++-- sys/compat/linux/arch/m68k/linux_exec.h | 4 ++-- sys/compat/linux/arch/mips/linux_exec.h | 4 ++-- sys/compat/linux/arch/powerpc/linux_exec.h | 4 ++-- sys/compat/linux/common/linux_exec.h | 4 ++-- sys/compat/osf1/osf1_mod.c | 9 +++++---- sys/compat/svr4_32/svr4_32_exec.h | 7 +++---- 9 files changed, 22 insertions(+), 22 deletions(-) diff --git a/sys/compat/linux/arch/alpha/linux_exec.h b/sys/compat/linux/arch/alpha/linux_exec.h index 672018938903..614f6e95053e 100644 --- a/sys/compat/linux/arch/alpha/linux_exec.h +++ b/sys/compat/linux/arch/alpha/linux_exec.h @@ -1,4 +1,4 @@ -/* $NetBSD: linux_exec.h,v 1.12 2014/02/09 16:41:42 chs Exp $ */ +/* $NetBSD: linux_exec.h,v 1.13 2017/02/12 21:02:19 chs Exp $ */ /*- * Copyright (c) 1998 The NetBSD Foundation, Inc. @@ -48,7 +48,7 @@ * Alpha specific ELF defines. */ #define LINUX_ELF_AUX_ARGSIZ \ - (howmany(sizeof(Aux64Info) * LINUX_ELF_AUX_ENTRIES, sizeof(char *)) + LINUX_RANDOM_BYTES) + (LINUX_ELF_AUX_ENTRIES * sizeof(Aux64Info) + LINUX_RANDOM_BYTES) #define linux_exec_setup_stack exec_setup_stack diff --git a/sys/compat/linux/arch/arm/linux_exec.h b/sys/compat/linux/arch/arm/linux_exec.h index 566c4d74b953..7b13ee3e21b3 100644 --- a/sys/compat/linux/arch/arm/linux_exec.h +++ b/sys/compat/linux/arch/arm/linux_exec.h @@ -1,4 +1,4 @@ -/* $NetBSD: linux_exec.h,v 1.9 2014/02/09 16:41:42 chs Exp $ */ +/* $NetBSD: linux_exec.h,v 1.10 2017/02/12 21:02:19 chs Exp $ */ /*- * Copyright (c) 1998 The NetBSD Foundation, Inc. @@ -36,7 +36,7 @@ #define LINUX_MID_MACHINE LINUX_M_ARM #define LINUX_ELF_AUX_ARGSIZ \ - (howmany(LINUX_ELF_AUX_ENTRIES * sizeof(Aux32Info), sizeof(Elf32_Addr)) + LINUX_RANDOM_BYTES) + (LINUX_ELF_AUX_ENTRIES * sizeof(Aux32Info) + LINUX_RANDOM_BYTES) #define linux_exec_setup_stack exec_setup_stack diff --git a/sys/compat/linux/arch/i386/linux_exec.h b/sys/compat/linux/arch/i386/linux_exec.h index 94df855b2b26..146dd29f9819 100644 --- a/sys/compat/linux/arch/i386/linux_exec.h +++ b/sys/compat/linux/arch/i386/linux_exec.h @@ -1,4 +1,4 @@ -/* $NetBSD: linux_exec.h,v 1.12 2014/02/09 16:41:42 chs Exp $ */ +/* $NetBSD: linux_exec.h,v 1.13 2017/02/12 21:02:19 chs Exp $ */ /*- * Copyright (c) 1998 The NetBSD Foundation, Inc. @@ -37,7 +37,7 @@ #define LINUX_USRSTACK 0xC0000000 #define LINUX_ELF_AUX_ARGSIZ \ - (howmany(LINUX_ELF_AUX_ENTRIES * sizeof(Aux32Info), sizeof(Elf32_Addr)) + LINUX_RANDOM_BYTES) + (LINUX_ELF_AUX_ENTRIES * sizeof(Aux32Info) + LINUX_RANDOM_BYTES) #define LINUX_DEBUGLINK_SIGNATURE diff --git a/sys/compat/linux/arch/m68k/linux_exec.h b/sys/compat/linux/arch/m68k/linux_exec.h index 8f568d92f8c1..a01dfdcd7c10 100644 --- a/sys/compat/linux/arch/m68k/linux_exec.h +++ b/sys/compat/linux/arch/m68k/linux_exec.h @@ -1,4 +1,4 @@ -/* $NetBSD: linux_exec.h,v 1.11 2014/02/09 16:41:42 chs Exp $ */ +/* $NetBSD: linux_exec.h,v 1.12 2017/02/12 21:02:19 chs Exp $ */ /*- * Copyright (c) 1998 The NetBSD Foundation, Inc. @@ -41,7 +41,7 @@ #define LINUX_GCC_SIGNATURE 1 #define LINUX_ELF_AUX_ARGSIZ \ - (howmany(LINUX_ELF_AUX_ENTRIES * sizeof(Aux32Info), sizeof(Elf32_Addr)) + LINUX_RANDOM_BYTES) + (LINUX_ELF_AUX_ENTRIES * sizeof(Aux32Info) + LINUX_RANDOM_BYTES) #define linux_exec_setup_stack exec_setup_stack diff --git a/sys/compat/linux/arch/mips/linux_exec.h b/sys/compat/linux/arch/mips/linux_exec.h index e1a8180176ae..c3d64f2cfc59 100644 --- a/sys/compat/linux/arch/mips/linux_exec.h +++ b/sys/compat/linux/arch/mips/linux_exec.h @@ -1,4 +1,4 @@ -/* $NetBSD: linux_exec.h,v 1.15 2014/02/09 16:41:42 chs Exp $ */ +/* $NetBSD: linux_exec.h,v 1.16 2017/02/12 21:02:19 chs Exp $ */ /*- * Copyright (c) 1998, 2001 The NetBSD Foundation, Inc. @@ -59,7 +59,7 @@ #define LINUX_GCC_SIGNATURE 1 #define LINUX_ELF_AUX_ARGSIZ \ - (howmany(LINUX_ELF_AUX_ENTRIES * sizeof(Aux32Info), sizeof(Elf32_Addr)) + LINUX_RANDOM_BYTES) + (LINUX_ELF_AUX_ENTRIES * sizeof(Aux32Info) + LINUX_RANDOM_BYTES) #define linux_exec_setup_stack exec_setup_stack diff --git a/sys/compat/linux/arch/powerpc/linux_exec.h b/sys/compat/linux/arch/powerpc/linux_exec.h index 8353dd0c0da4..b2fb15928a0d 100644 --- a/sys/compat/linux/arch/powerpc/linux_exec.h +++ b/sys/compat/linux/arch/powerpc/linux_exec.h @@ -1,4 +1,4 @@ -/* $NetBSD: linux_exec.h,v 1.23 2014/02/09 16:41:42 chs Exp $ */ +/* $NetBSD: linux_exec.h,v 1.24 2017/02/12 21:02:19 chs Exp $ */ /*- * Copyright (c) 1998, 2001 The NetBSD Foundation, Inc. @@ -81,7 +81,7 @@ * by PowerPC GNU ld.so). */ #define LINUX_ELF_AUX_ARGSIZ \ - (howmany(LINUX_ELF_AUX_ENTRIES * sizeof(Aux32Info), sizeof(Elf32_Addr)) + LINUX_RANDOM_BYTES + 16) + (LINUX_ELF_AUX_ENTRIES * sizeof(Aux32Info) + LINUX_RANDOM_BYTES + 16) /* we have special powerpc ELF copyargs */ #define LINUX_MACHDEP_ELF_COPYARGS diff --git a/sys/compat/linux/common/linux_exec.h b/sys/compat/linux/common/linux_exec.h index 56a816ff1364..ef553a0e8a58 100644 --- a/sys/compat/linux/common/linux_exec.h +++ b/sys/compat/linux/common/linux_exec.h @@ -1,4 +1,4 @@ -/* $NetBSD: linux_exec.h,v 1.51 2014/02/21 07:53:53 maxv Exp $ */ +/* $NetBSD: linux_exec.h,v 1.52 2017/02/12 21:02:20 chs Exp $ */ /*- * Copyright (c) 1995, 1998 The NetBSD Foundation, Inc. @@ -59,7 +59,7 @@ /* Defines for a.out executables */ #define LINUX_AOUT_HDR_SIZE (sizeof (struct exec)) -#define LINUX_AOUT_AUX_ARGSIZ 2 +#define LINUX_AOUT_AUX_ARGSIZ 8 #define LINUX_N_MAGIC(ep) ((ep)->a_midmag & 0xffff) #define LINUX_N_MACHTYPE(ep) (((ep)->a_midmag >> 16) & 0xff) diff --git a/sys/compat/osf1/osf1_mod.c b/sys/compat/osf1/osf1_mod.c index 9929dd96158a..4f30a330d83d 100644 --- a/sys/compat/osf1/osf1_mod.c +++ b/sys/compat/osf1/osf1_mod.c @@ -1,4 +1,4 @@ -/* $NetBSD: osf1_mod.c,v 1.4 2014/03/07 01:33:43 christos Exp $ */ +/* $NetBSD: osf1_mod.c,v 1.5 2017/02/12 21:02:20 chs Exp $ */ /*- * Copyright (c) 2008 The NetBSD Foundation, Inc. @@ -34,7 +34,7 @@ #endif #include -__KERNEL_RCSID(0, "$NetBSD: osf1_mod.c,v 1.4 2014/03/07 01:33:43 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: osf1_mod.c,v 1.5 2017/02/12 21:02:20 chs Exp $"); #include #include @@ -48,8 +48,9 @@ __KERNEL_RCSID(0, "$NetBSD: osf1_mod.c,v 1.4 2014/03/07 01:33:43 christos Exp $" MODULE(MODULE_CLASS_EXEC, compat_osf1, "compat,exec_ecoff"); -#define OSF1_ARGLEN howmany(OSF1_MAX_AUX_ENTRIES * sizeof (struct osf1_auxv) + \ - 2 * (MAXPATHLEN + 1), sizeof (char *)) /* exec & loader names */ +#define OSF1_ARGLEN \ + (OSF1_MAX_AUX_ENTRIES * sizeof (struct osf1_auxv) + \ + 2 * (MAXPATHLEN + 1)) /* exec & loader names */ static struct execsw osf1_execsw = { .es_hdrsz = ECOFF_HDR_SIZE, diff --git a/sys/compat/svr4_32/svr4_32_exec.h b/sys/compat/svr4_32/svr4_32_exec.h index 7da3a4a184f0..83145e261769 100644 --- a/sys/compat/svr4_32/svr4_32_exec.h +++ b/sys/compat/svr4_32/svr4_32_exec.h @@ -1,4 +1,4 @@ -/* $NetBSD: svr4_32_exec.h,v 1.15 2015/11/26 13:15:34 martin Exp $ */ +/* $NetBSD: svr4_32_exec.h,v 1.16 2017/02/12 21:02:20 chs Exp $ */ /*- * Copyright (c) 1994 The NetBSD Foundation, Inc. @@ -34,10 +34,9 @@ #undef SVR4_COMPAT_SOLARIS2 #ifdef SVR4_COMPAT_SOLARIS2 -# define SVR4_32_AUX_ARGSIZ howmany((sizeof(Aux32Info) * 15) + 256, \ - sizeof(netbsd32_charp)) +# define SVR4_32_AUX_ARGSIZ (sizeof(Aux32Info) * 15 + 256) #else -# define SVR4_32_AUX_ARGSIZ howmany(sizeof(Aux32Info) * 8, sizeof(netbsd32_charp)) +# define SVR4_32_AUX_ARGSIZ (sizeof(Aux32Info) * 8) #endif int svr4_32_copyargs(struct lwp *, struct exec_package *, struct ps_strings *,