Home | History | Annotate | Download | only in common
History log of /src/sys/compat/linux/common/linux_exec_elf32.c
RevisionDateAuthorComments
 1.102  26-Nov-2021  ryo The internal architecture name of golang is "arm" or "arm64", which has
different naming conventions from netbsd's machine[] or machine_arch[]
("earmv7", "aarch64", etc.) and cannot be used as is.
Instead, use define LINUX_GO_RT0_SIGNATURE_ARCH{32,64}.
 1.101  26-Nov-2021  ryo - LINUX_GO_RT0_SIGNATURE for compat_linux is no longer enabled by default.
it is now defined in each arch same as the other *_SIGNATURE definitions.
- add new LINUX32_GO_RT0_SIGNATURE for compat_linux32, and is defined in amd64 and aarch64.
 1.100  12-Jan-2020  ad Tidy up the vnode locking around execve() on ELF images to acquire and
release the locks fewer times. Proposed on tech-kern a very long time go.
 1.99  01-Mar-2019  pgoyette branches: 1.99.6;
Rename the MODULE_*_HOOK() macros to MODULE_HOOK_*() as briefly
discussed on irc.

NFCI intended.

Ride the earlier kernel bump - it;s getting crowded.
 1.98  27-Jan-2019  pgoyette Merge the [pgoyette-compat] branch
 1.97  15-Jul-2018  christos - fix constants and explain limit
- use machine32 instead of hard-coded x86 stuff
 1.96  09-Jul-2018  msaitoh Fix compile error.
 1.95  08-Jul-2018  christos Enable executing linux go binaries by using a special probe function for them.
 1.94  06-Feb-2017  uwe branches: 1.94.12; 1.94.14;
Use ELFOSABI_LINUX instead of a magic number.
 1.93  11-Jun-2015  matt branches: 1.93.2; 1.93.4;
Force *stackp to (uintptr_t) before possibly moving to a smaller pointer size.
 1.92  20-Mar-2015  maxv Zero-fill the ELF auxiliary vectors. Otherwise, on 64bit systems, the
padding between a_v and a_type contains kernel garbage, therefore
exposed to userland.

Original report by uebayasi@
 1.91  15-Apr-2014  maxv branches: 1.91.2; 1.91.4;
A specially-crafted binary could easily control a kernel array index.
Add some checks to ensure that nothing will be read outside the allocated
area. Rewrite the code so that we don't need to allocate the whole section.

Spotted by several developers, patch from chs@/enami@
 1.90  23-Feb-2014  njoly branches: 1.90.2;
Fix wrong KASSERTs. Do not compare size vs. entries count.
 1.89  21-Feb-2014  maxv Increase LINUX32_ELF_AUX_ENTRIES to avoid overrun in linux32/. Also,
add comments and KASSERTs to make sure people don't forget to increase
XX_AUX_ENTRIES's when adding vectors.

Reported by martin@ (CV), with suggestions from chs@.

ok martin@ chs@
 1.88  09-Feb-2014  chs account for the 16 bytes of AT_RANDOM data in the stack setup. fixes PR 48518.
use cprng_strong32() instead of random(). add AT_RANDOM support for linux32.
 1.87  18-Nov-2013  chs implement AT_RANDOM.
 1.86  12-Feb-2012  matt branches: 1.86.2; 1.86.6; 1.86.8; 1.86.10; 1.86.16;
Change old-style function defintions to C89 prototypes.

Approved by releng.
 1.85  03-Feb-2012  matt Add a hook for freeing an ep_emul_arg. Add a wrapper routine
(exec_free_emul_arg) to call the hook and then clear the ep_emul_arg
and ep_emul_arg_free members in the exec_package.
Change users/accessors to use these routines.
Approved by releng.
 1.84  11-Sep-2010  chs branches: 1.84.8; 1.84.12;
always supply an auxiliary vector for linux ELF processes.
static executables (such as newer versions of /sbin/ldconfig)
require this to work properly. since static executables
also don't have a PT_PHDR entry, use the same heuristic as
linux does to provide a value for AT_PHDR in this case.
 1.83  15-Mar-2009  cegger branches: 1.83.2; 1.83.4;
