Commit Graph

185 Commits

Author SHA1 Message Date
martin
5eee9e2b47 Adapt to recent exec changes. 2002-08-29 14:02:50 +00:00
christos
f2d5bd5133 s/au_/a_/g noticed by martin 2002-08-29 13:48:42 +00:00
christos
830c5c171a Implement passing AT_{E,R}{U,G}ID in the elf aux vector, like solaris.
- pass struct proc to copyargs.
- eliminate svr4_copyargs, since it is the same as ours now.
2002-08-26 21:05:59 +00:00
thorpej
cf013daeb3 Fix some signed/unsigned comparison warnings from GCC 3.3. 2002-08-25 21:18:15 +00:00
jdolecek
4be499b52b Convert to use p_opptr rather than p_oppid. Part of fix for
security/14444 by David Sainty.
2002-07-28 18:42:41 +00:00
fvdl
e877145e56 Move netbsd32_sysarch to netbsd32_machdep.c 2002-07-07 23:23:41 +00:00
thorpej
011d4d5f44 Add kernel support for having userland provide the signal trampoline:
* struct sigacts gets a new sigact_sigdesc structure, which has the
  sigaction and the trampoline/version.  Version 0 means "legacy kernel
  provided trampoline".  Other versions are coordinated with machine-
  dependent code in libc.
* sigaction1() grows two more arguments -- the trampoline pointer and
  the trampoline version.
* A new __sigaction_sigtramp() system call is provided to register a
  trampoline along with a signal handler.
* The handler is no longer passed to sensig() functions.  Instead,
  sendsig() looks up the handler by peeking in the sigacts for the
  process getting the signal (since it has to look in there for the
  trampoline anyway).
* Native sendsig() functions now select the appropriate trampoline and
  its arguments based on the trampoline version in the sigacts.

Changes to libc to use the new facility will be checked in later.  Kernel
version not bumped; we will ride the 1.6C bump made recently.
2002-07-04 23:32:02 +00:00
eeh
863fc84f4d Provide the correct architecture for HW_MACHINE_ARCH so things like
"sysctl -p" can tell they are in 32-bit land.
2002-06-14 18:28:19 +00:00
fvdl
fab373098c Fix wrong psstr computation.
(XXX why is there an entire copy of sys_execve here?)
2002-06-06 10:12:42 +00:00
eeh
bf3b10f8aa Prototype for probing noteless 32-bit emulation binaries. 2002-06-04 14:49:15 +00:00
fvdl
b6631fa4ec Make this compile again since the previous change. KNF. 2002-06-01 15:10:43 +00:00
eeh
cfa7e7d168 Support chroot-ing to a 32-bit installation. 2002-05-31 00:49:42 +00:00
martin
8ff591e85d Add missing prototype for compat_43_netbsd32_sigsetmask. 2002-05-04 12:54:03 +00:00
mrg
86477819ce regenerate. 2002-04-29 09:55:11 +00:00
mrg
0ce90a9fef build the netbsd32_compat* objects into libcompat.a, so they are available
to emulations not just netbsd itself.  rename the compat_10 functions to
match everything else.  fixes a problem reported by julian coleman.
2002-04-29 09:53:39 +00:00
jdolecek
4cfe9dc1f6 use FILE_USE()/FILE_UNUSE() as appropriate, use malloc()/free()
instead of MALLOC()/FREE() for variable-size allocations (sync
with kern/sys_generic.c)
XXX not tested
2002-03-24 15:19:24 +00:00
jdolecek
dd94bff875 invoke setregs hooks correctly, as in sys_execve()
Problem noted and fix tested by Eduardo Horvath
2002-03-22 21:36:46 +00:00
christos
381e6a7764 make the stackgap_{init,alloc} functions MP friendly (i.e. pass struct proc *
in, instead of using curproc). While there add an optional size argument to
stackgap_init.
2002-03-16 20:43:48 +00:00
chs
b744097a5f allow writing to write-only mappings. fixes PR 3493. 2002-02-14 07:08:02 +00:00
mrg
fa38881ffa fix error in previous; pointed out by andrew brown. 2002-01-03 15:28:13 +00:00
mrg
3f49c27162 clean up 2002-01-03 06:43:23 +00:00
mrg
5d06ed3c94 move sparc specific ioctl handling (fb & openprom) into arch/sparc64. 2002-01-03 02:29:39 +00:00
thorpej
7767121514 I can't win today -- make this link. 2001-12-10 04:05:23 +00:00
thorpej
06920aef28 Move the code that walks the process's VM map during a coredump
into uvm_coredump_walkmap(), and use callbacks into the coredump
routine to do something with each section.
2001-12-10 01:52:26 +00:00
thorpej
d0e51ba7da Fix compilation problems. 2001-12-09 23:08:34 +00:00
thorpej
205c159f0e Make the coredump routine exec-format/emulation specific. Split
out traditional NetBSD coredump routines into core_netbsd.c and
netbsd32_core.c (for COMPAT_NETBSD32).
2001-12-08 00:35:25 +00:00
jdolecek
bf7f67be85 if the LKM support is not compiled in, don't bother using exec_lock
at all, it's only needed in LKM case

