Commit Graph

8499 Commits

Author SHA1 Message Date
spz
e124ae9088 Fix an inversion in checking for authorization to drop TCP connections
found (and the obvious fix suggested) by Sander Bos.
2013-08-02 20:00:33 +00:00
drochner
3b7fa5ee7c In unp_externalize, don't do anything if an SCM_RIGHTS control message
was sent with zero file descriptors in it. Otherwise, a zero-length
temporary storage would be allocated which triggers panic on DIAGNOSTIC
kernels (but is harmless for release kernels).
reviewed by Taylor R Campbell
2013-08-01 19:33:21 +00:00
skrll
283149fa94 Fix KASSERT to avoid assumptions about ipl order.
XXX Temporary measure?
2013-07-27 11:19:09 +00:00
skrll
0c66710506 Fix debug code to not use uninitialised variables. 2013-07-23 07:03:16 +00:00
alnsn
cb7134ee1a Revert the previous commit. 2013-07-22 19:43:54 +00:00
njoly
8d578817f8 Remove, in do_sys_renameat(), wrong KASSERTs that check for non NULL
from/to arguments. Such values are correctly handled by later
pathbuf_maybe_copyin() calls, that will fail with EFAULT.

ok from dholland@.
2013-07-20 15:55:57 +00:00
alnsn
f346ebebc0 Always terminate qc_name with NUL because pool_init(9) uses
strcmp(3) to compare wchans.
2013-07-18 19:39:49 +00:00
matt
ca47ca8a7a Make do_sys_utimensat public 2013-07-18 14:06:27 +00:00
matt
c537c2aa1b export do_sys_statat for netbsd32 2013-07-18 13:41:08 +00:00
matt
6e660710b6 Some constification.
Add kcpuset_clone, kcpuset_insersection, kcpuset_remove,
kcpuset_ffs, kcpuset_ffs_intersecting,
kcpuset_atomicly_merge, kcpuset_atomicly_intersect, kcpuset_atomicly_remove
2013-07-17 22:36:26 +00:00
pooka
b666f4df76 regen 2013-07-17 21:21:34 +00:00
pooka
e4ca638e55 Additionally translate daddr_t to int64_t in the rumpvnode interface.
The type daddr_t is not available for all systems (e.g. Linux systems with
musl libc), and exposing it will just cause an unnecessary compilation
failure even if the type is not used.
2013-07-17 21:20:53 +00:00
reinoud
8fd5b25064 Extend generic dirhash to include an empty directory checker based on
the knowledge the dirhash has. This is done by keeping a count of the current
hash entries.
2013-07-07 19:31:26 +00:00
riastradh
a7f90b2fd2 Fix races in /dev/u?random initialization and accounting.
- Push /dev/random `information-theoretic' accounting into cprng(9).
- Use percpu(9) for the per-CPU CPRNGs.
- Use atomics with correct memory barriers for lazy CPRNG creation.
- Remove /dev/random file kmem grovelling from fstat(1).
2013-07-01 15:22:00 +00:00
christos
348fd11f73 remove useless initialization
http://m00nbsd.net/ae123a9bae03f7dde5c6d654412daf5a.html
2013-06-28 15:34:21 +00:00
christos
9a402121dd delete useless initialization
http://m00nbsd.net/ae123a9bae03f7dde5c6d654412daf5a.html
2013-06-28 15:33:40 +00:00
christos
ed4feda3aa don't store random values in retval
http://m00nbsd.net/ae123a9bae03f7dde5c6d654412daf5a.html
2013-06-28 15:32:20 +00:00
matt
6fb884f892 Make sbdrop panic more verbose 2013-06-28 01:23:38 +00:00
matt
a8c0b1a9f4 Make m_copydata panics more verbose 2013-06-28 01:23:05 +00:00
matt
a905a9f307 Convert a KASSERT to a KASSERTMSG 2013-06-28 01:21:45 +00:00
matt
8e19601507 Make page loaning in pipes color aware. 2013-06-28 01:21:06 +00:00
christos
4c8669e4d6 use sbcreatecontrol1() and m_add() instead of open-coding everything, and
getting it slightly wrong.
2013-06-27 18:54:31 +00:00
christos
931cb652f6 Introduce a more general method of sbcreatecontrol, sbcreatecontrol1 that
can take flags (M_WAITOK), and allocate large messages if needed. It also
returns the allocated pointer instead of copying the data to the passed
pointer. Implement sbcreatecontrol() using that.
2013-06-27 18:53:17 +00:00
christos
45ab582ccf - add m_add() that puts an mbuf to end of a chain
- m_append() and m_align() with their family
- remove parameters from prototypes
2013-06-27 17:47:18 +00:00
matt
1b47c955dd If the MBR is a protective MBR, don't bother looking at it. 2013-06-26 18:47:26 +00:00
riastradh
82db4b9858 Replace consttime_bcmp/explicit_bzero by consttime_memequal/explicit_memset.
consttime_memequal is the same as the old consttime_bcmp.
explicit_memset is to memset as explicit_bzero was to bcmp.

Passes amd64 release and i386/ALL, but I'm sure I missed some spots,
so please let me know.
2013-06-24 04:21:19 +00:00
riastradh
5fa1ffb5de Include <sys/lwp.h> for curlwp. 2013-06-24 00:56:21 +00:00
riastradh
6290b0987e Rework rndsink(9) abstraction and adapt arc4random(9) and cprng(9).
rndsink(9):
- Simplify API.
- Simplify locking scheme.
- Add a man page.
- Avoid races in destruction.
- Avoid races in requesting entropy now and scheduling entropy later.

Periodic distribution of entropy to sinks reduces the need for the
last one, but this way we don't need to rely on periodic distribution
(e.g., in a future tickless NetBSD).

rndsinks_lock should probably eventually merge with the rndpool lock,
but we'll put that off for now.

cprng(9):
- Make struct cprng_strong opaque.
- Move rndpseudo.c parts that futz with cprng guts to subr_cprng.c.
- Fix kevent locking.  (Is kevent locking documented anywhere?)
- Stub out rump cprng further until we can rumpify rndsink instead.
- Strip code to grovel through struct cprng_strong in fstat.
2013-06-23 02:35:23 +00:00
christos
816452912b Initialize the rnd softint explicitly via a function late in main. Avoids
LOCKDEBUG panic since softint_establish() was called via wdcintr -> wddone
from an interrupt context and tried to acquire a non-spin mutex.
2013-06-20 23:21:41 +00:00
tls
a5fd1fb2d3 Correct use of entropy estimate when data are extracted from the pool.
The "threshold" value was being inappropriately used to limit how many
bytes could be output even after the estimator said enough bytes had
been put in to meet our minimum security guarantee.

This fixes a panic observed with the automatic test harness and by
msaitoh, where it was not possible to extract the full estimate's worth
of bytes even holding the pool lock across the estimate and extract
calls.
2013-06-13 19:18:00 +00:00
tls
a93435648b Correct misunderstanding in previous: a mutex is not required to protect
the soft interrupt dispatches.
2013-06-13 01:37:03 +00:00
tls
5819ac2839 Convert the entropy pool framework from pseudo-callout-driven to
soft interrupt driven operation.

Add a polling mode of operation -- now we can ask hardware random number
generators to top us up just when we need it (bcm2835_rng and amdpm
converted as examples).

Fix a stall noticed with repeated reads from /dev/random while testing.
2013-06-13 00:55:01 +00:00
pooka
59edb642f4 g/c unused static variable 2013-06-10 14:53:52 +00:00
dholland
9daf003ef2 Stick UFS_ in front of these symbols:
DIRBLKSIZ
   DIRECTSIZ
   DIRSIZ
   OLDDIRFMT
   NEWDIRFMT

Part of PR 47909.

(two stragglers in this commit; oops)
2013-06-09 18:29:25 +00:00
riz
c02fb3c915 Add another field to the SDT_PROBE_DEFINE macro, so our DTrace probes
can named the same as those on other platforms.

For example, proc:::exec-success, not proc:::exec_success.

Implementation follows the same basic principle as FreeBSD's; add
another field to the SDT_PROBE_DEFINE macro which is the name
as exposed to userland.
2013-06-09 01:13:47 +00:00
christos
27fe772ddc IPSEC has not come in two speeds for a long time now (IPSEC == kame,
FAST_IPSEC). Make everything refer to IPSEC to avoid confusion.
2013-06-05 19:01:26 +00:00
christos
850cc78403 use the proper name for kdump pretty-printing. 2013-06-03 23:45:31 +00:00
christos
7b845fa9dc phase 1 of disk geometry cleanup:
- centralize the geometry -> plist code so that we don't have
	  n useless copies of it.
2013-05-29 00:47:48 +00:00
kardel
effe57d37e Extend kernel PPS api with pps_ref_event().
pps_ref_event() allows capturing PPS time stamps
that are not generated at precisely 1Hz (e. g.
by reading a precision clock via callout()).

This extension allows clock drivers to supply PPS
time-stamps and drive the kernel NTP PLL
without the overhead of interrupt-handling and
-processing.
2013-05-26 18:07:42 +00:00
christos
39d23ee140 Make ts2timo(9) always return the absolute start time if the start argument
is present, and handle the TIMER_ABSTIME case in nanosleep1(9).
2013-05-22 16:00:52 +00:00
bouyer
5e3e8c4055 ts2timo(): if TIMER_ABSTIME is set and start is not NULL, initialize
it to 0. Some callers (e.g. nanosleep1()) expect *start to always be
initialized and would use random values from stack otherwise.
While there, remove an always-true conditionnal.
2013-05-21 16:25:55 +00:00
njoly
1f01deacdd Redo case where buf_map is not yet mapped when buf_memcalc() is called
early from pmap_bootstrap(). Makes alpha, and probably others, boot
again.
2013-05-19 11:02:12 +00:00
skrll
08f384533b KNF 2013-05-11 15:44:46 +00:00
pooka
1fddf4baef print more diagnostic info in panic message 2013-05-08 11:08:45 +00:00
mlelstv
220e532cc2 fix locking order mountlist_lock -> mnt_unmounting.
Set IMNT_GONE early to protect against concurrent dounmount()
and vfs_busy() before the mountpoint is removed from
mount list.
2013-04-28 21:34:31 +00:00
christos
8c31c1cdbd fix warning 2013-04-27 20:13:16 +00:00
christos
28b4efbeda turn off debugging 2013-04-27 18:17:37 +00:00
christos
d4724c689e Add debugging info. 2013-04-27 17:13:50 +00:00
mlelstv
060c06be14 Revert change that allowed rw_tryenter(&lock, RW_READER) to recurse
for vfs_busy(). This is no longer necessary.
2013-04-27 08:12:34 +00:00
mlelstv
df5cf9d7a4 Correct umount semantics to return EBUSY when a filesystem is busy
instead of failing filesystem operations with EBUSY when attempting
an umount.
This fixes kern/38141.
2013-04-26 22:27:16 +00:00