Home | History | Annotate | Download | only in netbsd32
History log of /src/sys/compat/netbsd32/netbsd32_exec_aout.c
RevisionDateAuthorComments
 1.31  19-Jan-2021  simonb KNF consistency: No parentheses are needed around the return value.
 1.30  06-Aug-2016  maxv branches: 1.30.28;
The way the kernel tries to prevent a userland process from allocating page
zero is hugely flawed. It is easy to demonstrate that one can trick UVM
into chosing a NULL hint after the user_va0_disable check from uvm_map.
Such a bypass allows kernel NULL pointer dereferences to be exploitable on
architectures with a shared userland<->kernel VA, like amd64.

Fix this by increasing the limit of the vm space made available for
userland processes. This way, UVM will never chose a NULL hint, since it
would be outside of the vm space.

The user_va0_disable sysctl still controls this feature.
 1.29  05-Dec-2014  christos Add compatibility for pre MIDMAGIC a.out binaries (with COMPAT_NOMID)
Oldzmagic binaries need "sysctl -w vm.user_va0_disable=0"
 1.28  24-Oct-2014  christos branches: 1.28.2;
remove unused prototypes
 1.27  25-Jan-2014  christos Clear the VM_TOPDOWN flag only when we succeed.
 1.26  25-Jan-2014  christos a.out binaries can't handle topdown.
Now 1.0 binaries work correctly on NetBSD-current.
 1.25  23-Apr-2010  rmind branches: 1.25.8; 1.25.18; 1.25.22;
Replace M_IOV and some malloc(9)s with kmem(9), and while there:
- Fix invalid free (M_TEMP vs M_IOV) in do_sys_recvmsg(), spotted by jakllsch@.
Also, same fix in osf1_sys_sendmsg_xopen().
- Fix attempt to free non-allocated memory in error path in netbsd32___getfh30().
- Plug a memory leak in compat_43_netbsd32_orecvmsg().
 1.24  29-May-2008  mrg branches: 1.24.12; 1.24.20; 1.24.22;
remove clause #3 from my license where there are no other
copyright holders involved.
 1.23  08-Dec-2007  dsl branches: 1.23.12; 1.23.14; 1.23.16; 1.23.18;
ANSIfy most of the function definitions in sys/compat (but not ndis).
All by the magic of sed ...
 1.22  04-Dec-2007  dsl Remove all the __P
 1.21  11-Dec-2005  christos branches: 1.21.44; 1.21.46; 1.21.52; 1.21.56;
merge ktrace-lwp.
 1.20  26-Feb-2005  perry branches: 1.20.4;
nuke trailing whitespace
 1.19  20-Feb-2004  drochner branches: 1.19.8; 1.19.10;
did this ever work? The EXEC_32 flag must be set _before_
exec_aout_prep_*magic(), otherwise setup_stack() fails.
 1.18  20-Feb-2004  drochner -MID_SPARC->NETBSD32_MID_MACHINE
-check for zero BSS size, as in kern/exec_aout.c rev. 1.23
 1.17  13-Oct-2003  agc Move Matt Green's code from a 4-clause to a 3-clause licence by removing
the advertising clause. Diffs provided in PR 22396 by Joel Baker, the changes
were confirmed to the board by Matt Green.
 1.16  08-Aug-2003  christos - GC all the setup_stack functions
- add one for linux/i386
 1.15  29-Jun-2003  fvdl branches: 1.15.2;
Back out the lwp/ktrace changes. They contained a lot of colateral damage,
and need to be examined and discussed more.
 1.14  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.13  01-Apr-2003  thorpej Use PAGE_SIZE rather than NBPG.
 1.12  10-Dec-2002  thorpej Rename __LDPGSZ to AOUT_LDPGSZ, to accurately reflect what it is.
 1.11  10-Dec-2002  thorpej Use __LDPGSZ (which must be == USRTEXT) as the text address for a.out
executables, and eliminate the USRTEXT constant, which was only used
by the a.out exec code.
 1.10  05-Oct-2002  chs count executable image pages as executable for vm-usage purposes.
also, always do the VTEXT vs. v_writecount mutual exclusion
(which we previously skipped if the text or data segment was empty).
 1.9  27-Sep-2002  provos remove trailing \n in panic(). approved perry.
 1.8  13-Nov-2001  lukem branches: 1.8.10;
add RCSIDs (including regeneration of files as appropriate)
 1.7  30-Oct-2001  thorpej - Add a new vnode flag VEXECMAP, which indicates that a vnode has
executable mappings. Stop overloading VTEXT for this purpose (VTEXT
also has another meaning).
- Rename vn_marktext() to vn_markexec(), and use it when executable
mappings of a vnode are established.
- In places where we want to set VTEXT, set it in v_flag directly, rather
than making a function call to do this (it no longer makes sense to
use a function call, since we no longer overload VTEXT with VEXECMAP's
meaning).

VEXECMAP suggested by Chuq Silvers.
 1.6  25-Aug-2001  mrg branches: 1.6.4;