use #if defined(LKM) || defined(_LKM) condition for netbsd32_execve.c,
to DTRT when either compiled statically into kernel with LKM support,
or compiled as a LKM
2001-11-23 22:02:39 +00:00
lukem
2565646230 don't need <sys/types.h> when including <sys/param.h> 2001-11-15 09:47:59 +00:00
lukem
dab6ef8b56 add RCSIDs (including regeneration of files as appropriate) 2001-11-13 02:07:52 +00:00
thorpej
e8ee04475d - 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.
2001-10-30 15:32:01 +00:00
thorpej
e38a2e561a machine/fbio.h -> dev/sun/fbio.h 2001-09-19 18:10:32 +00:00
jdolecek
ef8abe0767 Make the setregs hook emulation-specific, rather than executable
format specific.
Struct emul has a e_setregs hook back, which points to emulation-specific
setregs function. es_setregs of struct execsw now only points to
optional executable-specific setup function (this is only used for
ECOFF).
2001-09-18 19:36:32 +00:00
mrg
e63635fdcd update copyright notices. 2001-08-25 15:06:02 +00:00
eeh
16b1f7aae0 Fix bug in netbsd32_compat_43_olseek return value. 2001-08-15 05:16:59 +00:00
eeh
8180bfa441 Add missing `error'. 2001-07-30 22:04:08 +00:00
christos
934898bc32 Adjust to the new copyargs() footprint. 2001-07-29 21:28:45 +00:00
christos
b474b9ac65 carry on the copyargs() and exit1() changes from kern_exec.c 2001-07-29 21:28:20 +00:00
jdolecek
588b94c0a2 Expel MSG_COMPAT/COMPAT_OLDSOCK, make the COMPAT_43 wrappers
arrange things as needed.  Unfortunately, the check in sockargs()
have to stay, since 4.3BSD bind(2), connect(2) and sendto(2) were
not versioned at the time :(

This code was tested to pass regression tests.
2001-07-17 11:49:40 +00:00
jdolecek
26d45c1101 Back off the sendit()/recvit() change, some have problems with it 2001-06-25 20:46:11 +00:00
jdolecek
7f7c60e827 Add 'kernsa' parameter for sendit()/recvit(); if nonzero, msg->msg_name
is supposed to point directly to struct mbuf or struct sockaddr in kernel
space as appropriate, rather than being a pointer to memory in userland.

This is to be used by compat/* when emulation needs to wrap
send{to|msg}(2)/recv{from|msg}(2) and modify the passed struct
sockaddr.
2001-06-25 19:24:02 +00:00
fvdl
fe75469d65 Some of this was sparc-specific, so ifdef __sparc__ it (XXX). Also,
change the alignment of one structure with an MD ifdef. Should
be moved into the netbsd32_machdep parts.
2001-06-19 00:36:21 +00:00
christos
0f380fac15 Add an e_trapsignal member to struct emul, so that emulated processes can
send the appropriate signal depending on the trap type.
2001-06-18 02:00:48 +00:00
thorpej
7660fd850d In check_exec(), don't bother checking P_TRACED along with
MNT_NOSUID, just check MNT_NOSUID to clear the S{U,G}ID bits
in the attributes for the vnode we're about to exec.

We now check P_TRACED right before we would actually perform
the s{u,g}id function in the exec code.

This closes a race condition between exec of a setuid binary
and ptrace(2).
2001-06-15 17:24:19 +00:00
thorpej
80cc38a1af Fix a partial construction problem that can cause race conditions
between creation of a file descriptor and close(2) when using kernel
assisted threads.  What we do is stick descriptors in the table, but
mark them as "larval".  This causes essentially everything to treat
it as a non-existent descriptor, except for fdalloc(), which sees a
filled slot so that it won't (incorrectly) allocate it again.  When
a descriptor is fully constructed, the code that has constructed it
marks it as "mature" (which actually clears the "larval" flag), and
things continue to work as normal.

While here, gather all the code that gets a descriptor from the table
into a fd_getfile() function, and call it, rather than having the
same (sometimes incorrect) code copied all over the place.
2001-06-14 20:32:41 +00:00
mrg
25e7951011 proto for coredump32 2001-06-06 21:45:56 +00:00
mrg
a6a28df3e2 add netbsd32_uvm_unix.c and netbsd32_kern_sig.c 2001-06-06 21:30:28 +00:00
mrg
06f624518c sync with uvm_unix.c 1.23 2001-06-06 21:30:07 +00:00
mrg
85794da2bd LKM friendly: move coredump32() here 2001-06-06 21:25:11 +00:00
mrg
5677baf886 LKM friendly: move uvm_coredump32() here 2001-06-06 21:24:39 +00:00
mrg
6a89288a37 use _KERNEL_OPT. 2001-05-30 11:37:21 +00:00