Commit Graph

7532 Commits

Author SHA1 Message Date
jnemeth fd3014ea71 if autoloading check for a noautoload=true property and if found,
deny the autoload
2010-11-18 09:50:47 +00:00
pooka b991c38551 Skip one extra function in the rump syscall local path and use
sy_call() directly from rump_syscalls.c.
2010-11-17 21:47:11 +00:00
dholland 06a95d4af1 typo in comment 2010-11-17 20:07:50 +00:00
dyoung 64f588a45a Fix a bug in ptcread() that stopped a pty(4) in TIOCPKT_IOCTL mode from
sending a termios(4) structure like it was supposed to: ptcread() used
to copy pti->pt_send and zero it before testing it for TIOCPKT_IOCTL.
Test for TIOCPKT_IOCTL in the pti->pt_send copy in local variable c
instead of in pti->pt_send itself.
2010-11-16 23:58:11 +00:00
pooka 0061495240 rump posix_fadvise() 2010-11-11 14:47:41 +00:00
yamt b31dca7b14 vclean: fix a bug which makes getcleanvnode always cause VOP_INACTIVE. 2010-11-11 13:58:58 +00:00
hannken c7919375e5 Change md(4) to:
- create md devices on first open and destroy on last close.
- add enough disk label support to make DIOCGDINFO and DIOCGPART work.
- add disk_busy()/disk_unbusy() instrumentation.

Ok: David Young <dyoung@netbsd.org>
2010-11-11 11:07:06 +00:00
hannken 897bf1dab0 Wapbl_register_deallocation(): the taken reader lock is not sufficient to
protect wl_dealloc* members.  Take the mutex here and change the lock
requirements of these fields to "writer lock or mutex".

This error lead to file system corruption and "freeing free block" panics.
2010-11-09 16:30:26 +00:00
pooka c099830b29 Create rump_syscalls.c in two flavours: one which can be compiled
standalone as the clientside and one which expects to be compiled
into the rump kernel.
2010-11-04 20:50:29 +00:00
pooka 3c0f9a592b apply "shut up, lint" for syscallargs.h 2010-11-04 17:02:34 +00:00
dyoung ac87baf848 usb_port.h was deleted, no need to skip it when computing tags. 2010-11-04 03:15:50 +00:00
pooka 37653ea90a KASSERT we don't kpause indefinitely without interruptability.
XXX: using timo == 0 to mean "sleep as long as you like, and forever
if you're really tired" is not the smartest interface considering
the the hz/n idiom used to specify timo.  This leads to unwanted
behaviour when hz gets below some impossible-to-know limit.  With
a usec2ticks() routine it at least be a little more tolerable.
2010-11-02 15:17:37 +00:00
pooka 7d421d6903 Don't sleep forever if hz < 25.
from Alessandro Forin
2010-11-02 15:09:52 +00:00
pooka 8553c5887b Align comment column in output, no functional change. 2010-11-01 16:21:29 +00:00
pooka 41a10084d4 Attach implicit threads to initproc instead of proc0. This way
applications which alter, by purpose or by accident, the uid in an
implicit thread are don't affect kernel threads.

from discussion with njoly
2010-10-29 15:32:23 +00:00
pooka ff08ca3b05 Zero entire stat structure before filling in contents to avoid
leaking kernel memory -- the elements are no longer packed now that
dev_t is 64bit.

from pgoyette
2010-10-28 20:32:45 +00:00
seanb 49025bce19 Always use m_split() in m_copyback() instead of its
local, abridged, version.  This closes a window where
a new mbuf (n) can be inserted where n->m_next == n.
2010-10-28 14:21:50 +00:00
rmind 366aa69d08 do_posix_fadvise: check for a negative length; truncate the offset and
round the end-offset, not vice-versa.

Thanks to jakllsch@ for debug info.
2010-10-27 02:58:04 +00:00
yamt 65656eb8a2 unp_connect: fix an assertion 2010-10-21 11:14:39 +00:00
yamt 6c0992266e unp_connect2: fix a comment. 2010-10-21 11:13:43 +00:00
chs 596908f5cf when using ktrace format version 0 or 1, don't adjust the changed fields
in ktealloc(), since we do the same adjustment later in ktrwrite().
also, remove an unused variable in ktr_csw().
2010-10-18 00:09:13 +00:00
pgoyette 1e25563ccb Remove double-inclusion of <sys/kauth.c> 2010-10-16 18:09:02 +00:00
rmind 0698446b8c Re-enable direct select. 2010-10-15 05:39:19 +00:00
oki e3731ae5b2 Wait for freeing mbuf cluster in sosend() causes freeze network stack.
Don't wait for it.
problem was found by iij seil team.
it is similar to OpenBSD uipc_socket.c rev.1.72.
2010-10-14 03:07:51 +00:00
mrg 3eca36b665 add some (uint64_t) casts so avoid 32 bit overflows. this fixes my
3TB disk with 4KB sectors and disklabel (which looks like it would
work upto 16TB.)

idea from mlelstv@.
2010-10-14 00:47:16 +00:00
chs 79f3dfff82 when we use a fake data section, make sure that the start is page-aligned. 2010-10-07 02:14:02 +00:00
matt 19e6c76b2d Rename rb.h to rbtree.h, as it is more appropriate (c.f. ptree.h). Also
helps find code that hasn't been updated to use the new rbtree API.
2010-09-25 01:42:38 +00:00
rmind 879d5dfb5e Fixes/improvements to RB-tree implementation:
1. Fix inverted node order, so that negative value from comparison operator
   would represent lower (left) node, and positive - higher (right) node.
