Commit Graph

131 Commits

Author SHA1 Message Date
ad d18c6ca4de Merge from vmlocking:
- pool_cache changes.
- Debugger/procfs locking fixes.
- Other minor changes.
2007-11-07 00:23:13 +00:00
ad bccf777b72 Make ras_lookup() lockless. 2007-10-24 14:50:38 +00:00
ad 15b0a1106e Merge from vmlocking: don't add a refrerence to a dying LWP. 2007-10-08 14:08:26 +00:00
dsl 0ca3d21b5b Include sys/cdefs.h first. 2007-09-21 19:14:12 +00:00
ad 4688843d2b Merge unobtrusive locking changes from the vmlocking branch. 2007-07-21 19:21:53 +00:00
ad 88ab7da936 Merge some of the less invasive changes from the vmlocking branch:
- kthread, callout, devsw API changes
- select()/poll() improvements
- miscellaneous MT safety improvements
2007-07-09 20:51:58 +00:00
ad b0c22204d2 process_stoptrace: after setting a pending stop on curproc, call issignal
once to have it do the needful. PR kern/36161.
2007-04-19 22:42:10 +00:00
skrll 335ac44f76 Restore previous semantics of PT_LWPINFO and make sure to lwp_addref the
LWP.

OK'ed by ad.
2007-03-15 20:55:15 +00:00
ad c147748d84 - Make the proclist_lock a mutex. The write:read ratio is unfavourable,
and mutexes are cheaper use than RW locks.
- LOCK_ASSERT -> KASSERT in some places.
- Hold proclist_lock/kernel_lock longer in a couple of places.
2007-03-09 14:11:22 +00:00
christos 53524e44ef Kill caddr_t; there will be some MI fallout, but it will be fixed shortly. 2007-03-04 05:59:00 +00:00
pavel 934634a18c Change the process/lwp flags seen by userland via sysctl back to the
P_*/L_* naming convention, and rename the in-kernel flags to avoid
conflict. (P_ -> PK_, L_ -> LW_ ). Add back the (now unused) LSDEAD
constant.

Restores source compatibility with pre-newlock2 tools like ps or top.

Reviewed by Andrew Doran.
2007-02-17 22:31:36 +00:00
ad b07ec3fc38 Merge newlock2 to head. 2007-02-09 21:55:00 +00:00
elad 8764325d83 Refactor a bit the ptrace(2) code: first make the keep-kernel-stable
decisions, then have a kauth(9) call for security policy enforcement,
and only then proceed to processing each request.

Add a KAUTH_PROCESS_CANSEE call right after pfind(). This should really
be done differently, so mark it with XXX.
2006-12-27 10:02:46 +00:00
christos 99f8337886 get the vmspace first before you try to use it. 2006-12-06 18:54:02 +00:00
elad edad69123e PR/25741: ITOH Yasufumi: ras(9) sequence is not protected against ptrace(2)
Okay christos@
2006-12-04 18:50:19 +00:00
elad 233dc909a8 Kill process_checkioperm().
While here, adjust comments.
2006-11-28 17:58:10 +00:00
elad 8bb202af97 Move ktrace, ptrace, systrace, and procfs to use kauth(9).
First, remove process_checkioperm() calls from MD code. Similar checks
using kauth(9) routines (on the process scope, using appropriate action)
are done in the callers.

