| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
|
| |
This turns `filehead' into a local variable, that will make it easier
to protect it.
ok visa@
|
|
|
|
| |
ok visa@
|
|
|
|
|
|
|
|
| |
calling FRELE(9) in finishdup().
Update comments accordingly.
ok bluhm@, visa@
|
|
|
|
|
|
| |
dupfdopen().
ok bluhm@, visa@
|
|
|
|
|
|
|
| |
set for pledged processes. dup(2) uses the flag from the old file
descriptor. Make open /dev/fd consistent to duplicate and inherit
the flag.
OK deraadt@
|
| |
|
|
|
|
|
|
| |
While here call FREF() right after fd_getfile().
ok bluhm@, visa@
|
|
|
|
|
| |
Nothing uses this fd-tracking part of pledge yet.
OK deraadt@
|
|
|
|
| |
ok millert@, bluhm@
|
|
|
|
|
|
|
| |
This ensure that all operations manipulating a 'struct file *' do so
with a properly refcounted element.
ok visa@, bluhm@
|
|
|
|
|
|
|
| |
The account flag `ASU' will no longer be set but that makes suser()
mpsafe since it no longer mess with a per-process field.
No objection from millert@, ok tedu@, bluhm@
|
|
|
|
|
|
|
|
| |
if TIOCGPGRP fail.
Issue found by Ilja van Sprundel.
ok bluhm@, millert@, deraadt@
|
|
|
|
|
|
|
| |
close-on-exec flag on the newly allocated fd. Make falloc()'s
return arguments non-optional: assert that they're not NULL.
ok mpi@ millert@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
pledged process. dup(2) and recvmsg(2) retain UF_PLEDGED from the original fd.
In pledge "exec" circumstances, exceve clears UF_PLEDGED on all the process's
fds.
In a pledge'd process, ioctl(2) can use this additional information to grant
access to ioctl's which are more sensitive or dive deeply into the kernel.
Developers will be encouraged to open such sensitive resources before calling
pledge(2), rather than afterwards. That matches the heading of privsep
development practices.
Future changes will introduce those ioctl(2) changes.
Lots of discussions with semarie guenther and benno.
|
|
|
|
|
|
|
|
|
| |
the old array of open files.
Fix a race for multi-threaded processes reported by cheeky.m@gmx.com
on bugs@ and analyzed with bluhm@.
ok deraadt@, bluhm@
|
|
|
|
| |
ok guenther mpi
|
|
|
|
| |
ok guenther
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
the ioff argument to pool_init() is unused and has been for many
years, so this replaces it with an ipl argument. because the ipl
will be set on init we no longer need pool_setipl.
most of these changes have been done with coccinelle using the spatch
below. cocci sucks at formatting code though, so i fixed that by hand.
the manpage and subr_pool.c bits i did myself.
ok tedu@ jmatthew@
@ipl@
expression pp;
expression ipl;
expression s, a, o, f, m, p;
@@
-pool_init(pp, s, a, o, f, m, p);
-pool_setipl(pp, ipl);
+pool_init(pp, s, a, ipl, f, m, p);
|
|
|
|
| |
ok kettenis@
|
|
|
|
| |
ok deraadt
|
|
|
|
|
| |
by sthen.
ok semarie
|
| |
|
| |
|
|
|
|
|
|
| |
torture tested on amd64, i386 and macppc
ok beck mpi stefan
"the change looks right" deraadt
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- rename _check function without suffix: a "pledge" function called from
anywhere is a "check" function.
- makes pledge_fail call the responsability to the _check function. remove it
from caller.
- make proper use of (potential) returned error of _check() functions.
- adds pledge_kill() and pledge_protexec()
with and OK deraadt@
|
| |
|
|
|
|
|
|
|
| |
for device. In sys_fcntl() the ioctl(TIOCSPGRP) is called, but the
pipe expects SIOCSPGRP. Sockets have a specal case for the same
reason, so adapt the special code for pipes.
OK millert@
|
|
|
|
| |
use pledge and file locking. OK deraadt@
|
|
|
|
|
|
|
| |
option to fcntl(), so that isatty() can use this rather than than the bloated
ioctl() interface. Reducing uses of ioctl() by libc makes it easier to
constrain programs with various kinds of systrace sandboxes.
ok guenther, previously discussed as a concept with nicm
|
| |
|
|
|
|
|
|
|
| |
followed by a mode check. This will simplify the ref/unref dance as
soon as fd_getfile() will increment fp's reference counter.
Idea from and ok guenther@, ok millert@
|
|
|
|
|
|
|
| |
have any direct symbols used. Tested for indirect use by compiling
amd64/i386/sparc64 kernels.
ok tedu@ deraadt@
|
| |
|
|
|
|
| |
marker for which pools are not interrupt safe. ok dlg
|
|
|
|
|
|
| |
objective: vnode.h doesn't include uvm_extern.h anymore.
followup changes: include uvm_extern.h or lock.h where necessary.
ok and help from deraadt
|
|
|
|
|
|
|
| |
when creating them: pipe2(), dup3(), accept4(), MSG_CMSG_CLOEXEC,
SOCK_CLOEXEC. Includes SOCK_NONBLOCK support.
ok matthew@
|
| |
|
|
|
|
| |
after discussions with beck deraadt kettenis.
|
|
|
|
|
| |
don't need to be married.
ok guenther miod beck jsing kettenis
|
|
|
|
| |
Pointed out by Jean-Philippe Ouellet.
|
|
|
|
|
|
|
|
|
|
| |
to the process's vmspace and filedescs. struct proc continues to
keep copies of the pointers, copying them on fork, clearing them
on exit, and (for vmspace) refreshing on exec.
Also, make uvm_swapout_threads() thread aware, eliminating p_swtime
in kernel.
particular testing by ajacoutot@ and sebastia@
|
|
|
|
|
|
|
|
|
|
|
| |
(race condition ?)
problem noticed by me, aja, sthen, brynet, rpe.
vanishing after this revert, okay aja@, sthen@
tedu, you probably want to look into re-checking the fcreate/fpublish addition
first, then if it's stable, see about tweaking doopenat ?
|
|
|
|
|
|
|
|
|
| |
struct ucred; struct process then directly links to the ucred
Based on a discussion at c2k10 or so before noting that FreeBSD and
NetBSD did this too.
ok matthew@
|
|
|
|
|
|
|
|
|
|
| |
the first part is likely to fail, but we can generally prevent the second
part from failing.
use these two functions to drop the fdp lock around vn_open in sys_open,
but still maintain the original semantics of allocate then open.
the goal here is to fix the blocked fifo deadlock in a threaded program.
testing volunteers in short supply, resorting to conscription
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
members to 64bit types. Assign new syscall numbers for (almost
all) the syscalls that involve the affected types, including anything
with time_t, timeval, itimerval, timespec, rusage, dirent, stat,
or kevent arguments. Add a d_off member to struct dirent and replace
getdirentries() with getdents(), thus immensely simplifying and
accelerating telldir/seekdir. Build perl with -DBIG_TIME.
Bump the major on every single base library: the compat bits included
here are only good enough to make the transition; the T32 compat
option will be burned as soon as we've reached the new world are
are happy with the snapshots for all architectures.
DANGER: ABI incompatibility. Updating to this kernel requires extra
work or you won't be able to login: install a snapshot instead.
Much assistance in fixing userland issues from deraadt@ and tedu@
and build assistance from todd@ and otto@
|