Commit Graph

5304 Commits

Author SHA1 Message Date
dogcow
66b89c08f2 die, caddr_t, die. 2007-03-05 04:59:19 +00:00
mrg
3a04ec414c change an error message from:
Mutex error: sched_unlock_idle: sched_unlock_idle
to
	Mutex error: sched_unlock_idle: sched_mutex not locked
2007-03-04 21:06:13 +00:00
ad
681b77eb72 lwp_userret: if the process is exiting, don't bother looking for signals. 2007-03-04 20:59:00 +00:00
yamt
95ef0a2720 fix a fallout from caddr_t changes. 2007-03-04 14:33:57 +00:00
christos
2058fdeab3 add a lockpanic function that prints more detailed error messages. 2007-03-04 06:20:25 +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
itohy
d2585a8c91 Remove extra space so that symbol renaming works properly. 2007-03-03 10:08:18 +00:00
ad
61a2eec6c3 _lwp_wakeup: set the cancellation pending if the LWP is not sleeping. 2007-03-02 21:06:27 +00:00
ad
4cbc498383 sys__lwp_park: explicitly drop the kernel lock, for the benefit of compat32.
XXX The stack gap stuff is not MP or MT safe and needs to go away.
2007-03-02 16:14:37 +00:00
ad
8a9f592723 sys__lwp_park: on a !MULTIPROCESSOR kernel the LWP is already locked. 2007-03-02 16:09:53 +00:00
itohy
cdbe0f0296 kern_mutex.c:190: macro `MUTEX_RECEIVE' used without args
kern_mutex.c:199: macro `MUTEX_RECEIVE' used without args
kern_mutex.c:206: macro `MUTEX_GIVE' used without args
2007-03-02 13:14:12 +00:00
yamt
6d6b100a95 kmem_backend_alloc: fix a null dereference. 2007-03-02 12:30:53 +00:00
martin
dd8b45ebc6 Split the disklabel checksum function into two, so we can pass the
length separately.
Use this for foreign-endianess labels in wedge autodiscovery, and
calculate the checksum of those before we swap various fields in the
label.
2007-03-01 21:30:50 +00:00
ad
0bffc80584 Fix a couple of races with LWP park/unpark. 2007-03-01 14:55:06 +00:00
pooka
f7ed04a6ff simplify previous a bit. no functional change. 2007-03-01 10:02:31 +00:00
pooka
428270cc03 avoid lock leak in error branch of sys_fchdir()
thanks to Tom Spindler and Greg Oster in helping find the cure
2007-02-28 20:39:06 +00:00
ad
a76d1d298c Further avoid unnecessary trips through lwp_userret()/issignal(). 2007-02-27 15:19:54 +00:00
yamt
c574bfa378 typedef pri_t and use it instead of int and u_char. 2007-02-27 15:07:28 +00:00
ad
72b15048da turnstile_wakeup(): on a !MULTIPROCESSOR kernel the LWP is already locked. 2007-02-27 12:17:55 +00:00
ad
cbe547e6a7 - Nuke mutex_owner()
- mutex_getowner() -> mutex_owner()
2007-02-26 19:11:28 +00:00
ad
f944608c11 Add a comment. 2007-02-26 19:06:10 +00:00
drochner
b68dbc6775 regen 2007-02-26 12:20:03 +00:00
drochner
8b8213b508 sync with lwp.h: _lwp_unpark_all() returns ssize_t 2007-02-26 12:19:00 +00:00
yamt
e781af39bd implement priority inheritance. 2007-02-26 09:20:52 +00:00
christos
2a84b2c2c1 Revert the kauth_impl.h change. Elad is going to maintain this. Asked by core@ 2007-02-24 20:41:33 +00:00
ad
9501d652a0 setrunnable(): don't require that sleeps be interruptable. This breaks
smbfs. Fixes PR/35787.
2007-02-23 16:51:47 +00:00
thorpej
4f3d5a9cc0 TRUE -> true, FALSE -> false 2007-02-22 06:34:42 +00:00
matt
93feeb1203 Fix lossage from boolean_t -> bool and updated x86 bus_dma. 2007-02-22 04:38:02 +00:00
thorpej
dd962f8680 Pick up some additional files that were missed before due to conflicts
with newlock2 merge:

Replace the Mach-derived boolean_t type with the C99 bool type.  A
future commit will replace use of TRUE and FALSE with true and false.
2007-02-21 23:48:10 +00:00
thorpej
712239e366 Replace the Mach-derived boolean_t type with the C99 bool type. A
future commit will replace use of TRUE and FALSE with true and false.
2007-02-21 22:59:35 +00:00
ad
67323d2552 When sending signals, only boost the priority of the receiving LWP if
the process is being killed.
2007-02-20 17:47:03 +00:00
ad
cebcfebbd2 kernel_lock():
- Fix error in previous.
- Call LOCKDEBUG_WANTLOCK() so the "exclusive wanted" count isn't off.
2007-02-20 16:10:10 +00:00
ad
723654a989 _kernel_lock(): we can recurse here if we take an interrupt while spinning.
Don't double book the time spent with lockstat.
2007-02-20 15:56:59 +00:00
dsl
1736f4ea10 Revert 'optimisation' added in rev 1.179.
On i386 (at least) gcc manages two generate two forwards branches which are not
usually taken for the old code, and one forwards branch that is usually taken
for my 'improved version'.  Since (IIRC) both athlon and P4 will predict
forwards branches 'not taken' the old code is likely to be faster :-(
Faster variants exist, especially ones using the cmov instruction.
2007-02-19 22:14:15 +00:00
cube
632ece3eaf Introduce a new member to struct emul, e_startlwp, to be used by
sys__lwp_create.  It allows using the said syscall under COMPAT_NETBSD32.

The libpthread regression tests now pass on amd64 and sparc64.
2007-02-19 15:10:02 +00:00
matt
44109561cb Convert to structure initializers. Use __arraycount 2007-02-18 23:16:59 +00:00
pooka
2da757310f if doing VOP_CREATE via sys_mknod, set va_rdev to VNOVAL instead of 0 2007-02-18 20:36:36 +00:00
pooka
2deb71d45f Support creating regular files with mknod(2) to match Linux/Solaris
behaviour.  This happens if mode contains S_IFREG.  mknod(2) is
still restricted to the superuser.

no objections from tech-kern
2007-02-18 19:57:29 +00:00
dsl
d64834e4f1 Add code to support per-system call statistics:
option SYSCALL_STATS	counts the number of times each system call is made
option SYSCALL_TIMES	counts the amount of time spent in each system call
Currently the counting hooks have only been added to the i386 system call
handler, and the time spent in interrupts is not subtracted.
It ought also be possible to add the times to the processes profiling
counters in order to get a more accurate user/system/interrupt split.
The counts themselves are readable via the sysctl interface.
2007-02-18 16:58:15 +00:00
dsl
ff6d800c8f Optimise canonicalisation of l_rtime for the case when the start and stop
times are in the same second.
2007-02-18 16:03:06 +00:00
dsl
6209b5bbf3 The pre-kauth 'struct ucread' and 'struct pcred' are now only used in the
(depracted some time ago) 'struct kinfo_proc' returned by sysctl.
Move the definitions to sys/syctl.h and rename in order to ensure all the
users are located.
2007-02-18 15:20:34 +00:00
dyoung
5493f188c7 KNF: de-__P, bzero -> memset, bcmp -> memcmp. Remove extraneous
parentheses in return statements.

Cosmetic: don't open-code TAILQ_FOREACH().

Cosmetic: change types of variables to avoid oodles of casts: in
   in6_src.c, avoid casts by changing several route_in6 pointers
   to struct route pointers.  Remove unnecessary casts to caddr_t
   elsewhere.

Pave the way for eliminating address family-specific route caches:
   soon, struct route will not embed a sockaddr, but it will hold
   a reference to an external sockaddr, instead.  We will set the
   destination sockaddr using rtcache_setdst().  (I created a stub
   for it, but it isn't used anywhere, yet.)  rtcache_free() will
   free the sockaddr.  I have extracted from rtcache_free() a helper
   subroutine, rtcache_clear().  rtcache_clear() will "forget" a
   cached route, but it will not forget the destination by releasing
   the sockaddr.  I use rtcache_clear() instead of rtcache_free()
   in rtcache_update(), because rtcache_update() is not supposed
   to forget the destination.

Constify:

   1 Introduce const accessor for route->ro_dst, rtcache_getdst().

   2 Constify the 'dst' argument to ifnet->if_output().  This
     led me to constify a lot of code called by output routines.

   3 Constify the sockaddr argument to protosw->pr_ctlinput.  This
     led me to constify a lot of code called by ctlinput routines.

   4 Introduce const macros for converting from a generic sockaddr
     to family-specific sockaddrs, e.g., sockaddr_in: satocsin6,
     satocsin, et cetera.
2007-02-17 22:34:07 +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
dsl
bcedbf7f41 Acquire proclist_lock in pgid_in_session() so we don't reference potentially
stale proc & pgrp pointers.
2007-02-17 21:46:13 +00:00
dsl
c8a3495cd1 Acquire proclist_lock across the p_find() and pg_find() calls while
processing FIOSETOWN and TIOCSPGRP ioctls.
2007-02-17 21:43:08 +00:00
hannken
198beb0314 Make fstrans(9) the default helper for file system suspension.
Replaces the now obsolete vn_start_write()/vn_finished_write().
2007-02-16 17:23:53 +00:00
ad
3363855a4a Remove spllowersoftclock() and CLKF_BASEPRI(), and always dispatch callouts
via a soft interrupt. In the near future, softclock will be run from process
context.
2007-02-16 02:53:43 +00:00
ad
57aa4fbf3b proc_free() was returning a NULL rusage pointer to wait() when a traced
process was reparented. Change proc_free() to copy the rusage to a buffer
on the stack if required, so it can be passed both to the debugger and
to the real parent process.

Fixes kern/35582 (kernel panics with gdb).
2007-02-16 00:39:16 +00:00
ad
a72414e44c lwp_free(): pass curlwp to KERNEL_LOCK(), not 'l'. 2007-02-16 00:35:45 +00:00
ad
2b011d2fa7 sigswitch(): don't blat the kernel_lock count that sleepq_block() saved
earlier.
2007-02-16 00:35:20 +00:00
ad
087fdb9080 Count the number of CPUs at boot and stash in 'ncpu'. Eventually should
have each CPU register at attach, so we can figure out the topology for
the scheduler.
2007-02-15 20:32:47 +00:00
ad
d91014721f Add uvm_kick_scheduler() (MP safe) to replace wakeup(&proc0). 2007-02-15 20:21:13 +00:00
ad
10a11a26b3 - Add a mutex_wakeup() which clears the waiters flag and wakes all waiters.
Will be needed to fix a problem with mutexes on sparc.
- mutex_tryenter(): fix a false "locking against myself" error.
2007-02-15 15:49:27 +00:00
ad
9abeea588a Replace some uses of lockmgr() / simplelocks. 2007-02-15 15:40:50 +00:00
ad
dc5c8ac21f Restore proc::p_userret in a limited way for Linux compat. XXX 2007-02-15 15:13:10 +00:00
yamt
d972f83ff5 sigswitch: fix a deadlock. 2007-02-15 15:10:44 +00:00
ad
d5bb4b3485 Remove some pointless !__NetBSD__ cases. 2007-02-15 15:08:59 +00:00
yamt
b8060d4382 newlwp: ensure not to assign lid 0. 2007-02-15 15:08:42 +00:00
yamt
0844695f78 unwrap short lines. 2007-02-11 15:41:53 +00:00
yamt
f39831ee99 workqueue_exit: update a comment. 2007-02-11 15:37:20 +00:00
yamt
be27733fd7 use cv_signal rather than cv_broadcast where appropriate. 2007-02-11 15:36:35 +00:00
yamt
8721382dee remove a duplicated inclusion of sleepq.h. 2007-02-11 14:29:01 +00:00
ad
6bcf70b518 - Add/correct comments.
- Print correct function name when an assertion triggers.
2007-02-10 21:07:52 +00:00
hannken
9c928583f1 newlock2: syncer_lock is now a mutex. 2007-02-10 15:51:02 +00:00
yamt
997a2a3c4f remove function prototypes of sa_awaken. 2007-02-10 14:02:01 +00:00
ad
2a34c11ab8 Regen. 2007-02-10 11:32:58 +00:00
ad
b6ab00c330 A quick hack to get things building again: put back the SA system calls
with no arguments, and alias them to sys_nosys. To be revisited.
2007-02-10 11:32:21 +00:00
ad
8f4adbff6b Regen. 2007-02-10 10:25:44 +00:00
ad
f7c038012b Fix arguments to _lwp_park/unpark/unpark_all to match userland. 2007-02-10 10:24:44 +00:00
ad
36d73dc21a Remove unused file. 2007-02-10 10:18:32 +00:00
christos
1735b4d5c0 avoid using struct proc in the perfctrs case, where the variable might
not be used.
2007-02-10 02:55:18 +00:00
ad
b07ec3fc38 Merge newlock2 to head. 2007-02-09 21:55:00 +00:00
elad
5a6bb5eba2 remove empty line 2007-02-08 16:06:58 +00:00
elad
24d02b5648 style nit 2007-02-08 00:26:50 +00:00
rmind
ea2709ce49 PR/28458: shmat(2) shmaddr argument is not honored as intended.
Patch applied, thanks for Minoura Makoto.

Please note, that one should fail if cannot attach to shmaddr,
but not attach it to other place.

OK by uwe@
2007-02-07 18:45:36 +00:00
elad
01b9a124ad - Properly autocreate tables,
- Properly track number of used slots in the table,
- Track number of "assocs" per entry.
2007-02-07 09:38:04 +00:00
elad
3d8c2eee5f Add comment referring to kvm_proc.c. 2007-02-07 08:04:48 +00:00
elad
119d4b5acd PR/35253: YAMAMOTO Takashi: fileassoc hash size problem
fileassoc_table_add() was removed from the KPI and made internal. From now
fileassoc(9) will manage the optimal table size internally.

Input from and okay yamt@.
2007-02-06 01:09:48 +00:00
rillig
ff925d7fe2 typo. 2007-02-05 14:34:29 +00:00
yamt
f6217feae5 kmem_alloc: fix a null dereference reported by Chuck Silvers. 2007-02-05 11:53:46 +00:00
elad
9ac600139e Initialize pathname_t objects to NULL. 2007-02-04 20:33:02 +00:00
chs
0507747213 more fixes for the new vnode locking scheme:
- don't use SAVESTART in calls to relookup() from unionfs,
   just vref() the desired vnode when we need to.
 - fix locking and refcounting in the unionfs EEXIST error cases.
 - release any vnode locks before calling VFS_ROOT(), vfs_busy() is enough.
   this allows us to simplify union_root() and fix PR 3006.
 - union_lock() doesn't handle shared lock requests correctly,
   so convert them to exclusive instead.  fixes PR 34775.
 - in relookup(), avoid reusing "dp" for different purposes,
   the error handling wasn't right.  (actually just get rid of dp.)
   also, change relookup() to ignore LOCKLEAF and always return the
   vnode locked since the callers already expect this.
2007-02-04 15:03:20 +00:00
cbiere
89165435c8 Avoid unnecessary cast in bufq_disksort_init(). 2007-02-01 00:36:37 +00:00
elad
85f515764b Fix notify only logic for credentials scope. Thanks ad@! 2007-01-31 16:30:09 +00:00
ad
f8ab9664c4 ffree(): don't call kauth_cred_free() with a held simplelock. 2007-01-31 16:00:43 +00:00
elad
c439bcfe43 Add a new scope, the credentials scope, which is internal to the kauth(9)
implementation and meant to be used by security models to hook credential
related operations (init, fork, copy, free -- hooked in kauth_cred_alloc(),
kauth_proc_fork(), kauth_cred_clone(), and kauth_cred_free(), respectively)
and document it.

Add specificdata to credentials, and routines to register/deregister new
"keys", as well as set/get routines. This allows security models to add
their own private data to a kauth_cred_t.

The above two, combined, allow security models to control inheritance of
their own private data in credentials which is a requirement for doing
stuff like, I dunno, capabilities?
2007-01-31 10:08:23 +00:00
elad
8b125f4fa5 PR/35524: Brian de Alwis: panic from free in pathname_get
Patch applied, thanks for the report!
2007-01-31 08:29:20 +00:00
hannken
4d607243ba Change fstrans enum types to upper case.
No functional change.

From Antti Kantee <pooka@netbsd.org>
2007-01-29 15:42:50 +00:00
elad
87352b7746 Add a comment to indicate the reason for kauth_init() and secmodel_start()
being where they are. Suggested by and okay christos@.
2007-01-27 22:54:58 +00:00
elad
d7cf9c93bb Start the security model sooner.
As with previous commit, we want to allow the secmodel code to control
the credential inheritance, etc., so we need it started earlier (also
before proc0_init()).
2007-01-27 01:13:10 +00:00
elad
3238d589b2 No need to include acct.h, sysctl.h, and time.h. 2007-01-26 23:50:36 +00:00
elad
4ee02bdcac Initialize kauth(9) sooner.
Since we'll soon want to be able to control the inheritance of credentials,
kauth(9) needs to be ready for use much sooner -- at least before the call
to proc0_init().
2007-01-26 21:57:47 +00:00
elad
4f9ade2efc Add missing specificdata_key_delete() in fileassoc_deregister(). 2007-01-26 12:36:46 +00:00
elad
fe9f141d4d Fix tyop in comment: specifidata -> specificdata. 2007-01-25 13:58:40 +00:00
elad
73a4d95bb6 Update comment: device -> mount. No functional change. 2007-01-25 13:57:28 +00:00
elad
317687e988 Don't rely on KAUTH_PROCESS_CANSEE for environment just yet,
otherwise we're allowing anyone to read the environment unless
curtain is enabled.

From yamt@.
2007-01-22 15:11:52 +00:00
elad
a78693aa19 Kill KAUTH_PROCESS_RESOURCE and just replace it with two actions for
nice and rlimit.
2007-01-20 16:47:38 +00:00
hannken
1b9c6382e3 New file system suspension API to replace vn_start_write and vn_finished_write.
The suspension helpers are now put into file system specific operations.
This means every file system not supporting these helpers cannot be suspended
and therefore snapshots are no longer possible.

Implemented for file systems of type ffs.

The new API is enabled on a kernel option NEWVNGATE.  This option is
not enabled by default in any kernel config.

Presented and discussed on tech-kern with much input from
Bill Studenmund <wrstuden@netbsd.org> and YAMAMOTO Takashi <yamt@netbsd.org>.

Welcome to 4.99.9 (new vfs op vfs_suspendctl).
2007-01-19 14:49:08 +00:00
elad
39714ce48b Oops - this should have gone in a long time ago.
Weak alias secmodel_start to a nop routine, for building without a secmodel
in the kernel.
2007-01-17 12:27:24 +00:00
elad
096a7f4744 Use KAUTH_ARG(). 2007-01-17 12:21:34 +00:00
dogcow
8f871f1a8d #include <sys/sa.h> to get sys_upcall_t def. 2007-01-16 20:12:40 +00:00
elad
f3cc348dad Introduce secmodel_register() and secmodel_deregister() (for now left
undocumented) and change logic in kauth_authorize_action() to only
allow an action if it wasn't explicitly allowed/denied and there are no
secmodels loaded.

Okay yamt@.
2007-01-16 11:51:22 +00:00
ad
d71c91cb2c Regen. 2007-01-16 05:29:54 +00:00
ad
606e323b3e Add sched_yield(). 2007-01-16 05:28:45 +00:00
ad
2ec3e26f21 Regen. 2007-01-16 01:32:52 +00:00
ad
b9b02583e6 Add prototypes for: _lwp_kill, _lwp_detach, _lwp_park, _lwp_unpark,
_lwp_unpark_all, sched_yield.
2007-01-16 01:30:45 +00:00
pooka
88f603fea0 TAILQ_INIT a mountpoint's vnode queue and always add vnodes to the
tail instead of an explicit check to add to the head for an empty
queue.  Apparently TAILQ_INSERT_HEAD happens to work for a
non-initialized head and does implicit initialization so that
TAILQ_INSERT_TAIL works after that.
2007-01-15 19:13:30 +00:00
elad
6df6f0ea65 Introduce kauth_proc_fork() to control credential inheritance. 2007-01-15 17:45:32 +00:00
elad
8ed50e44ae veriexec_file_delete() and veriexec_table_delete() now take 'struct lwp *'
too.
2007-01-11 16:24:47 +00:00
elad
4cc18ba6e8 Make 'veriexec_verbose' static. 2007-01-11 15:10:25 +00:00
enami
b840f8c9d7 Plug another memory leak in __sigtimedwait1() which is introduced
by rev. 1.208: free `waitset' and ksiginfo on success.
2007-01-10 07:58:27 +00:00
enami
93a9d5d355 Plug memory leak in __sigtimedwait1(): make sure to free `waitset'
on error return path.
2007-01-10 07:53:26 +00:00
elad
d2e4f7167b Remove advertising clause from all of my stuff. 2007-01-09 12:49:36 +00:00
pooka
38544312f7 update some comments for vnode locking smoergasbord change
amazing -- the description of VOP_LOOKUP is suddenly human-readable
2007-01-07 21:33:24 +00:00
pooka
fdac24081e Restore name caching behaviour accidentally removed in rev 1.73, using
variation suggested by yamt on tech-kern.

XXX: The exception is that this doesn't any longer prevent caching
of RENAME, which was implied in a weird weird way previously.  But
that's handled by the callers currently.
2007-01-07 20:43:59 +00:00
elad
cf9d4bd6af Update copyright/license, okay blymn@ few days ago. 2007-01-07 13:55:17 +00:00
christos
10fd1e8e3a one more cast. 2007-01-06 20:40:58 +00:00
christos
22f422dc10 register_t is unsigned on sparc/sparc64/sh5/powerpc. This produces warnings
on comparisons < 0, since they can never be true. All register_t's should
be made signed, and this commit should be reverted. For now cast to int,
since the syscall code is a small number and guaranteed to fit.
2007-01-06 20:38:15 +00:00
elad
ce903562f2 Use kauth(9). 2007-01-05 13:34:17 +00:00
elad
1e70d64818 Consistent usage of KAUTH_GENERIC_ISSUSER. 2007-01-04 16:55:29 +00:00
wrstuden
264b840ad9 Fix issue noted by Ilja van Sprundel and disclosed at 23C3.
Make sure we always FILE_UNUSE the file. To make it easier, exit
via a new "out:" exit path that does so, setting error beforehand.

Fix suggested by Elad, hand-typed by me.
2007-01-03 23:20:58 +00:00
elad
2a32293a9f Make more things static. From halflife. 2007-01-03 18:32:11 +00:00
elad
a13160f423 Make mount(2) and unmount(2) use kauth(9) for security policy.
Okay yamt@.
2007-01-02 10:47:28 +00:00
elad
c6e8423fec Make kauth_deregister_scope() and kauth_unlisten_scope() free the
passed kauth_scope_t and kauth_listener_t objects, respectively.

Okay yamt@.
2007-01-01 23:33:03 +00:00
pooka
b73e147d2c in rename_files(), match pre-1.280 locking behaviour by unlocking
fromnd's dvp only in case the dvp != vp
2007-01-01 22:00:16 +00:00
elad
0b96cfb817 Add back MNT_NOEXEC propagation on new mounts by non-root users.
Mistakenly removed in revision 1.286.
2007-01-01 20:45:51 +00:00
elad
8a4dd2d69d #if 0 -> #ifdef notyet, and no need to forward declare internal
data-structures anymore.
2006-12-31 12:07:16 +00:00
elad
b6a8425161 Enforce exclusive MNT_GETARGS in mount_getargs(). 2006-12-31 10:05:52 +00:00
elad
c5c6251521 Avoid TOCTOU in Veriexec by introducing veriexec_openchk() to enforce
the policy and using a single namei() call in vn_open().
2006-12-30 15:26:55 +00:00
elad
8657d4ffbb Veriexec should not explicitly allow anything (raw disk access). 2006-12-29 11:34:14 +00:00
yamt
88bbf6ee26 mount_domount: revive code to enforce MNT_NOSUID and MNT_NODEV for usermount,
which was removed mistakenly by rev.1.286.  pointed by elad.
2006-12-28 14:33:41 +00:00
chs
7645d04974 fix two more problems in the recent changes to lookup():
- don't hold the parent directory vnode locked while traversing mount points.
   the fs that's mounted might be an NFS served by a userland process
   like the automounter, which might need to traverse the parent directory
   in order to complete the lookup.
 - in the ENAMETOOLONG case fixed in rev. 1.75, set ni_dvp to dp
   since we've logically moved on to using "dp" as the parent.
   the caller will then handle vput()ing it as normal.
   this fixes PR 35279.
2006-12-27 23:21:02 +00:00
alc
a4ba78e89b CID-4197,4198: ensure that `fp' is not NULL before calling FILE_UNUSE()
ok christos@
2006-12-27 18:45:30 +00:00
yamt
c3ad9e4929 remove now unused vnode::v_lease. 2006-12-27 12:22:14 +00:00
yamt
ccfd2c0df0 remove nqnfs. 2006-12-27 12:10:09 +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
yamt
a8552e41ca mount_domount: don't forget to handle MNT_RDONLY.
PR/35327 from Christian Biere.
2006-12-27 08:55:35 +00:00
elad
74409752fc Fix copy/paste error: Veriexec's sysctl setup routine was named after
PaX's.
2006-12-26 19:31:33 +00:00
yamt
42489b9a68 - shorten the period to modify mnt_flag temporarily.
- desupport MNT_EXPORTED without MNT_UPDATE explicitly.
- fix a comment.
- unwrap short lines.
2006-12-26 12:39:01 +00:00
elad
504c71d9fe Make machdep scope architecture-agnostic by removing all arch-specific
requests and centralizing them all. The result is that some of these
are not used on some architectures, but the documentation was updated
to reflect that.
2006-12-26 10:43:43 +00:00
elad
8daca39031 Fix a comment. No functional change. 2006-12-26 08:55:32 +00:00
elad
ff39342b33 veriexec_lookup() should not return an internal data-structure, but rather
just a boolean value.
2006-12-26 07:50:40 +00:00
alc
9594e8adae CID-4284: check for 'kup != NULL' after kmem_zalloc() returns 2006-12-26 00:10:40 +00:00
elad
6be473ba20 Don't reference userspace pointers. 2006-12-25 22:03:42 +00:00
ad
9f07c24ec6 lockstat: improve reporting slightly, and fix a bug where the command
could spin while resorting lists.
2006-12-25 11:57:40 +00:00
elad
a44abdfff8 Properly handle flags in mount_domount(). 2006-12-25 08:11:52 +00:00
elad
97b434c554 Slash sys_mount() and add three helper functions: mount_update(),
mount_getargs(), and mount_domount() to handle three main things it can
do.

This makes the code more readable and removes the horrible goto mess
that was lurking there since forever... it also makes it easier to
implement a security policy for that code.
2006-12-24 12:43:17 +00:00
elad
1124b0b8bc PR/35278: YAMAMOTO Takashi: veriexec sometimes feeds user va to log(9)
Introduce the (intentionally undocumented) pathname_get(), pathname_path(),
and pathname_put(), to deal with allocating and copying of pathnames from
either kernel- or user-space.
2006-12-24 08:54:55 +00:00
elad
606687adb0 Use ndp->ni_cnd.cn_pnbuf, not epp->ep_ndp->ni_dirp, for the pathname
for Veriexec/PaX purposes.

(this is safe here because the nameiop is LOOKUP.)

Fixes part of PR/35278.
2006-12-23 17:23:51 +00:00
ad
384215762e lwp_update_creds(): acquire the kernel lock to avoid potential deadlock. 2006-12-23 08:39:47 +00:00