Commit Graph

8737 Commits

Author SHA1 Message Date
pooka
0bb4e2ffe3 properly handle forward declarations for pointerpointer arguments 2014-04-09 23:50:45 +00:00
rjs
752c60b211 whitespace. 2014-04-07 17:02:15 +00:00
seanb
6bcc34c970 Fix a case where an erroneous EAGAIN was returned out of recvmmsg.
This occured when some, but not all of the mmsg array members
were filled with data from a non-blocking socket.
PR kern/48725
2014-04-07 15:35:23 +00:00
christos
6accf143de Kernel portion of the multiple ptyfs mount support. Protocol changed
between kernel and module, so bump. (Ilya Zykov)
2014-04-04 18:11:58 +00:00
maxv
18ff15fb2d Limit check for 'data_len'. Otherwise a (un)privileged user can easily
panic the system by passing a huge size.

ok christos@
2014-04-04 06:47:02 +00:00
para
608fba6393 make condition for ENOMEM consistent with allocation requirement 2014-04-02 18:09:10 +00:00
matt
790372329e If we are writing PN_XNUM or more phdrs, include one section header and
encode the real # of sections in its sh_info.
2014-04-02 17:19:49 +00:00
para
c28aad1c2f bt_refill is and must be called with VM_NOSLEEP set, assert this
fix error path if pool_get returns NULL
2014-04-02 16:14:50 +00:00
seanb
f9c6e7aeaa len argument to strlcpy() was incorrect when copying
out AF_LOCAL sockets in sysctl helper.  The entire
buffer wasn't available since sun_path member is not
at offset 0 in struct sockaddr_un.
2014-04-02 15:35:45 +00:00
maxv
687880ac6a Style 2014-03-29 09:31:11 +00:00
ozaki-r
6ac95d35b1 Fix unused variable 'mp' 2014-03-28 11:55:09 +00:00
christos
33baebc2e5 explain how a printf might happen (since it has bitten more than one person) 2014-03-27 21:09:33 +00:00
christos
a9253db65e From Ilya Zykov:
- ifdef out some code that is only used for NO_DEV_PTM
- pass the mountpoint instead of the ptm structure to the implementation
  dependent (ptyfs or bsdpty) functions.
- add a function to return the correct ptyfs mountpoint for the current lwp
2014-03-27 17:31:56 +00:00
christos
968c5f53d8 in the bsdpty allocvp flavor, call the bsdpty mkname directly, since it is
the only one possible to be valid (Ilya Zykov)
2014-03-26 21:29:54 +00:00
christos
e9ba8bc5a2 remove {v,}sprintf 2014-03-26 18:03:47 +00:00
macallan
00c16ffd7f snprintf -> vsnprintf in cpu_setmodel()
now this can actually work
hi christos
2014-03-25 12:50:53 +00:00
christos
2788907516 - create cpu_{g,s}etmodel() and hide cpu_model from direct access. 2014-03-24 20:07:40 +00:00
hannken
f3cf481632 - Make VI_XLOCK, VI_CLEAN and VI_LOCKSHARE private to kern/vfs_*.c.
- Make vwait() static.
- Add  vdead_check() to check a vnode for being or becoming dead.

Discussed on tech-kern.

Welcome to 6.99.38
2014-03-24 13:42:40 +00:00
christos
f363da3aa0 fix unused 2014-03-23 02:56:33 +00:00
maxv
2632b9d940 Fix a potential - but very unlikely - NULL pointer dereference.
(it does not introduce a new error code for open(), since
 pathbuf_copyin() is already there and can return ENOMEM)

Found by my code scanner.
2014-03-22 08:15:25 +00:00
maxv
d8a274dfb9 Small changes:
- rename elf_load_file() to elf_load_interp()
 - use the correct type for 'nused'
 - remove useless cases
 - reorder a kmem_alloc

ok christos@
2014-03-22 07:27:21 +00:00
mlelstv
43b8706dc0 Incorrect use of pointer arithmetic.
CID 1193195:  Extra sizeof expression
2014-03-20 06:48:22 +00:00
christos
52813a4e8e fix leak on error from pty_fill_ptmget (Ilya Zykov) 2014-03-19 18:11:17 +00:00
hannken
b349ee43ab Operations vmark(), vunmark() and vismarker() have been replaced by
vfs_vnode_iterator_*(), remove them.

Document vfs_vnode_iterator_*().

Make VI_MARKER private to vfs_vnode.c, vfs_mount.c and unfortunately
to ufs/lfs/lfs_segment.c.

Welcome to 6.99.37
2014-03-18 10:21:47 +00:00
hannken
618ee03549 Change sysctl_kern_vnode() to use vfs_vnode_iterator. 2014-03-17 09:28:37 +00:00
hannken
ed193ed61b Add fstrans_startnowait()/fstrans_done() to vrele_thread(). 2014-03-17 09:27:37 +00:00
maxv
7c09916210 Remove the 'prot' argument from elf_load_psection(). It is not used
outside, and can be declared locally. Clearer.

ok christos@
2014-03-16 07:57:25 +00:00
dholland
a68f9396b6 Change (mostly mechanically) every cdevsw/bdevsw I can find to use
designated initializers.

