Commit Graph

9164 Commits

Author SHA1 Message Date
riastradh
2ade1483d8 Omit unused rndsource `anonymous'. 2015-04-14 12:35:44 +00:00
riastradh
a8379f86d8 Remove null pointer dereference in the code that never worked before... 2015-04-14 12:33:53 +00:00
riastradh
81b1249fe7 Eliminate remaining cases of u_int*_t in kern_rndq.c. 2015-04-14 12:28:12 +00:00
riastradh
0ea00109fe Use binuptime, not microtime/nanotime as substitute cycle counter. 2015-04-14 12:25:41 +00:00
riastradh
4168fc3b21 Need only <sys/rndsource.h>, not <sys/rnd.h>.
Made this change yesterday, failed to commit it -- sorry!
2015-04-14 12:18:37 +00:00
riastradh
e745693cd3 Fix comment. 2015-04-14 11:59:40 +00:00
nat
f8711ef41c Include sys/rndsource.h for rnd_add_data. 2015-04-14 06:08:03 +00:00
nat
670b6b94fb Fix typo expliict -> explicit. 2015-04-14 06:04:47 +00:00
riastradh
29441b529f Use explicit_memset. 2015-04-13 23:26:54 +00:00
riastradh
de226a3996 Omit needless declaration. 2015-04-13 23:25:14 +00:00
riastradh
ec7e76164f Cull another unused rndpool routine. 2015-04-13 23:24:33 +00:00
riastradh
989cc81cf0 Cull some unused rndpool routines. 2015-04-13 23:21:03 +00:00
riastradh
5c5f06b858 More rnd.h user cleanup. 2015-04-13 22:43:41 +00:00
riastradh
67d6ba47fb Convert remaining MI <sys/rnd.h> stragglers. Many MD ones left. 2015-04-13 16:46:33 +00:00
riastradh
d466a2e7ea <sys/rnd.h> -> <sys/rndsource.h> in kern_todr.c. 2015-04-13 16:36:54 +00:00
riastradh
480305b5e5 <sys/rnd.h> not needed for kern_pax.c. 2015-04-13 16:36:12 +00:00
riastradh
cff1e35637 Little rnd.h cleanup.
- Make rnd_printing static in kern_rndq.c.
- Merge some #ifdef _KERNEL blocks.
- Fix comments about RND_DEV_(U)RANDOM.
- Move rnd_ready to rnd_private.h.
2015-04-13 15:23:00 +00:00
riastradh
6f03865532 Gather rnd-private declarations into <dev/rnd_private.h>.
Let's try to avoid putting externs in .c files where the compiler
can't check them.
2015-04-13 15:13:50 +00:00
riastradh
2a2eccb11d Move rndpool_(maybe_)extract to rndq, rename to rnd_(try)extract.
Make rnd_extract_data static.
2015-04-13 14:41:06 +00:00
skrll
54e226a9c0 Trailing whitespace 2015-04-11 15:24:25 +00:00
skrll
0b03f807f3 Allow sleeping in the idle lwp if the cpu isn't running yet.
OK'ed by rmind a while ago.
2015-04-11 15:23:56 +00:00
riastradh
2b82c270f5 But rename(..., "x/..") is still supposed to yield EINVAL. Go figure. 2015-04-09 05:08:15 +00:00
riastradh
d0319a8396 Tests claim rename(..., "x/.") yields EISDIR, so do that. Fixes zfs. 2015-04-09 05:03:58 +00:00
riastradh
951f0df7f9 Fix a bit of indentation. 2015-04-08 14:13:55 +00:00
riastradh
2ed5dc64df Remove unnecessary, and actively wrong and harmful, locking.
Obviously this `enable callback' never actually worked, because it
would deadlock against itself as soon as you try it.
2015-04-08 14:11:21 +00:00
riastradh
127f4dd2aa Don't do broken lazy initialization. Just do it up front. 2015-04-08 14:08:49 +00:00
riastradh
353a30186d Gather (some) rnd_skew state into a cacheline-aligned static struct. 2015-04-08 14:04:47 +00:00
riastradh
b77937b61a Omit needless state. 2015-04-08 13:45:01 +00:00
justin
52d695cba4 Add __posix_rename as a rump syscall 2015-04-08 13:24:25 +00:00
riastradh
7fbc958f62 Don't read past the end of the sample buffer... (Seriously???) 2015-04-08 13:24:23 +00:00
riastradh
fa5b7b3ae0 Oops -- we already hold rndpool_mtx here. 2015-04-08 03:14:29 +00:00
riastradh
f32c5673ec Simplify logic to disable HWRNGs that fail rngtest.
- Mark them RND_FLAG_NO_COLLECT.
- Skip samples from sources marked RND_FLAG_NO_COLLECT.
- Don't ever call rnd_detach_source in softint context.
- Remove bogus use of cpu_softintr_p.