update copyright notices.
 1.5  14-Feb-2001  eeh branches: 1.5.2; 1.5.4;
Support flexible process address space limits and bump kernel version number.
 1.4  03-Feb-2001  mrg s/sizeof(struct exec)/sizeof(struct netbsd32_exec)/ when calculating file offsets. now sunos32 nmagic/omagic work.
 1.3  02-Feb-2001  mrg de-static netbsd32_exec_aout_prep_[zno]magic().
de-static netbsd32_from_stat43().
move the guts of netbsd32_execve() into netbsd32_execve2().

all of are for the forthcoming sunos32 compat mode (for sparc64).
 1.2  18-Dec-2000  mrg copy exec_aout.c:exec_aout_setup_stack to netbsd32_exec_aout_setup_stack,
but use USRSTACK32 not USRSTACK, so that we get 32-bit stack addresses.

now 32 bit a.out binaries work on sparc64.
 1.1  01-Dec-2000  jdolecek branches: 1.1.2;
put a.out/elf32 specific things in netbsd32_exec_{aout|elf32}.c
emul_netbsd32 was moved to netbsd32_netbsd.c
g/c netbsd32_exec.c now
 1.1.2.5  12-Mar-2001  bouyer Sync with HEAD.
 1.1.2.4  11-Feb-2001  bouyer Sync with HEAD.
 1.1.2.3  05-Jan-2001  bouyer Sync with HEAD
 1.1.2.2  08-Dec-2000  bouyer Sync with HEAD.
 1.1.2.1  01-Dec-2000  bouyer file netbsd32_exec_aout.c was added on branch thorpej_scsipi on 2000-12-08 09:08:34 +0000
 1.5.4.3  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.5.4.2  10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.5.4.1  13-Sep-2001  thorpej Update the kqueue branch to HEAD.
 1.5.2.4  11-Dec-2002  thorpej Sync with HEAD.
 1.5.2.3  18-Oct-2002  nathanw Catch up to -current.
 1.5.2.2  14-Nov-2001  nathanw Catch up to -current.
 1.5.2.1  21-Sep-2001  nathanw Catch up to -current.
 1.6.4.1  12-Nov-2001  thorpej Sync the thorpej-mips-cache branch with -current.
 1.8.10.2  02-Oct-2003  tron Pull up revision 1.10 (requested by junyoung in ticket #1488):
count executable image pages as executable for vm-usage purposes.
also, always do the VTEXT vs. v_writecount mutual exclusion
(which we previously skipped if the text or data segment was empty).
 1.8.10.1  27-Sep-2003  tron Pull up revision 1.9 (requested by junyoung in ticket #1466):
remove trailing \n in panic(). approved perry.
 1.15.2.6  04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.15.2.5  04-Feb-2005  skrll Adapt to branch.
 1.15.2.4  21-Sep-2004  skrll Fix the sync with head I botched.
 1.15.2.3  18-Sep-2004  skrll Sync with HEAD.
 1.15.2.2  03-Aug-2004  skrll Sync with HEAD
 1.15.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.19.10.1  19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.19.8.1  29-Apr-2005  kent sync with -current
 1.20.4.3  21-Jan-2008  yamt sync with head
 1.20.4.2  07-Dec-2007  yamt sync with head
 1.20.4.1  21-Jun-2006  yamt sync with head.
 1.21.56.2  26-Dec-2007  ad Sync with head.
 1.21.56.1  08-Dec-2007  ad Sync with head.
 1.21.52.2  27-Dec-2007  mjf Sync with HEAD.
 1.21.52.1  08-Dec-2007  mjf Sync with HEAD.
 1.21.46.1  09-Jan-2008  matt sync with HEAD
 1.21.44.1  09-Dec-2007  jmcneill Sync with HEAD.
 1.23.18.1  23-Jun-2008  wrstuden Sync w/ -current. 34 merge conflicts to follow.
 1.23.16.2  11-Aug-2010  yamt sync with head.
 1.23.16.1  04-May-2009  yamt sync with head.
 1.23.14.1  04-Jun-2008  yamt sync with head
 1.23.12.1  02-Jun-2008  mjf Sync with HEAD.
 1.24.22.1  30-May-2010  rmind sync with head
 1.24.20.1  30-Apr-2010  uebayasi Sync with HEAD.
 1.24.12.2  29-May-2008  mrg remove clause #3 from my license where there are no other
copyright holders involved.
 1.24.12.1  29-May-2008  mrg file netbsd32_exec_aout.c was added on branch christos-time_t on 2008-05-29 14:51:27 +0000
 1.25.22.1  18-May-2014  rmind sync with head
 1.25.18.2  03-Dec-2017  jdolecek update from HEAD
 1.25.18.1  20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.25.8.1  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.28.2.2  05-Oct-2016  skrll Sync with HEAD
 1.28.2.1  06-Apr-2015  skrll Sync with HEAD
 1.30.28.1  03-Apr-2021  thorpej Sync with HEAD.

RSS XML Feed