Add secmodel back-end to handle each subsystem.
2006-11-28 17:27:09 +00:00
christos b7cb52a381 for pt_syscall, send a signal to our parent, not out grandparent. Noted by
mrg and ad.
2006-11-13 02:52:08 +00:00
yamt caa14e011b kill signal "dolock" hacks.
related to PR/32962 and PR/34895.  reviewed by matthew green.
2006-11-01 09:46:14 +00:00
christos d165928f40 check for negative length in PT_COREDUMP (from Neil) 2006-10-28 17:58:22 +00:00
christos 7bce0c7216 Don't allow ptrace to copyout arbitrary sized data. Reported by the
Suresec vulnerability research team.
2006-10-15 15:20:09 +00:00
matt bb97e7087b process_domem exists for ktrace/ptrace/systrace 2006-09-01 21:05:33 +00:00
dogcow 5d399ea343 process_stoptrace is also used by PTRACE; fixes INSTALL_SMALL, GENERIC_TINY,
et al, where KTRACE isn't defined but PTRACE is.
2006-08-31 18:05:21 +00:00
cube c09480be6c Let those compile under "no options COREDUMP". 2006-08-30 13:55:03 +00:00
matt 583998d384 sys_process.c is also used by KTRACE. 2006-08-30 11:08:15 +00:00
matt 1f5dae8a54 #include "opt_ptrace.h" 2006-08-30 10:17:49 +00:00
matt 9e0ec4816e Make PTRACE and COREDUMP optional. Make the default (status quo) by putting
them in conf/std.
2006-08-29 23:34:48 +00:00
ad f474dceb13 Use the LWP cached credentials where sane. 2006-07-23 22:06:03 +00:00
elad 215bd95ba4 integrate kauth. 2006-05-14 21:15:11 +00:00
christos 46c0b8e98a PR/26804: Jason Thorpe: Make PT_DUMPCORE require the process to be PT_ATTACH'ed
first so that it is stopped and there are no races.
2006-04-01 22:34:00 +00:00
thorpej a2b6f1b10c Wrap calls to (*e_syscall_intern)() in __HAVE_SYSCALL_INTERN. Fixes
VAX build.
2006-03-07 07:19:44 +00:00
christos 81b9ed737b Move ISSET/SET/CLR macros to sys/types.h 2006-03-05 16:57:16 +00:00
christos a4495f4cec implement PT_SYSCALL 2006-03-05 07:21:37 +00:00
yamt ec5a93183a merge yamt-uio_vmspace branch.
- use vmspace rather than proc or lwp where appropriate.
  the latter is more natural to specify an address space.
  (and less likely to be abused for random purposes.)
- fix a swdmover race.
2006-03-01 12:38:10 +00:00
christos 95e1ffb156 merge ktrace-lwp. 2005-12-11 12:16:03 +00:00
thorpej b8352211cd Use ANSI function decls. 2005-12-07 05:53:24 +00:00
perry da8abec863 nuke trailing whitespace 2005-02-26 21:34:55 +00:00
christos 4bfe82cbac Flip the order of two lines I mixed. Thanks to wiz for noticing. 2005-01-09 20:25:26 +00:00
christos 82ee9647b8 Allow PT_DUMPCORE to specify the core filename. 2005-01-09 19:22:55 +00:00
skrll f7155e40f6 There's no need to pass a proc value when using UIO_SYSSPACE with
vn_rdwr(9) and uiomove(9).

OK'd by Jason Thorpe
2004-09-17 14:11:20 +00:00
christos 0fe4a0b07a Don't check for negative offset in the memory case. 64 bit addresses can
have the high bit set, and thus be interpreted as negative offsets. This
is not a problem because uvm_io() does all the range checks.
2004-06-22 02:06:55 +00:00
christos 19c4641ff8 (off_t)(long) is wrong when it comes to kernel addresses [because on a 32 bit
machine if the high bit is set they turn negative]. Make an intermediate cast
to unsigned long.
2004-05-26 16:28:05 +00:00
christos d3f7c2a23c Check for bad offsets at the beginning of the functions to save processing.
Idea from OpenBSD.
2004-05-14 16:36:33 +00:00
pk b2260877bf proc_reparent() must be called with proclist write lock held. Make it so. 2004-05-04 21:58:47 +00:00
pk 2fb3dac280 Since a `vmspace' always includes a `vm_map' we can re-use vm_map's
reference count lock to also protect the vmspace's reference count.
2004-05-04 21:33:40 +00:00
matt 879040549d Only do the pmap_procwr if the uvm_io succeeded. 2004-03-13 18:43:18 +00:00
dsl 2ffbd2ab99 Remove p_nras from struct proc - use LIST_EMPTY(&p->p_raslist) instead.
Remove p_raslock and rename p_lwplock p_lock (one lock is enough).
Simplify window test when adding a ras and correct test on VM_MAXUSER_ADDRESS.
Avoid unpredictable branch in i386 locore.S
(pad fields left in struct proc to avoid kernel bump)
2003-11-04 10:33:15 +00:00
agc aad01611e7 Move UCB-licensed code from 4-clause to 3-clause licence.
Patches provided by Joel Baker in PR 22364, verified by myself.
2003-08-07 16:26:28 +00:00
fvdl d5aece61d6 Back out the lwp/ktrace changes. They contained a lot of colateral damage,
and need to be examined and discussed more.
2003-06-29 22:28:00 +00:00
darrenr 960df3c8d1 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
2003-06-28 14:20:43 +00:00