The call to rnd_detach_source in softint can't possibly have ever
worked: if the owner of the source ever tried to detach it by calling
rnd_detach_source again, it would LIST_REMOVE a removed element,
which is broken.
2015-04-08 03:00:31 +00:00
riastradh
de8edfa306 Name the simpleq of rnd_sample_t structure. 2015-04-08 02:52:25 +00:00
riastradh
12d3f8e076 Gather sample queue and lock into a static cacheline-aligned struct. 2015-04-08 02:49:03 +00:00
riastradh
6f2d8f443b Let's use the same lock for insertion and deletion, shall we? 2015-04-08 02:44:07 +00:00
riastradh
a310ced312 Reduce some indentation. 2015-04-08 02:35:33 +00:00
riastradh
47c873e3db Reduce #ifdef RND_VERBOSE clutter. 2015-04-08 02:32:26 +00:00
riastradh
1d838e408f Make rnd_extract_data_locked static. 2015-04-08 02:25:06 +00:00
rtr
ab64ace65a change return from EINVAL to EAFNOSUPPORT when the domain of the socket
does not match the family of the address to be bound.

fixes atf test lib/libc/sys/t_bind bind_foreign_family
2015-04-05 23:19:56 +00:00
rtr
9b6821f2d1 make bind() fail with EINVAL if the address family of the provided
socket does not match the address family of the sockaddr received.
2015-04-05 02:26:39 +00:00
rtr
a2ba5e69ab * change pr_bind to accept struct sockaddr * instead of struct mbuf *
* update protocol bind implementations to use/expect sockaddr *
  instead of mbuf *
* introduce sockaddr_big struct for storage of addr data passed via
  sys_bind; sockaddr_big is of sufficient size and alignment to
  accommodate all addr data sizes received.
* modify sys_bind to allocate sockaddr_big instead of using an mbuf.
* bump kernel version to 7.99.9 for change to pr_bind() parameter type.

Patch posted to tech-net@
  http://mail-index.netbsd.org/tech-net/2015/03/15/msg005004.html

The choice to use a new structure sockaddr_big has been retained since
changing sockaddr_storage size would lead to unnecessary ABI change. The
use of the new structure does not preclude future work that increases
the size of sockaddr_storage and at that time sockaddr_big may be
trivially replaced.

