Commit Graph

4977 Commits

Author SHA1 Message Date
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
yamt 86a24f7e0c - remove an unnecessary #include.
- make some variables static.
2006-11-01 09:36:28 +00:00
yamt 60392d9383 kill sched_psignal.
related to PR/32962 and PR/34895.  reviewed by matthew green.
2006-11-01 09:33:45 +00:00
yamt dd706203e4 mi_switch: move rlimit and autonice handling out of sched_lock in order to
simplify locking.
related to PR/32962 and PR/34895.  reviewed by matthew green.
2006-11-01 09:32:52 +00:00
mjf a2be0ed655 Revert the changes I introduced trying to solve tmpfs' NFS export problem.
Requested by yamt@
2006-10-31 08:12:46 +00:00
elad 52d8744717 Use integers, not pointers to integers, for KAUTH_REQ_NETWORK_SOCKET_OPEN.
Reminded by yamt@, thanks!
2006-10-30 16:53:48 +00:00
elad ff7c31739a Use consistent logging messages. 2006-10-30 11:29:12 +00:00
christos ce42f55037 add the emulation in kinfo_proc2 2006-10-29 22:34:07 +00:00
christos d165928f40 check for negative length in PT_COREDUMP (from Neil) 2006-10-28 17:58:22 +00:00
elad 066e9189c4 Adapt to changes suggested by yamt@ to get rid of __UNCONST() stuff.
While here, don't leak pathbuf on success.
2006-10-28 11:43:45 +00:00
mrg 8f3077c34d avoid allocating from ksiginfo_pool when we know we aren't going to
use it.  idea partly from yamt.  assert SCHED_ASSERT_UNLOCKED() in
all the places we call ksiginfo_queue() without a ksiginfo.

fixes recent panics detected by LOCKDEBUG.
2006-10-28 08:09:31 +00:00
elad 145a8382e1 Don't leak handle. 2006-10-27 22:17:09 +00:00
christos 31a62606ea Merge kernel and userland rmd160 and sha2 implementation.
XXX: We still install rmd160.h and sha2.h in /usr/include/crypto, unlike
the other hash functions which get installed in /usr/include for compatibility.
2006-10-27 21:20:48 +00:00
elad 52bab3d8ab Don't allocate MAXPATHLEN on the stack.
Prompted by and initial diff okay yamt@
2006-10-27 20:16:10 +00:00
yamt 17685f3fdc vmem: use correct function names for ASSERT_SLEEPABLE. 2006-10-27 15:05:16 +00:00
thorpej 1342c5a275 Use prop_dictionary_set_int32() to set the error number. 2006-10-26 05:08:01 +00:00
elad adf8d7aab2 Introduce KAUTH_REQ_NETWORK_SOCKET_OPEN, to check if opening a socket is
allowed. It takes three int * arguments indicating domain, type, and
protocol. Replace previous KAUTH_REQ_NETWORK_SOCKET_RAWSOCK with it (but
keep it still).

Places that used to explicitly check for privileged context now don't
need it anymore, so I replaced these with XXX comment indiacting it for
future reference.

Documented and updated examples as well.
2006-10-25 22:49:22 +00:00
cbiere 9e6aff1165 Added missing whitespace in sysctl description string. PR kern/34915. 2006-10-25 20:55:11 +00:00
christos 5ce26ddf80 enable namecache enter reverse for linux procfs lookups.
XXX: how expensive is that?
2006-10-25 18:56:38 +00:00
christos 1b7ad03044 Defer the vnode test for directory until after the cache lookup. This makes
getcwd work with plain files too, if we allow plain files in the vnode->name
cache.
2006-10-25 18:55:49 +00:00
jmmv 133d7c5ba4 Add a function (ksyms_init_explicit) to add a symbol table when we know the
exact address of the symtab and strtab ELF sections contents beforehand.

This will be used in i386's Multiboot code to add the initial kernel ksyms
without having to prepare a minimal ELF image that matches the format
expected by the reguluar ksyms_init function.

This part was reviewed by cube@ and successfully passes a full i386 release
build.
2006-10-25 13:46:36 +00:00
thorpej 3c6ae35ab2 - Add a new disk ioctl (DIOCGDISKINFO) to get the disk-info dictionary
for the disk.
- Add a new function, disk_ioctl(), that does generic disk ioctl handling.
  DIOCGDISKINFO is handled here now, and others will be added in the future.
- In the wd driver, fill in the dk_info member of struct disk and use the
  new disk_ioctl() function.
2006-10-25 04:04:45 +00:00
elad 2d8eaf9b86 Various cleanups.
Make some "#ifdef DIAGNOSTIC" blocks always compiled in; others
convert to KASSERT() where appropriate.

Add some sanity checks and comments while here.
2006-10-24 22:38:41 +00:00
mjf 84bd46b9f9 Add support to allow a file system to not permit being exported over NFS.
Approved by elad@ and wrstuden@
2006-10-24 21:53:10 +00:00
hannken 8ea60a7f23 Remove specificdata_setspecific_nowait() as result of discussion on tech-kern.
Add _lwp_getspecific_by_lwp() to get lwp specific data from other lwp's.
Protected by #ifdef _LWP_API_PRIVATE.