ansify function definitions
 1.82  20-Nov-2008  ad branches: 1.82.4;
PR port-amd64/39964 modules/compat_linux: missing symbols on amd64
 1.81  28-Apr-2008  martin branches: 1.81.2; 1.81.6; 1.81.8; 1.81.10; 1.81.16; 1.81.20;
Remove clause 3 and 4 from TNF licenses
 1.80  19-Oct-2007  ad branches: 1.80.16; 1.80.18; 1.80.20;
machine/{bus,cpu,intr}.h -> sys/{bus,cpu,intr}.h
 1.79  22-Apr-2007  dsl branches: 1.79.6; 1.79.8; 1.79.12;
Change the way that emulations locate files within the emulation root to
avoid having to allocate space in the 'stackgap'
- which is very LWP unfriendly.
The additional code for non-emulation namei() is trivial, the reduction for
the emulations is massive.
The vnode for a processes emulation root is saved in the cwdi structure
during process exec.
If the emulation root the TRYEMULROOT flag are set, namei() will do an initial
search for absolute pathnames in the emulation root, if that fails it will
retry from the normal root.
".." at the emulation root will always go to the real root, even in the middle
of paths and when expanding symlinks.
Absolute symlinks found using absolute paths in the emulation root will be
relative to the emulation root (so /usr/lib/xxx.so -> /lib/xxx.so links
inside the emulation root don't need changing).
If the root of the emulation would be returned (for an emulation lookup), then
the real root is returned instead (matching the behaviour of emul_lookup,
but being a cheap comparison here) so that programs that scan "../.."
looking for the root dircetory don't loop forever.
The target for symbolic links is no longer mangled (it used to get the
CHECK_ALT_xxx() treatment, so could get /emul/xxx prepended).
CHECK_ALT_xxx() are no more. Most of the change is deleting them, and adding
TRYEMULROOT to the flags to NDINIT().
A lot of the emulation system call stubs could now be deleted.
 1.78  04-Mar-2007  christos branches: 1.78.2; 1.78.4;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.77  09-Feb-2007  ad branches: 1.77.2;
Merge newlock2 to head.
 1.76  16-Nov-2006  christos __unused removal on arguments; approved by core.
 1.75  12-Oct-2006  christos - sprinkle __unused on function decls.
- fix a couple of unused bugs
- no more -Wno-unused for i386
 1.74  07-Aug-2006  manu branches: 1.74.4; 1.74.6;
Add a new signature test for linux probe function. We look for a .debuglink
section, which is specific to the Linux dynamic interpeter (yes, Linux
can execute it as a stand alone program)
 1.73  23-Jul-2006  ad Use the LWP cached credentials where sane.
 1.72  14-May-2006  elad integrate kauth.
 1.71  09-Feb-2006  manu branches: 1.71.2; 1.71.4; 1.71.6;
Add initial (but unfinished) COMPAT_LINUX32 for amd64. This is good enough so
that the i386 license manager part of amd64 version of Fluent works.

While I'm here, add SysV IPC to COMPAT_LINUX/amd64
 1.70  11-Dec-2005  christos branches: 1.70.2; 1.70.4; 1.70.6;
merge ktrace-lwp.
 1.69  29-May-2005  christos branches: 1.69.2;
- sprinkle const.
- add XXXUNCONST to the emul_find() pbuf argument free'ing. XXX: this needs
an api change.
- avoid variable shadowing.
 1.68  03-May-2005  manu First work on COMPAT_LINUX/amd64
Process startup and dynamiclinking work, but processes hang due to
Linux arch_prctl(2) not being really supported yet.
 1.67  26-Feb-2005  perry nuke trailing whitespace
 1.66  31-Oct-2003  drochner branches: 1.66.8; 1.66.10;
adapt for changes to kern/exec_elf32.c
 1.65  27-Oct-2003  chs uninitialized variables
 1.64  29-Jun-2003  fvdl branches: 1.64.2;
Back out the lwp/ktrace changes. They contained a lot of colateral damage,
and need to be examined and discussed more.
 1.63  29-Jun-2003  darrenr 'struct proc *' -> 'struct lwp *' as required to get GENERIC for macppc built
 1.62  28-Jun-2003  darrenr Pass lwp pointers throughtout the kernel, as required, so that the lwpid can
be inserted into ktrace records. The general change has been to replace
"struct proc *" with "struct lwp *" in various function prototypes, pass
the lwp through and use l_proc to get the process pointer when needed.

Bump the kernel rev up to 1.6V
 1.61  18-Jan-2003  thorpej Merge the nathanw_sa branch.
 1.60  29-Nov-2002  jdolecek branches: 1.60.2;
Get the dynamic interpreter location using emul_find_interp(), so that
it checks both the alternative/emul tree, and the non-emul tree.
This makes it possible to run chrooted emulated binaries without need
to setup shadow /emul tree within the chroot hierarchy.
Only tested for COMPAT_LINUX, changes to other compat modules were
mechanical.
Fixes kern/19161 by Christian Groessler.
 1.59  13-Nov-2002  jdolecek add generic linux compat ELF copyargs function

this gives:
* linux sysconf(_SC_CLK_TCK) gives correct value for linux binaries (hz)
even if hz != 100
* glibc gets proper information on real/effective uid and enables
secure mode for suid binaries

g/c LINUX_COPYARGS_FUNCTION, replaced by linux ELF copyargs function
g/c alpha-specific linux ELF copyargs function and linux ELF defines
 1.58  22-Oct-2002  christos remove XXX should die comment from the define; otherwise traditional cpp
screws up the elf name formation.
 1.57  05-Sep-2002  christos check out EI_OSABI and EI_ABIVERSION for linux signatures. This is what
http://upx.sourceforge.net/ binaries are like.
 1.56  22-Mar-2002  christos gc debugging printfs.
 1.55  15-Feb-2002  christos s/printf/uprintf/
 1.54  13-Nov-2001  lukem add RCSIDs (including regeneration of files as appropriate)
 1.53  30-Aug-2001  manu Changed the way signature tests are done. This makes possible to run
ld.so as an executable on the PowerPC (Linux's ldd does this), and it also
much clearer IMHO.
 1.52  14-Jul-2001  christos rename elf32_read_from to exec_read_from since it is used in many places
now.
 1.51  19-Jan-2001  manu branches: 1.51.2; 1.51.4;
Added a linux_atexit_signature to match Linux statically linked ELF binaries. It
searches for a __libc_atexit ELF section, which is specific to Linux
 1.50  15-Dec-2000  mycroft Tighten up the ELF signature checks, and actually look for the ABI tag added
in newer glibc versions.
 1.49  01-Dec-2000  jdolecek add e_path (emulation path) to struct emul, which replaces emulation-specific
*_emul_path variables

change macros CHECK_ALT_{CREAT|EXIST} to use that, 'root' doesn't need
to be passed explicitly any more and *_CHECK_ALT_{CREAT|EXIST} are removed
change explicit emul_find() calls in probe functions to get the emulation
path from the checked exec switch entry's emulation

remove no longer needed header files

add e_flags and e_syscall to struct emul; these are unsed and empty for now
 1.48  21-Nov-2000  jdolecek restructure struct emul and execsw, in preparation to make emulations LKMable:
* move all exec-type specific information from struct emul to execsw[] and
provide single struct emul per emulation
* elf:
- kern/exec_elf32.c:probe_funcs[] is gone, execsw[] how has one entry
per emulation and contains pointer to respective probe function
- interp is allocated via MALLOC() rather than on stack
- elf_args structure is allocated via MALLOC() rather than malloc()
* ecoff: the per-emulation hooks moved from alpha and mips specific code
to OSF1 and Ultrix compat code as appropriate, execsw[] has one entry per
emulation supporting ecoff with appropriate probe function
* the makecmds/probe functions don't set emulation, pointer to emulation is
part of appropriate execsw[] entry
* constify couple of structures
 1.47  17-Nov-2000  erh Make the linux compatibilty code work on the alpha. (horay!) (at last!)
Two main changes:
Create a linux_elf64_copyargs that uses the linux specific LinuxAuxInfo
structure. This is only used on the alpha. i386 and m68k use the
standard elf copyargs function.

Since linux's approach to binary compatibilty is to look as much
like osf1 as possible, add all the osf1 syscalls that we have
implemented to the linux syscall table. This includes get/setsysinfo,
ported from FreeBSD.

In order for linux compat to work you must have COMPAT_OSF1, COMPAT_43,
COMPAT_09, COMPAT_12 and COMPAT_13 on also.
 1.46  13-Nov-2000  jdolecek change the type of *syscallnames[] array to 'const char * const foo[]'
 1.45  29-Jun-2000  mrg remove include of <vm/vm.h>
 1.44  26-Jun-2000  mrg remove redundant vm includes.
 1.43  25-Oct-1999  kleink Update to match new SVR4-style definition names in <sys/exec_elf.h>.
 1.42  30-Apr-1999  cgd branches: 1.42.2; 1.42.4; 1.42.6;
compute the value to be used for e_arglen via howmany(value, sizeof (char *)),
rather than just "value / sizeof (char *)". While in these cases the latter
works as well, the former's a better example for other uses to copy (since
it handles the non-integral multiple case correctly).
 1.41  09-Feb-1999  christos branches: 1.41.4;
const poisoning.
 1.40  05-Nov-1998  erh Make sure the interpreter string is long enough to check against.
 1.39  23-Oct-1998  veego Include linux_errno.h to fix the recent error->errno losage.
 1.38  23-Oct-1998  erh Change linux_error to native_to_linux_errno. Add some (unrelated) debugging printfs.
 1.37  07-Oct-1998  erh The siginfo include line is not needed here anymore.
 1.36  04-Oct-1998  christos unobfuscate: !strncmp() != 0 -> strncmp() == 0
 1.35  04-Oct-1998  fvdl Fix wrong strncmp test.
 1.34  04-Oct-1998  fvdl Assign my copyright to TNF. Merge with others were appropriate.
Regen syscall files after script change.
 1.33  03-Oct-1998  christos Remove stray debugging printfs
 1.32  03-Oct-1998  christos Attempt to fix the mess.
 1.31  01-Oct-1998  erh Split compat/linux/linux_exec.c into common, elf and a.out parts.
 1.30  11-Sep-1998  mycroft Substantial signal handling changes:
* Increase the size of sigset_t to accomodate 128 signals -- adding new
versions of sys_setprocmask(), sys_sigaction(), sys_sigpending() and
sys_sigsuspend() to handle the changed arguments.
* Abstract the guts of sys_sigaltstack(), sys_setprocmask(), sys_sigaction(),
sys_sigpending() and sys_sigsuspend() into separate functions, and call them
from all the emulations rather than hard-coding everything. (Avoids uses
the stackgap crap for these system calls.)
* Add a new flag (p_checksig) to indicate that a process may have signals
pending and userret() needs to do the full (slow) check.
* Eliminate SAS_ALTSTACK; it's exactly the inverse of SS_DISABLE.
* Correct emulation bugs with restoring SS_ONSTACK.
* Make the signal mask in the sigcontext always use the emulated mask format.
* Store signals internally in sigaction structures, rather than maintaining a
bunch of little sigsets for each SA_* bit.
* Keep track of where we put the signal trampoline, rather than figuring it out
in *_sendsig().
* Issue a warning when a non-emulated sigaction bit is observed.
* Add missing emulated signals, and a native SIGPWR (currently not used).
* Implement the `not reset when caught' semantics for relevant signals.

Note: Only code touched by the i386 port has been modified. Other ports and
emulations need to be updated.
 1.29  05-Sep-1998  christos Assign copyright to TNF.
 1.28  09-Aug-1998  perry bzero->memset, bcopy->memcpy, bcmp->memcmp
 1.27  28-Jul-1998  thorpej Change the "aresid" argument of vn_rdwr() from an int * to a size_t *,
to match the new uio_resid type.
 1.26  24-Jan-1998  mycroft Use linux_setregs().
 1.25  13-Oct-1996  christos branches: 1.25.14;
catch up with Jason's exec.h inclusion.
 1.24  10-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.23  07-Oct-1996  cgd include <sys/exec.h> rather than <machine/exec.h>
 1.22  05-Oct-1996  jtk update to compile; needs new enum name 'Elf_sht_progbits'
 1.21  03-Oct-1996  cgd kill (re)definitions of EXEC_ELF32. They're no longer necessary
(because of the EXEC_* option changes), and now cause warnings.
 1.20  03-Oct-1996  thorpej Fix a section header check that didn't get updated with the elf32/elf64
changes. Make this compile again with the new EXEC_* options.
 1.19  30-Sep-1996  christos Elf32_sht_progbits -> Elf_sht_progbits
 1.18  27-Sep-1996  cgd slightly clean up some of the changes made when ELF64 support went in
 1.17  26-Sep-1996  cgd adapt ELF-using compat code to use new ELF definitions/code. At this point,
these are restricted to 32-bit ELF, and should be severely cleaned.
 1.16  03-Sep-1996  mycroft Define execv() and execve() consistently across emulations.
Do path name translation.
 1.15  13-Jun-1996  christos Simplify and add comments.
 1.14  13-Jun-1996  christos - Pass the Elf32_Ehdr in the linux probe function, and use it!

Since linux binaries are (mostly) always compiled with gcc, look for
the gcc signature in the .comment section header: "\0 GCC: (GNU) ".
I've changed the probe order in kern/exec_elf.c to probe for linux ELF
binaries first and fall back to SVR4 binaries. This makes statically
linked binaries work for both linux and svr4. Note that gcc-compiled
svr4 binaries, still contain the operating system signature first and
then the GCC signature, so there is no conflict. Yes this is a hack.
 1.13  05-Apr-1996  christos branches: 1.13.4;
Prototyping changes.
 1.12  07-Oct-1995  mycroft Prefix names of system call implementation functions with `sys_'.
 1.11  19-Sep-1995  thorpej Make system calls conform to a standard prototype and bring those
prototypes into scope.
 1.10  14-Aug-1995  mycroft Rearrange #includes.
 1.9  24-Jun-1995  christos Use compat_util.[ch].
 1.8  22-Jun-1995  fvdl * Changed to use generic ELF code from kern/exec_elf.c (which was taken
from the svr4 exec code plus the linux compat mods)
* Include file change
* Add multicast sockopts (from John Brezak)
 1.7  11-Jun-1995  fvdl Don't forget to acknowledge that all the ELF stuff was taken from
Christos' svr4 code.
 1.6  11-Jun-1995  fvdl * Make Linux ELF binaries work. Lots of code duplication, but it will have to do
for now.
* Add a sanity check in linux_uselib
 1.5  16-May-1995  mycroft Generate the new ps_strings format.
 1.4  22-Apr-1995  christos - added struct emul to all emulations.
- removed all setup functions.
- added copyargs() functions where needed.
 1.3  07-Apr-1995  fvdl Handle Linux signal tramp code differently. Some changes because of the
now seperate Linux signal trampoline code. Add linux_sigreturn to
syscalls.master.
 1.2  05-Mar-1995  fvdl Added a few more system calls.
More consistent alternate root file semantics throughout.
 1.1  28-Feb-1995  fvdl Added Linux compat code.
 1.13.4.1  10-Dec-1996  mycroft From trunk:
Do execv() and execve() path name translation consistently across
emulations.
 1.25.14.1  29-Jan-1998  mellon Pull up 1.26 (mycroft)
 1.41.4.1  21-Jun-1999  thorpej Sync w/ -current.
 1.42.6.1  27-Dec-1999  wrstuden Pull up to last week's -current.
 1.42.4.1  15-Nov-1999  fvdl Sync with -current
 1.42.2.5  11-Feb-2001  bouyer Sync with HEAD.
 1.42.2.4  05-Jan-2001  bouyer Sync with HEAD
 1.42.2.3  08-Dec-2000  bouyer Sync with HEAD.
 1.42.2.2  22-Nov-2000  bouyer Sync with HEAD.
 1.42.2.1  20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
 1.51.4.6  10-Oct-2002  jdolecek sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work
 1.51.4.5  23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.51.4.4  16-Mar-2002  jdolecek Catch up with -current.
 1.51.4.3  10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.51.4.2  13-Sep-2001  thorpej Update the kqueue branch to HEAD.
 1.51.4.1  03-Aug-2001  lukem update to -current
 1.51.2.9  11-Dec-2002  thorpej Sync with HEAD.
 1.51.2.8  11-Nov-2002  nathanw Catch up to -current
 1.51.2.7  17-Sep-2002  nathanw Catch up to -current.
 1.51.2.6  29-May-2002  nathanw #include <sys/sa.h> before <sys/syscallargs.h>, to provide sa_upcall_t
now that <sys/param.h> doesn't include <sys/sa.h>.

(Behold the Power of Ed)
 1.51.2.5  01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.51.2.4  28-Feb-2002  nathanw Catch up to -current.
 1.51.2.3  14-Nov-2001  nathanw Catch up to -current.
 1.51.2.2  21-Sep-2001  nathanw Catch up to -current.
 1.51.2.1  24-Aug-2001  nathanw Catch up with -current.
 1.60.2.1  18-Dec-2002  gmcgarry Merge pcred and ucred, and poolify. TBD: check backward compatibility
and factor-out some higher-level functionality.
 1.64.2.7  10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.64.2.6  04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.64.2.5  18-Nov-2004  skrll Adapt to branch. macppc release builds.
 1.64.2.4  21-Sep-2004  skrll Fix the sync with head I botched.
 1.64.2.3  18-Sep-2004  skrll Sync with HEAD.
 1.64.2.2  03-Aug-2004  skrll Sync with HEAD
 1.64.2.1  02-Jul-2003  darrenr Apply the aborted ktrace-lwp changes to a specific branch. This is just for
others to review, I'm concerned that patch fuziness may have resulted in some
errant code being generated but I'll look at that later by comparing the diff
from the base to the branch with the file I attempt to apply to it. This will,
at the very least, put the changes in a better context for others to review
them and attempt to tinker with removing passing of 'struct lwp' through
the kernel.
 1.66.10.1  19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.66.8.1  29-Apr-2005  kent sync with -current
 1.69.2.5  27-Oct-2007  yamt sync with head.
 1.69.2.4  03-Sep-2007  yamt sync with head.
 1.69.2.3  26-Feb-2007  yamt sync with head.
 1.69.2.2  30-Dec-2006  yamt sync with head.
 1.69.2.1  21-Jun-2006  yamt sync with head.
 1.70.6.2  01-Jun-2006  kardel Sync with head.
 1.70.6.1  22-Apr-2006  simonb Sync with head.
 1.70.4.1  09-Sep-2006  rpaulo sync with head
 1.70.2.1  18-Feb-2006  yamt sync with head.
 1.71.6.1  24-May-2006  tron Merge 2006-05-24 NetBSD-current into the "peter-altq" branch.
 1.71.4.2  06-May-2006  christos - Move kauth_cred_t declaration to <sys/types.h>
- Cleanup struct ucred; forward declarations that are unused.
- Don't include <sys/kauth.h> in any header, but include it in the c files
that need it.

Approved by core.
 1.71.4.1  08-Mar-2006  elad Adapt to kernel authorization KPI.
 1.71.2.2  11-Aug-2006  yamt sync with head
 1.71.2.1  24-May-2006  yamt sync with head.
 1.74.6.2  10-Dec-2006  yamt sync with head.
 1.74.6.1  22-Oct-2006  yamt sync with head
 1.74.4.2  30-Jan-2007  ad Remove support for SA. Ok core@.
 1.74.4.1  18-Nov-2006  ad Sync with head.
 1.77.2.2  07-May-2007  yamt sync with head.
 1.77.2.1  12-Mar-2007  rmind Sync with HEAD.
 1.78.4.1  11-Jul-2007  mjf Sync with head.
 1.78.2.2  23-Oct-2007  ad Sync with head.
 1.78.2.1  27-May-2007  ad Sync with head.
 1.79.12.1  25-Oct-2007  bouyer Sync with HEAD.
 1.79.8.1  06-Nov-2007  matt sync with HEAD
 1.79.6.1  26-Oct-2007  joerg Sync with HEAD.

Follow the merge of pmap.c on i386 and amd64 and move
pmap_init_tmp_pgtbl into arch/x86/x86/pmap.c. Modify the ACPI wakeup
code to restore CR4 before jumping back into kernel space as the large
page option might cover that.
 1.80.20.3  09-Oct-2010  yamt sync with head
 1.80.20.2  04-May-2009  yamt sync with head.
 1.80.20.1  16-May-2008  yamt sync with head.
 1.80.18.1  18-May-2008  yamt sync with head.
 1.80.16.2  17-Jan-2009  mjf Sync with HEAD.
 1.80.16.1  02-Jun-2008  mjf Sync with HEAD.
 1.81.20.1  14-May-2014  msaitoh Pull up following revision(s) (requested by maxv in ticket #1902):
src/sys/compat/linux/common/linux_exec_elf32.c 1.91 via patch

A specially-crafted binary could easily control a kernel array index.
Add some checks to ensure that nothing will be read outside the allocated
area. Rewrite the code so that we don't need to allocate the whole section.

Spotted by several developers, patch from chs@/enami@
 1.81.16.1  14-May-2014  msaitoh Pull up following revision(s) (requested by maxv in ticket #1902):
src/sys/compat/linux/common/linux_exec_elf32.c 1.91 via patch

A specially-crafted binary could easily control a kernel array index.
Add some checks to ensure that nothing will be read outside the allocated
area. Rewrite the code so that we don't need to allocate the whole section.

Spotted by several developers, patch from chs@/enami@
 1.81.10.1  14-May-2014  msaitoh Pull up following revision(s) (requested by maxv in ticket #1902):
src/sys/compat/linux/common/linux_exec_elf32.c 1.91 via patch

A specially-crafted binary could easily control a kernel array index.
Add some checks to ensure that nothing will be read outside the allocated
area. Rewrite the code so that we don't need to allocate the whole section.

Spotted by several developers, patch from chs@/enami@
 1.81.8.2  28-Apr-2009  skrll Sync with HEAD.
 1.81.8.1  19-Jan-2009  skrll Sync with HEAD.
 1.81.6.1  13-Dec-2008  haad Update haad-dm branch to haad-dm-base2.
 1.81.2.2  14-May-2008  wrstuden Per discussion with ad, remove most of the #include <sys/sa.h> lines
as they were including sa.h just for the type(s) needed for syscallargs.h.

Instead, create a new file, sys/satypes.h, which contains just the
types needed for syscallargs.h. Yes, there's only one now, but that
may change and it's probably more likely to change if it'd be difficult
to handle. :-)

Per discussion with matt at n dot o, add an include of satypes.h to
sigtypes.h. Upcall handlers are kinda signal handlers, and signalling
is the header file that's already included for syscallargs.h that
closest matches SA.

This shaves about 3000 lines off of the diff of the branch relative
to the base. That also represents about 18% of the total before this
checkin.

I think this reduction is very good thing.
 1.81.2.1  10-May-2008  wrstuden Initial checkin of re-adding SA. Everything except kern_sa.c
compiles in GENERIC for i386. This is still a work-in-progress, but
this checkin covers most of the mechanical work (changing signalling
to be able to accomidate SA's process-wide signalling and re-adding
includes of sys/sa.h and savar.h). Subsequent changes will be much
more interesting.

Also, kern_sa.c has received partial cleanup. There's still more
to do, though.
 1.82.4.1  13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.83.4.1  05-Mar-2011  rmind sync with head
 1.83.2.1  22-Oct-2010  uebayasi Sync with HEAD (-D20101022).
 1.84.12.1  18-Feb-2012  mrg merge to -current.
 1.84.8.2  22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.84.8.1  17-Apr-2012  yamt sync with head
 1.86.16.1  21-Apr-2014  bouyer Pull up following revision(s) (requested by maxv in ticket #1051):
sys/compat/linux/common/linux_exec_elf32.c: revision 1.91 via patch
A specially-crafted binary could easily control a kernel array index.
Add some checks to ensure that nothing will be read outside the allocated
area. Rewrite the code so that we don't need to allocate the whole section.
Spotted by several developers, patch from chs@/enami@
 1.86.10.1  18-May-2014  rmind sync with head
 1.86.8.1  21-Apr-2014  bouyer Pull up following revision(s) (requested by maxv in ticket #1051):
sys/compat/linux/common/linux_exec_elf32.c: revision 1.91 via patch
A specially-crafted binary could easily control a kernel array index.
Add some checks to ensure that nothing will be read outside the allocated
area. Rewrite the code so that we don't need to allocate the whole section.
Spotted by several developers, patch from chs@/enami@
 1.86.6.2  03-Dec-2017  jdolecek update from HEAD
 1.86.6.1  20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.86.2.1  21-Apr-2014  bouyer Pull up following revision(s) (requested by maxv in ticket #1051):
sys/compat/linux/common/linux_exec_elf32.c: revision 1.91 via patch
A specially-crafted binary could easily control a kernel array index.
Add some checks to ensure that nothing will be read outside the allocated
area. Rewrite the code so that we don't need to allocate the whole section.
Spotted by several developers, patch from chs@/enami@
 1.90.2.1  10-Aug-2014  tls Rebase.
 1.91.4.3  28-Aug-2017  skrll Sync with HEAD
 1.91.4.2  22-Sep-2015  skrll Sync with HEAD
 1.91.4.1  06-Apr-2015  skrll Sync with HEAD
 1.91.2.1  29-Mar-2015  martin Pull up following revision(s) (requested by maxv in ticket #650):
sys/compat/netbsd32/netbsd32_exec_elf32.c: revision 1.39
sys/kern/exec_elf.c: revision 1.71
sys/compat/linux32/common/linux32_exec_elf32.c: revision 1.18
sys/compat/linux/common/linux_exec_elf32.c: revision 1.92
sys/compat/svr4_32/svr4_32_exec_elf32.c: revision 1.24
Zero-fill the ELF auxiliary vectors. Otherwise, on 64bit systems, the
padding between a_v and a_type contains kernel garbage, therefore
exposed to userland.
Original report by uebayasi@
 1.93.4.1  21-Apr-2017  bouyer Sync with HEAD
 1.93.2.1  20-Mar-2017  pgoyette Sync with HEAD
 1.94.14.2  08-Apr-2020  martin Merge changes from current as of 20200406
 1.94.14.1  10-Jun-2019  christos Sync with HEAD
 1.94.12.8  25-Jan-2019  pgoyette Move the netbsd32_machine32_hook into the main kernel with most of
the other hooks.

Although this hook might better belong in compat/netbsd32/ code,
there are some machines without a netbsd32 module (for example, i386
and sgimips) which still have consumers/users of this hook. :(
 1.94.12.7  24-Jan-2019  pgoyette Move the definition around to avoid strange compiler error (something
about trying to set a section attribute on a local variable).
 1.94.12.6  24-Jan-2019  pgoyette revert previous, just define the hook here
 1.94.12.5  24-Jan-2019  pgoyette And include the definition
 1.94.12.4  24-Jan-2019  pgoyette Make sure we declare the hook variable
 1.94.12.3  24-Jan-2019  pgoyette Rework placement of the new netbsd32_machine32_hook
 1.94.12.2  24-Jan-2019  pgoyette Replace weak symbol definition for machine32 with a hook. Our in-kernel
linker doesn't handle weak symbols, so this prevented us from loading the
compat_linux32 module.

XXX There don't seem to be any other consumers of machine32 (nor does
XXX there seem to be any consumers of machine_arch32), even though it
XXX is defined for aarch64, arm32, and riscv).
 1.94.12.1  28-Jul-2018  pgoyette Sync with HEAD
 1.99.6.1  17-Jan-2020  ad Sync with head.

RSS XML Feed