Tested by mrg@ and myself, discussed with rmind@, posted to tech-net@
2015-04-03 20:01:07 +00:00
riastradh
353f549b36 Back this out, per pooka's request. 2015-03-29 17:38:31 +00:00
riastradh
fb59c30429 Use #ifdef _RUMPKERNEL for now to prefer copyout over kcopy in tests.
Gross -- please fix me if you have a better approach.
2015-03-29 15:08:03 +00:00
riastradh
a1afb93b8e Back out previous.
It appears to be causing anita install to fail.  Evidently
VM_SPACE_IS_KERNEL_P(vm) is not mutually exclusive with `vm ==
curproc->p_vmspace' -- in particular, proc0's VM space is kernel.

Making this work in rump for tests will require another approach.
2015-03-29 15:05:34 +00:00
maxv
6e39240181 Remove the 'cred' argument from bread(). Remove a now unused var in
ffs_snapshot.c. Update the man page accordingly.

ok hannken@
2015-03-28 19:24:04 +00:00
maxv
bb338d5f26 Remove the 'cred' argument from breadn(), and update the man page
accordingly.

ok hannken@
2015-03-28 17:23:42 +00:00
maxv
4c5ff2135a Remove the 'cred' argument from bio_doread(). 2015-03-28 16:55:21 +00:00
riastradh
c287e76ea3 Swap kernel/curproc tests in copy*_vmspace so rump can catch EFAULT. 2015-03-28 16:13:38 +00:00
hikaru
638842f16d m_pullup() is called in rcvproc callback functions,
so nfs_boot_sendrecv() should keep track of the head of mbuf chain.
fixes kern/48746
2015-03-27 07:18:11 +00:00
maxv
06b89b30f2 Zero-fill the ELF auxiliary vectors. Otherwise, on 64bit systems, the
padding between a_v and a_type contains kernel garbage, therefore
exposed to userland.

Original report by uebayasi@
2015-03-20 20:36:27 +00:00
hannken
b01cc29bb1 Add new operation "vcache_new()" to allocate and initialise a new
vnode/fsnode pair:

int
vcache_new(struct mount *mp, struct vnode *dvp, struct vattr *vap,
    kauth_cred_t cred, struct vnode **vpp)

where dvp is the (referenced) directory where we want to create the
new node, vap passes va_type, va_mode and possibly va_rdev and cred
gives the credentials to setup uid/guid.

The node returned from vcache_new() is referenced, fully initialised
and has link count zero.

Welcome to NetBSD 7.99.7
2015-03-17 09:38:21 +00:00
christos
0c35262e73 regen 2015-03-12 15:06:28 +00:00
pooka
915977c5b0 The use of root_device is not limited to vfs, so don't supply it in
vfs_mount.c, use subr_device.c instead.

Fixes rump kernels built with DEBUG by again not making the base depend
on the vfs faction, as reported by Patrick Welche.
2015-03-09 15:35:11 +00:00
christos
fbf0dd3a6c Don't forget to assign the new rump variables. 2015-03-08 20:31:53 +00:00
christos
7f0c84f4d5 kill empty line 2015-03-08 17:49:08 +00:00
christos
0f17c35c22 Don't blindly tack ./ in front of the config file; breaks when we pass a full
path one.
2015-03-08 15:07:05 +00:00
christos
eb18a20a38 Fix thinko 2015-03-08 01:17:42 +00:00
christos
9eac063f05 Fix compilation. 2015-03-07 23:20:19 +00:00
christos
f5d435b863 regen 2015-03-07 21:50:30 +00:00
christos
76c1beaad7 make sure we print the fillers. 2015-03-07 21:49:56 +00:00
christos
04b614a265 regen 2015-03-07 20:40:00 +00:00
christos
b41c7e2da2 Use modern initializers, so we can skip the 0 ones. 2015-03-07 20:39:11 +00:00
christos
d1ef60ebe3 regen 2015-03-07 16:38:49 +00:00
christos
7678e81703 Adjust for systrace based on the FreeBSD code:
- create new file systrace_args.c that use used to convert the syscall
  arguments to an array, and functions that print the types of the
  entry and return arguments.
- call the systrace probe from the trace_enter and trace_exit functions
2015-03-07 16:38:07 +00:00
christos
811682d624 syscallnames are needed by dtrace 2015-03-07 16:35:37 +00:00
mrg
d64a5577d7 wait for config_mountroot threads to complete before we tell init it
can start up.  this solves the problem where a console device needs
mountroot to complete attaching, and must create wsdisplay0 before
init tries to open /dev/console.  fixes PR#49709.

XXX: pullup-7
2015-03-06 09:28:15 +00:00
rtr
9f8f228daa Return EINVAL if namelen isn't large enough to encompass the expected
members of sockaddr structures. i.e. sa_len and sa_family.

Discussed with and patch by christos@
2015-03-06 03:35:00 +00:00
christos
598d99601c put the exit code of the process in data, like FreeBSD does. 2015-03-02 19:24:53 +00:00
christos
e0e35c7751 PR/39918: ITOH Yasufumi: Replace KASSERT with continue, since the file
descriptor can be closed since closef() does not pay attention to FDEFER.
XXX: Pullup-7
2015-03-01 01:14:41 +00:00
jmcneill
3ee2227103 if the root file-system is not yet mounted, hide "vfs load failed" spam with options DEBUG 2015-02-28 23:04:34 +00:00
rtr
c395e5a2ab Place opening brace to function at column 0, like in the rest of the file. 2015-02-28 21:42:01 +00:00
christos
5a70401cf6 PR/49684: Pierre Pronchery: readlinkat(2) return type is wrong. 2015-02-22 00:50:30 +00:00
martin
906a6a13d7 A syscall like posix_fallocate() that is not supposed to set errno in
userland needs to always return 0 and store the error code *retval.
2015-02-15 10:48:21 +00:00
maxv
dbe8850b34 ... and I forgot to actually remove kern_verifiedexec.c.
As I said in the first revision of kern_veriexec.c: rename
kern_verifiedexec.c to kern_veriexec.c. The old history is now in Attic/,
and no change between kern_verifiedexec.c and kern_veriexec.c.

okayed by christos@ and blymn@ some months ago.
2015-02-13 17:55:24 +00:00
maxv
471961cbf1 Rename kern_verifiedexec.c to kern_veriexec.c. "Veriexec" is the name of
the subsystem, not "Verifiedexec".

The revisions of kern_verifiedexec.c are now in Attic/.

No change between kern_verifiedexec.c and kern_veriexec.c.

Also, update the man page accordingly.

Okayed by christos@ and blymn@ some months ago.
2015-02-13 17:50:48 +00:00
maxv
25ff354bf4 Remove this MALLOC_DEFINE (M_PMF unused). 2015-02-13 13:26:50 +00:00
christos
d83ca2bff1 regen 2015-02-10 17:43:44 +00:00
martin
06ea2d9d35 Mark posix_fallocate as NOERR 2015-02-10 15:07:39 +00:00
christos
79fa3fde9b don't compare user and kernel addresses 2015-02-09 20:46:55 +00:00
christos
7d5216c057 make the ddb code crash(8) friendly. 2015-02-08 19:41:00 +00:00
mlelstv
c75410f9e1 Correct m_len calculation for m_dup() with mbuf clusters.
Fixes kern/49650.
2015-02-08 14:46:30 +00:00
maxv
ff56bf4809 Don't include <uvm/uvm_extern.h> 2015-02-06 18:21:29 +00:00
maxv
20fc3c6998 Kill kmeminit(). 2015-02-06 18:19:22 +00:00
msaitoh
2e202f47c6 Remove useless semicolon reported by Henning Petersen in PR#49635. 2015-02-04 07:10:47 +00:00
msaitoh
00365a1504 Remove useless semicolon reported by Henning Petersen in PR#49634. 2015-02-04 07:09:37 +00:00
christos
d4fc69a7c7 Handle LOCAL_PEERID for socketpair() connected sockets which connect through
connect2().
1. move the code that sets the peerid structure into connect1(). This
   handles so2.  The datagram code calls connect2 twice with flipped
   so arguments so both sockets get set.
2. in connect2 copy the peerid structure from so2 to so, so that that
   both stream sockets get set.
2015-02-02 02:28:26 +00:00
rmind
2472877a60 Implement ipi_trigger_multi(9); requested by cherry@. 2015-01-18 23:16:35 +00:00
dennis
938f7fdfb0 Add a membar_datadep_consumer() before dereferencing the pointer
to a cache entry in cache_lookup_entry().  The entries are being
added to the list it is looking at without mutually-exclusive locking,
so this is necessary to keep some Alphas from seeing stale data
when the pointer is newly-updated.

XXX this is doing lockless adds to a list maintained with LIST_* macros.
2015-01-16 20:10:25 +00:00
jmcneill
a54a8c291b defflag TODR_DEBUG 2015-01-11 14:22:53 +00:00
riastradh
c33b09698b Use membar_datadep_consumer where code inspection reveals it necessary. 2015-01-08 23:39:57 +00:00
christos
4886208506 PR/49104: Jarle Greipsland: Don't use cpu_counter32() unconditionally.
XXX: pullup-7
2015-01-08 16:13:07 +00:00
hannken
b0d9b99b55 vfs_vnode_iterator_destroy: set v_usecount of marker to zero to prevent
an assertion from vnfree().
2015-01-08 12:06:50 +00:00
ozaki-r
3cde4cbc35 Pass a correct firmware size (instead of 0) to firmware_free
firmware_free now uses kmem_free(9) instead of free(9),
so we need to pass a correct size to it.
2015-01-07 07:05:48 +00:00
pooka
af7e1d8f75 initialize sysctl node from init() instead of via linkset 2015-01-04 19:31:00 +00:00
christos
ed5aa85bd1 - Use NODEV instead of 0
- Return EBUSY if there was no label
2015-01-02 01:14:22 +00:00
mlelstv
2fbc202964 Retire disk_blocksize(). 2014-12-31 20:13:41 +00:00
christos
281c044fc6 Mention which ioctls need to move to dk_ioctl, and don't allow wedges on
wedges.
2014-12-31 19:58:59 +00:00
christos
c60db2e923 make more drivers use disk_ioctl, and add a dev parameter to it so that
we can merge the "easy" disklabel ioctls to it. Ultimately all this will
go do dk_ioctl once all the drivers have been converted.
2014-12-31 19:52:04 +00:00
christos
577177e86e get the wedge info first if it exists, because this will support larger sizes. 2014-12-31 19:50:14 +00:00
christos
3be6bb2414 Centralize wedge ioctls in disk_ioctl. 2014-12-31 17:06:48 +00:00
mlelstv
bdddf44518 disk_blocksize and disk_set_info relay the same information
to the disk subsystem.

Make disk_set_info also set blocksize shift values.
Remove every call to disk_blocksize.

Keep disk_blocksize for ABI compatibility, make it also set dg_secsize.
2014-12-31 08:24:50 +00:00
mlelstv
c4ffe4b64c clear error for new ioctls. 2014-12-29 18:54:19 +00:00
mlelstv
78d420c356 Implement DIOCGMEDIASIZE and DIOCGSECTORSIZE from FreeBSD. 2014-12-29 18:41:20 +00:00
dennis
7ad3371ebc Update stats-keeping in sys/kern/vfs_cache.c to remove (most)
races while allowing consistent lockless sampling of the per-cpu
statistics without atomic operations.  Update comment describing
the locking protocol to include this.

These files were fumble-fingered out of the last commit.
2014-12-24 20:01:21 +00:00
christos
f95c68cfed Don't hard code crap we have perfectly good constants for. 2014-12-15 13:50:10 +00:00
chs
669ef94683 remove ep_name, change the last reference to use ep_kname instead. 2014-12-14 23:49:28 +00:00
chs
6d40f9ff57 add a new "fo_mmap" fileops method to allow use of arbitrary uvm_objects for
mappings of file objects.  move vnode-specific details of mmap()ing a vnode
from uvm_mmap() to the new vnode-specific vn_mmap().  add new uvm_mmap_dev()
and uvm_mmap_anon() convenience functions for mapping character devices
and anonymous memory, and replace all other calls to uvm_mmap() with those.
use the new fileop in drm2 so that libdrm can use mmap() to map things
like on other platforms (instead of the ioctl that we have used so far).
2014-12-14 23:48:58 +00:00
christos
a24ecb0e5b PR/49287: Masao Uebayashi: Handle exec_script argument vector from the 32 ->
64 bit case. When execing a 64 bit shell from a 32 bit binary the argument
vector was still incorrect.

XXX: Pullup 7
2014-12-14 21:35:24 +00:00
martin
6a293bc9b1 Change a KASSERT to KASSERTMSG and print enough details about the callout
so it can be identified even if ddb should not be helpfull (or not enabled).
2014-12-10 17:09:49 +00:00
christos
161dbb7f01 - use the unused section in the array to put a NetBSD note in it
- cleanup the hard-coded constants in the stringtab
2014-12-09 02:30:09 +00:00
dennis
095b4dbc57 Take 2. Do a fairly mechanical reversion of the locking protocol
to that of revision 1.94.  Add a comment documenting my best guess
about the locking requirements in this subsystem.  Don't take locks
solely for the sake of stats counter increments; the locking around
the increment of ->ncs_pass2 and/or ->ncs_2passes caused a deadlock.
Defer fixing stats-keeping to allow this change to be easily backed
out of.
2014-12-07 22:23:38 +00:00
christos
de1f3434e6 Reverts previous: Causes all processes to hang in tstile in rw_lock from
genfs_lock during a make -j 20 build
2014-12-03 01:30:32 +00:00
christos
46aa4b787f - add diagnostic check for sa_len
- use new socket pretty printers to format sockaddr's
2014-12-02 19:45:58 +00:00
pooka
b7b3e98220 print kernel module path only in kernels which support paths 2014-12-02 13:00:38 +00:00
ozaki-r
087b8cc474 Revert "Pull if_drain routine out of m_reclaim"
The commit broke dlopen()'d rumpnet on platforms where ld.so does not
override weak aliases (e.g. musl, Solaris, potentially OS X, ...).

Requested by pooka@.
2014-12-02 04:43:35 +00:00
dennis
60e602f21b Do a fairly mechanical reversion of the locking protocol to that
of revision 1.97.  Add a comment documenting my best guess about
the locking requirements in this subsystem.  Leave the locks
taken solely for stats counter increments in place for now; they
should ultimately go but that is a bigger change.
2014-11-30 04:11:03 +00:00
uebayasi
f0f069cba4 Consistently use KPREEMPT_*() here. 2014-11-28 08:27:27 +00:00
uebayasi
fb969037b5 Consistently use kpreempt_*() outside scheduler path. 2014-11-27 15:00:00 +00:00
uebayasi
e81f2315f4 Yield the main thread only after exiting critical section. 2014-11-27 14:38:09 +00:00
ozaki-r
0b2631673e Pull if_drain routine out of m_reclaim
It's if-specific and should be in if.c.

No functional change.
2014-11-27 03:15:51 +00:00
manu
e6a2cb8983 Do not follow symlinks in sys_unmount()
There are situations where the underlying filesystem is unreachable
(e.g: NFS) causing symlink resolution to hang. Such a situation
should be avoided by using umount -f -R (force and raw), but while -R
causes the symlink resolution to be skipped in umount(8), the kernel was
still doing it in sys_unmount(). This changes fixes that.

When the -R flag is not given, umount(8) does symlinks resolution through
realpath(3) before calling unmount(2), hence not doing it in the kernel
would not change behavior.
2014-11-26 10:50:36 +00:00
christos
a27531bc87 Print the shared lock(s) before we panic, to aid with debugging. 2014-11-24 02:36:31 +00:00
christos
43dbf6a651 Don't return early when the incorrect size is passed to some of the
ptrace actions. Leaves locks dangling and causes panics with lockdebug.
XXX: Pullup 7
2014-11-24 02:34:04 +00:00
mlelstv
68774bf92e Let MD code provide boot disk information as spec string that can be
parsed by MI code. The format is the same as provided by an embedded
'root on <rootspec>' string in the config file. An embedded string
(other than a wildcard) still takes precedence.
2014-11-22 11:04:57 +00:00
mlelstv
16fb494383 don't crash if rootspec is invalid 2014-11-22 10:24:02 +00:00
ozaki-r
0edc16ce4f Replace callout_stop with callout_halt
In order to call callout_destroy for a callout safely, we have to ensure
the function of the callout is not running and pending. To do so, we should
use callout_halt, not callout_stop.

In this case, we need to pass an interlock to callout_halt to wait for
the callout complete.

Reviewed by riastradh@.
2014-11-21 09:40:10 +00:00
christos
cced78ddd9 Change debug to diagnostic so that more people see the lossage with bad
random streams, so we can debug it.
2014-11-19 14:25:00 +00:00
christos
a95736d447 PR/49207: Kamil Rytarowski: Add sys/clock.h with generic time macros
(derived from clock_subr.h). Keep clock_subr.h with the kernel structures
and functions to reduce diffs, and have clock.h only include standalone
constants and macros.
2014-11-17 02:15:48 +00:00
manu
7ac57848aa Fix use-after-free on failed unmount with extended attribute enabled
When unmount failed, for instance because the mount is still busy,
UFS1 extended attributes structures were left freed while the kernel
assumes extended attributes were still enabled. This led to using
UFS1 extended attributes structures after free. With LOCKDEBUG, with
quickly triggers a panic.

The problem is fixed by:
1) clear MNT_EXTATTR flag after extended attributes structures are freed
2) attempt to restart extended attributes after failed unmount
2) set MNT_EXTATTR correctly after extended attributes restart

As a side effect, extended attribute structures are now only initialized
when extended attributes are started for the filesystem.
2014-11-14 10:09:50 +00:00
maxv
eda7c7bbe4 Do not uselessly include <sys/malloc.h>. 2014-11-09 17:48:07 +00:00
uebayasi
27fe31d88c Make config_stdsubmatch() human-readable. 2014-11-06 08:46:04 +00:00
tls
9b3a62bd20 Fixes and enhancements for polled entropy sources:
Add explicit enable/disable hooks for callout-driven sources (be more
	power friendly).

	Make "skew" source polled so it runs only when there is entropy
	demand.

	Adjust entropy collection from polled sources so it's processed
	sooner.
2014-10-26 18:22:32 +00:00
christos
f9128b659c PR/49287: David Holland: Skip the right number of bytes to go over the first
argument in the argv vector. Fixes netbsd32 script execution, where you lost
the first argument because it skipped 8 bytes instead of 4.
2014-10-24 21:13:30 +00:00
maxv
ca2674bc40 The userland namelen is size_t, but the kernel holds it in an int. The
sizeof(login) test implicitly interprets 'namelen' as unsigned, which
means that negative values get kicked anyway. Still this is fragile, so:
	int -> size_t
2014-10-20 08:20:08 +00:00
snj
f0a7346d21 src is too big these days to tolerate superfluous apostrophes. It's
"its", people!
2014-10-18 08:33:23 +00:00
christos
14b4a4b149 From Ilia Zykov:
- correct some incorrect comments
- add XXX warning
- increase security by activating when get the slave
- make pty_vn_open() private to tty_ptm.c
2014-10-15 15:00:03 +00:00
jmcneill
e334dd12ca fix compilation with TODR_DEBUG 2014-10-12 16:23:20 +00:00
uebayasi
c2aa342e46 Mark some stray files as kern for now. 2014-10-12 04:38:28 +00:00
uebayasi
27424e5fa5 Move kern definitions. 2014-10-12 04:30:42 +00:00
taca
e8af77a953 Make behavior of getsockname(2) (and maybe getpeername(2)) as the same as
NetBSD 6.1_STABLE and other operating system (OS X 10.9.5).

* sa_len of sockaddr_un strucrure is always set to sizeof(sun_path).
* pathname stored in sun_path is alwasys '\0' terminated (except length
  of sun_path is sizeof(sun_path)?).

Should be fix PR kern/49247, runtime problem of lmtp service of dovecot2 on
NetBSD current and NetBSD 7.0_BETA.
2014-10-08 16:13:02 +00:00
riastradh
3e23190f1c Get arguments in the right order for copyout. (Oops!) 2014-10-05 10:00:03 +00:00
riastradh
66f474049f Make uuidgen(2) generate v4 (random) uuids.
Rip out all the needless MAC address and date/time leakage.  No more
uuid_init necessary, nor contention over a global uuid state.

While here, simplify uuid_snprintf and fix a strict aliasing
violation.
2014-10-04 11:15:44 +00:00
hannken
b09a3a32e3 When creating a vnode with vcache_get() mark the vnode VI_CHANGING until
it is fully initialised.  It may be on the specnode list before it is
fully initialised and revoking it then would panic.

Should prevent the panic from PR kern/49171 (panic when closing a pty).
2014-10-03 14:45:38 +00:00
justin
86efea3a92 Work around pedantic compiler 2014-10-02 23:07:30 +00:00
christos
7c397b34ce remove casts to the same type. 2014-09-21 17:17:15 +00:00
matt
c3dcd587c0 Allow MD code to use something other than __cpu_simple_lock_t for doing spin
locks but use the same logic.

MUTEX_SPINBIT_LOCK_INIT
MUTEX_SPINBIT_LOCK_TRY
MUTEX_SPINBIT_LOCKED_P
MUTEX_SPINBIT_LOCK_UNLOCK
MUTEX_INITIALIZE_SPIN_IPL

For those platforms without sub-word CAS, you can use these to place the
mutex lock and ipl inside a full machine word and use CAS to update them.
2014-09-19 17:52:43 +00:00
joerg
83d5fa366c Replace random with cprng_fast32. Reorganise computation to replace
(32bit) division with (long) multiplication.
2014-09-08 22:01:24 +00:00
matt
45b1ec740d Try not to use f_data, use f_{vnode,socket,pipe,mqueue,kqueue,ksem} to get
a correctly typed pointer.
2014-09-05 09:20:59 +00:00
matt
0d71dac81d Missed a C++ keyword (DEBUG case) 2014-09-05 06:50:58 +00:00
matt
a35d1a8c7c Don't next structure and enum definitions.
Don't use C++ keywords new, try, class, private, etc.
2014-09-05 05:57:21 +00:00