I have not built every extant kernel so I have probably broken at
least one build; however I've also found and fixed some wrong
cdevsw/bdevsw entries so even if so I think we come out ahead.
2014-03-16 05:20:22 +00:00
pooka
c9bffc6f73 regen: time/timer related syscalls for rump kernels 2014-03-14 00:56:37 +00:00
pooka
527bb3b75d Add rump kernel syscall wrapper flag for a bunch of time-related
syscalls (nanosleep, clock_gettime, etc.).  These are mostly intended
for situations where a rump kernel runs on an OS-less host.
2014-03-14 00:52:08 +00:00
pooka
1ac307e403 kill undesirable #ifndef _RUMPKERNEL 2014-03-11 20:32:05 +00:00
pooka
b05633df66 kill undesirable "#ifdef _RUMPKERNEL" 2014-03-11 20:26:08 +00:00
matt
bbe1552068 Tell where the corrruption was encountered in the panic message. 2014-03-07 16:36:32 +00:00
matt
dbd8c999e4 Remove spurious . 2014-03-07 01:55:01 +00:00
christos
54b7adb159 c99 initializers for struct execsw 2014-03-07 01:33:43 +00:00
matt
ab77483fb9 add ep_entryoffset to exec_package so one can calculate the relocabase
of an ET_DYN image.
2014-03-06 09:30:37 +00:00
hannken
72439b7dc8 Current support for iterating over mnt_vnodelist is rudimentary. Every
caller has to care about list and vnode mutexes, reference count being zero,
intermediate vnode states like VI_CLEAN, VI_XLOCK, VI_MARKER and so on.

Add an interface to iterate over a vnode list:

void vfs_vnode_iterator_init(struct mount *mp, struct vnode_iterator **marker)
void vfs_vnode_iterator_destroy(struct vnode_iterator *marker)
bool vfs_vnode_iterator_next(struct vnode_iterator *marker, struct vnode **vpp)

vfs_vnode_iterator_next() returns either "false / *vpp == NULL" when done
or "true / *vpp != NULL" to return the next referenced vnode from the list.

To make vrecycle() work in this environment change it to

bool vrecycle(struct vnode *vp)

where "vp" is a referenced vnode to be destroyed if this is the last reference.

Discussed on tech-kern.

Welcome to 6.99.34
2014-03-05 09:37:29 +00:00
dsl
4af555d7e1 When converting out of range 64bit sysctl values to 'int' (because of
an 'int' sized read) don't assume that sizeof (int) is 4.
2014-03-01 17:27:48 +00:00
riastradh
84bbdd5611 Kick on-demand entropy sources in rndsinks_distribute.
Partial workaround for indefinite hangs when entropy is scarce or
buffered up.  We need to do more to handle entropy that has been
buffered up -- see the comment for details -- but this will help for
now.

Problem noted by pooka.
2014-03-01 14:15:15 +00:00
skrll
dd7bb1e0a8 G/C sys/simplelock.h includes 2014-02-28 10:16:51 +00:00
dsl
7b1adb697e Allow CTLTYPE_INT and CTLTYPE_QUAD to be read and written as either 4 or 8
byte values regardless of the type.
64bit writes to 32bit variables must be valid (signed) values.
32bit reads of large values return -1.
Amongst other things this should fix libm's code that reads machdep.sse
  as a 32bit int, but I'd changed it to 64bit (to common up some code).
2014-02-27 22:50:52 +00:00
hannken
2b6ec89863 The current implementation of vn_lock() is racy. Modification of
the vnode operations vector for active vnodes is unsafe because it
is not known whether deadfs or the original file system will be
called.

- Pass down LK_RETRY to the lock operation (hint for deadfs only).

- Change deadfs lock operation to return ENOENT if LK_RETRY is unset.

- Change all other lock operations to check for dead vnode once
  the vnode is locked and unlock and return ENOENT in this case.

With these changes in place vnode lock operations will never succeed
after vclean() has marked the vnode as VI_XLOCK and before vclean()
has changed the operations vector.

Adresses PR kern/37706 (Forced unmount of file systems is unsafe)

Discussed on tech-kern.

Welcome to 6.99.33
2014-02-27 16:51:37 +00:00
hannken
d940ddcc62 Currently dead vnodes still reside on the vnodelist of the file system
they have been removed from.

Create a "dead mount" that takes dead vnodes until they get freed.

Discussed on tech-kern.
2014-02-27 13:00:06 +00:00
maxv
ff3f3d5c44 We have to ensure the string is NUL-terminated and of the expected
length to avoid copying uninitialized data.

ok christos@
2014-02-27 09:58:05 +00:00
riastradh
98ff99631b Fix bits/bytes mixup in rnd_getmore.
Remove some needless casts and fix format directives while here.

Bit/byte mixup noticed by pooka.
2014-02-25 23:15:43 +00:00
pooka
4f6fb3bf35 Ensure that the top level sysctl nodes (kern, vfs, net, ...) exist before
the sysctl link sets are processed, and remove redundancy.

Shaves >13kB off of an amd64 GENERIC, not to mention >1k duplicate
lines of code.
2014-02-25 18:30:08 +00:00
justin
69dd91d347 Add kern.{ostype,osrelease,osrevision,version} kern.domainname,
kern.rawpartition sysctl support to rump kernel.
Moved the sysctl support that is shared between rump and normal
kernels to init_sysctl_base.c as rump cannot use init_sysctl.c
in order to avoid code duplication. Agreed with pooka@.
2014-02-25 01:02:42 +00:00
mlelstv
5d1221e5bf ttioctl always gets a valid lwp reference. Replace attempt to handle a NULL
reference in only one place with a regular assertion.
2014-02-23 07:54:43 +00:00
maxv
33cfa4fef0 Simplify error path.
ok christos@
2014-02-22 07:53:16 +00:00
maxv
0ff9025533 Revert rev1.38. The header already begins with EXEC_SCRIPT_MAGIC="#!".
So it can't be ELFMAG="\177ELF" at the same time.

ok christos@
2014-02-21 08:11:59 +00:00