| Commit message (Collapse) | Author | Age | Files | Lines |
| ... | |
| |
|
|
| |
Discussed with millert
|
| |
|
|
| |
ok millert semarie tedu guenther
|
| |
|
|
|
|
|
| |
Since this only affects base gcc and the ports most in need of PCHs are
compiled with ports compilers anyway, let's see what happens if we break it.
discussed with and ok deraadt@
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
library routines. The manpage declares, in bold:
The brk() and sbrk() functions are historical curiosities left over from
earlier days before the advent of virtual memory management.
In our base tree, only one program uses these functions -- cc1 in the
gcc toolset. A historical curiosity using a historical curiosity, how
quaint. brk is used because precompiled c headers are not position
independent. Another program which relies upon brk is emacs. Other
uses of brk are EXCEEDINGLY RARE, because most software grew up and
use modern practices such as malloc and mmap, thereby gaining ASLR
benefits. Position independence has become an important part of
mitigations. These two programs fight such improvements.
Permitting brk/sbrk allows the large attack surface of cc1 to be pledged.
"I would rather have cc1 pledged than purity in pledge" guenther
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
| |
thrkill(2), rolling the kill(2) syscall number with the ABI change to
avoid breaking binaries during during the transition. thrkill(2) includes
a 'tcb' argument that eliminates the need for locking in pthread_kill()
and simplifies pthread_cancel(). Switch __stack_smash_handler() to use
thrkill(2) and explicitly unblock SIGABRT.
Minor bump to both libc and libpthread: make sure you install a new kernel!
ok semarie@
|
| |
|
|
| |
ok deraadt@
|
| | |
|
| |
|
|
|
|
| |
so that all pledged programs would get it instead of only ones with PLEDGE_GETPW.
ok deraadt@
|
| |
|
|
|
|
| |
window for chatting to ypserv. This can be done in pledge_namei, so
improve system call performance by removing the pledge_aftersyscall hook.
ok semarie
|
| |
|
|
|
| |
allow signals to any thread (they'll be checked within process later).
guenther also notes the pid check should be process pid, not proc pid.
|
| |
|
|
|
|
| |
(semblable diff proposed by Peter J. Philipp)
"no problem" deraadt@
|
| |
|
|
|
|
|
|
|
|
| |
pledgenote is used for annotate the policy for a namei context. So make it
tracking the nameidata.
It is expected for the caller to explicitly define the policy. It is a kernel
bug to not do so.
ok 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@
|
| |
|
|
|
| |
PLEDGE_ALWAYS.
ok semarie
|
| |
|
|
|
|
|
| |
- use a proper name PLEDGE_ALWAYS (suggested by derradt@)
- unify the check for allowing it in order to allow all of them
ok deraadt@
|
| |
|
|
| |
It is just risk, risk, risk, risk. Is there anyway to unify them?
|
| |
|
|
| |
consumers have been found. Spotted by Nathanael Rensen
|
| | |
|
| |
|
|
|
| |
and similar usage cases. Should provide abit more clarity for those
who read the kernel code.
|
| | |
|
| |
|
|
| |
possible due to the move of failing case later.
|
| |
|
|
|
|
|
|
|
|
|
| |
the previous check in pledge_namei() was incomplete. For using SYS_chroot we
needed "id", and we could have passed pledge_namei() just with "rpath" (without
using the now removed whitelisted entry).
the check for "rpath id proc" is now done using p_pledgenote: pledge_namei()
will check that the pledgenote is permitted by your pledge.
"go ahead" deraadt@
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
- remove all explicit checks that ensure p_pledgenote have counterpart in
ps_pledge by one unique check. It makes management of explicit whitelisted
operations on some paths more simple to manage. And now, we can use
p_pledgenote for more fined checking in namei usage.
- add special case for unsetted p_pledgenote: the behaviour is the same as
previously (we allow the operation with "rpath", "wpath" or "cpath" request)
but it should be changed soon to be more strict.
"go ahead" deraadt@
|
| |
|
|
| |
error currently is ENAMETOOLONG), so don't use p_pledgenote when failing.
|
| |
|
|
| |
processing.
|
| | |
|
| |
|
|
|
| |
suspect everyone has upgraded through the approx week-long window since
SOCK_DNS became available and the libc resolver started using them.
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
|
|
| |
no pledge to recommend.
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
- for PLEDGE_FATTR: the code is more accurate to be PLEDGE_FATTR, has
p->p_pledgenote could have multiple bits inside, and it is the lake of
PLEDGE_FATTR that make the check fail.
- for PLEDGE_RECVFD and PLEDGE_SENDFD, change the error to be EINVAL: we fail,
not because of lake of PLEDGE_RECVFD / PLEDGE_SENDFD permission, but because
the value passed is invalid in pledged program (for example trying to send a
VDIR).
"go ahead" deraadt@
|
| |
|
|
|
|
| |
provide the required pledge request for pledge_fail().
ok deraadt@
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
used less than "stdio" -- include all the "self" operations. Instead of
different defines, use regular PLEDGE_* in the "p_pledgenote" variable
(which indicates the operation subtype a system call is performing). Many
checks before easier to understand. p_pledgenote can often be passed
directly to ktrace, so that kdump says:
15565 test CALL pledge(0xa9a3f804c51,0)
15565 test STRU pledge request="stdio"
15565 test RET pledge 0
15565 test CALL open(0xa9a3f804c57,0x2<O_RDWR>)
15565 test NAMI "/tmp/testfile"
15565 test PLDG open, "wpath", errno 1 Operation not permitted
with help from semarie, ok guenther
|
| |
|
|
|
| |
found the first case of "get allowed, set not allowed". Tiny
refactoring of that.
|
| |
|
|
|
|
|
| |
mainly move read/write whitelisted paths that should be *before* checking if
you have PLEDGE_WPATH.
with and ok deraadt@
|
| |
|
|
| |
hit by czarkoff
|
| |
|
|
|
| |
TMN_WPATH or both are set in p_pledgenote. Matches the style used
for /dev/tty special cases (among others). From deraadt@
|
| |
|
|
| |
ok deraadt
|
| | |
|
| |
|
|
|
|
|
|
| |
mappings. This will be used by if_nameindex(3), if_nametoindex(3) and
if_indextoname(3) soon to fix the issues in pledge because of inet6 link
local addressing.
OK mpi@ benno@ deraadt@
The libc version will follow soon so better start updating your kernels
|
| |
|
|
|
|
|
| |
ps-style programs (there are quite a few in the tree, including tmux).
"vminfo" exposes a bit more system operation information, which many
observation programs want (such as top). settime allows setting the system
time, and will be used to pledge-protect the last ntpd process.
|
| | |
|
| |
|
|
| |
With benno
|
| |
|
|
| |
Discussion with nicm.
|