Approved by: Jason Thorpe <thorpej@netbsd.org>
2006-10-24 10:05:45 +00:00
yamt 5239dc5a67 qc_init: fix a problem introduced by rev.1.13.
namely, use quantum-size alignment rather than no alignment.
PR/34879 from Peter Postma.
2006-10-23 13:36:33 +00:00
elad c2da5d160e PR/34873: Ryo Shimizu: sendmsg() can cause kernel panic
Patch applied, thanks!
2006-10-23 10:37:22 +00:00
mrg a37172bb09 avoid a problem in kpsignal2() holding sched_lock while wanting to call
pool_get().  pre-allocate the ksiginfo_t before taking sched_lock and
use it if necessary, or freeing it if it is unused.

rename ksiginfo_{get,put}() to ksiginfo_{dequeue,queue}() (idea from chuq.)


this fixes PR#32962.  thanks to christos, chuq and go for help/ideas.
2006-10-22 20:48:45 +00:00
christos 8c71201d08 make ktruser enforce the maximum buffer length, and return an error. 2006-10-22 18:19:49 +00:00
pooka 96d8335980 kauth_cred_uucvt() -> kauth_uucred_to_cred(), introduce kauth_cred_to_uucred()
per tech-kern proposal
2006-10-22 13:07:15 +00:00
elad 54c1c4a4dc Remove todo that has been documented for a long time now. 2006-10-22 10:37:19 +00:00
yamt 982b4f66e8 remove a todo which has been done. 2006-10-22 10:19:25 +00:00
yamt 0d14f90ef6 qc_init: when initializing pools, use align==1 (ie. no alignment)
rather than align==0, which is converted to ALIGN(1) by pool_init.
2006-10-22 09:42:30 +00:00
mrg 7a4c53719e avoid yet another GCC warning only exposed at -O3. 2006-10-22 00:48:14 +00:00
pooka e2d2f0dc15 pool_get(): use PR_WAITOK, not M_WAITOK (which happens to be PR_NOWAIT ..)
XXX: not the first time this mistake has been made
2006-10-21 17:01:56 +00:00
kardel d094ff8f40 Avoid printf() the selected timecounter as it is called in the path of hardclock().
The information is available via sysctl anyway.
2006-10-21 07:16:54 +00:00
elad a5d447aee5 Add an XXX to remind me why it's there when grepping. (securelevel ref) 2006-10-20 22:22:48 +00:00
reinoud 19cb20fb7b Back out TAILQ_FOREACH in the vflush() since vgone() and vclean() are
called, the TAILQ_NEXT() derefers 0xdeadbeef....

Implemented again using an explicit `for' loop that keep the next pointer
available.
2006-10-20 20:29:52 +00:00
reinoud 0ce809091d Replace the LIST structure mp->mnt_vnodelist to a TAILQ structure since all
vnodes were synced and processed backwards. This meant that the last
accessed node was processed first and the earlierst last.

An extra benefit is the removal of the ugly hack from the Berkly days on
LFS.

In the proces, i've also replaced the various variations hand written loops
by the TAILQ_FOREACH() macro's.
2006-10-20 18:58:12 +00:00
dogcow 372e6ef309 now that we have -Wno-unused-parameter, back out all the tremendously ugly
code to gratuitously access said parameters.
2006-10-17 18:21:29 +00:00
christos 45e2a30296 regen 2006-10-17 15:07:21 +00:00
christos 152eb5a9c3 according to the manual, the last argument of quotactl(2) is a void *,
not a caddr_t.
2006-10-17 15:06:18 +00:00
yamt 04d4eff807 vmem_alloc: use __unused rather than a cryptic
"do { if (&strat) {} } while (/* CONSTCOND */ 0);"
2006-10-17 08:54:03 +00:00
christos b83d29dc81 with the introduction of 512 byte buffers, the index in the array is not
the number of kilobytes anymore, so name the pools appropriately.
2006-10-16 16:50:12 +00:00
dogcow 3e1f2a8ad1 another day, another __unused sprinkle. 2006-10-16 16:05:34 +00:00
yamt 44923ac48a implement vmem_xalloc/xfree.
XXX importing needs some more thoughts.
2006-10-16 13:09:42 +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
dogcow 2023789a40 More -Wunused fallout. sprinkle __unused when possible; otherwise, use the
do { if (&x) {} } while (/* CONSTCOND */ 0);
construct as suggested by uwe in <20061012224845.GA9449@snark.ptc.spbu.ru>.
2006-10-13 16:53:35 +00:00
thorpej 435147e718 Add __unused as necessary. 2006-10-12 04:29:37 +00:00
christos 4d595fd7b1 - sprinkle __unused on function decls.
- fix a couple of unused bugs
- no more -Wno-unused for i386
2006-10-12 01:30:41 +00:00