2. Add an argument (i.e. "context"), passed to comparison operators.
3. Change rb_tree_insert_node() to return a node - either inserted one or
   already existing one.
4. Amend the interface to manipulate the actual object, instead of the
   rb_node (in a similar way as Patricia-tree interface does).
5. Update all RB-tree users accordingly.

XXX: Perhaps rename rb.h to rbtree.h, since cleaning-up..

1-3 address the PR/43488 by Jeremy Huddleston.

Passes RB-tree regression tests.
Reviewed by: matt@, christos@
2010-09-24 22:51:50 +00:00
chs 38b9dc3505 implement O_DIRECTORY as standardized in POSIX-2008,
for both native and linux emulations.
this fixes the rest of PR 43695.
2010-09-21 19:26:18 +00:00
drochner 29d1b2938d improve "const" consistency 2010-09-12 16:06:08 +00:00
chs 590b90699b always supply an auxiliary vector for linux ELF processes.
static executables (such as newer versions of /sbin/ldconfig)
require this to work properly.  since static executables
also don't have a PT_PHDR entry, use the same heuristic as
linux does to provide a value for AT_PHDR in this case.
2010-09-11 20:49:28 +00:00
drochner 51b3e42a8d make list traversing in knote() safe against removal of the entry
while the loop body is executed -- at least in the EVFILT_PROC / exit
case a race condition exists which can cause this
fixes a panic triggered eg by tests/kernel/kqueue/proc1
2010-09-10 10:23:46 +00:00
drochner 3ebe07497e fix two bugs reported by Ryo Shimizu:
-wrong initialization reported in a followup to PR bin/43336
 (looks harmless because it applies to zero-initialized memory, so
 LIST_INIT() is a no-op)
-wrong loop count in reply misses a hash bucket (PR kern/43827)
 (this was introduced by a post-netbsd-5 change, so it isn't related
 to the PR above)
2010-09-10 10:14:55 +00:00
joerg b5e51c26bb Remember the end of the last text segment and set up a fake data segment
if size 0 and starting after the text segments, if no data segment was
found. Unbreaks sbrk on platforms where all loaded segments are
executable (PR 43817). The cast of executable segments after data
segments is left out for now.
2010-09-07 21:32:03 +00:00
pooka 0d2a7de3b6 getcwd for rump 2010-09-07 17:10:08 +00:00
pooka a50c905497 rump umask 2010-09-06 20:00:09 +00:00
dyoung c3438d26de Cosmetic: remove unnecessary parenthesization in return statements.
Don't "test truth" of ints, but compare with 0, instead.

The generated assembly is the same before & after this change.
2010-09-05 18:03:37 +00:00
pooka 0af65acdc5 Actually, the comment probably meant "would be nice to KASSERT here,
but can't".  So turn it into a KASSERT now that it's possible.
2010-09-01 15:15:18 +00:00
pooka 8411fe4cea Remove XXX comment. I'm not sure what it precisely means, but I'm
guessing it's from a time when rump used filedesc0 for everything
(and that isn't true anymore).
2010-09-01 15:12:16 +00:00
pooka 72a4517ea3 regen: rump syscalls for kern_prot interfaces 2010-08-30 10:34:51 +00:00
pooka 16e1cb0b60 RUMP syscalls for kern_prot.c interfaces 2010-08-30 10:32:54 +00:00
pooka 195f9ac9fd remove trailing empty line. no useful change. 2010-08-30 10:30:01 +00:00
pooka 9a611a11e0 Empty commit to show makesyscalls.sh rev 1.99 didn't change anything (yet). 2010-08-30 10:24:42 +00:00
pooka 5c6beee9f6 Use the generally more useful funcalias for rump syscalls. 2010-08-30 10:24:04 +00:00
pooka aeb7e802ec I'm not even going to describe this change. I'll just say that
churn creates interesting code.

Fixes open(O_CREAT|O_TRUNC) on at least tmpfs and nfs to not fail
with ENOENT due to a racy removal of the newly created file.

Caught, as most bugs these days are, by a test run.
2010-08-25 13:51:50 +00:00
christos 6a6858c912 Fix issues with stack allocation and pax aslr:
- since the size is unsigned, don't check just that it is > 0, but limit
  it to the MAXSSIZ
- if the stack size is reduced because of aslr, make sure we reduce the
  actual allocation by the same size so that the size does not wrap around.
NB: Must be pulled up to 5.x!
2010-08-23 20:53:08 +00:00
pgoyette 23d5409e7e Update the rest of the kernel to conform to the module subsystem's new
locking protocol.
2010-08-21 13:19:39 +00:00
pgoyette 4a743ad47d Define a set of new kernel locking primitives to implement the recursive
kernconfig_mutex.  Update module subsystem to use this mutex rather than
its own internal (non-recursive) mutex.  Make module_autoload() do its
own locking to be consistent with the rest of the module_xxx() calls.
Update module(9) man page appropriately.

As discussed on tech-kern over the last few weeks.

Welcome to NetBSD 5.99.39 !
2010-08-21 13:17:31 +00:00
joerg e84862bd9b Allow ELF objects with more than two PT_LOAD sections. Go creates such
binaries by default with separate sections for executable, writeable
data and constants. Use the same heuristic as FreeBSD to match up the
text and data segment assumptions.
2010-08-20 14:59:53 +00:00
hannken 863afee91a Now that ffs on disk inodes get freed in the reclaim routine it is no longer
necessary for vget() to handle VI_INACTNOW as a special case.  Remove this
check and its support in vrelel().

Getting another reference while the freelist is locked is an error.  Replace
the check with a KASSERT.
2010-08-17 13:17:47 +00:00