| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
| |
|
|
|
|
|
|
|
|
|
|
| |
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@
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
| |
in unp_internalize and unp_externalize.
ok kettenis guenther
|
|
|
|
|
| |
is a RPATH|WPATH operation.
Discussed with doug and millert
|
|
|
|
|
|
| |
strict than anticipated. It allows a programmer to pledge/promise/covenant
that their program will operate within an easily defined subset of the
Unix environment, or it pays the price.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
{Free,Net}BSD
- when a socket is closed with fds in its input, defer closing them to
a task to avoid recursing. This eliminates the complicated extra
reference taking which had a 37 line(!) comment explanation
- move flags, counts, and links only needed for this from struct file to
struct unpcb
- document the flow of the mark/sweep collector
much help from claudio@ who made me explain the GC to him until we trusted it
ok claudio@ mpi@ deraadt@
|
|
|
|
|
|
|
|
|
|
|
|
| |
The pathlist is a whitelist of dirs and files; anything else returns ENOENT.
Recommendation is to use a narrowly defined list. Also add TAME_FATTR, which
permits explicit change operations against "struct stat" fields. Some
other TAME_ flags are refined slightly.
Not cranking libc now, since nothing commited in base uses this and the
timing is uncomfortable for others. Discussed with many; thanks for a
few bug fixes from semarie, doug, guenther.
ok guenther
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
tests reported an EMSGSIZE error although the sent message was not
too large. The way backpressure was implemented for unix domain
sockets confused the check in sosend().
Unix domain sockets append data only to the recv buffer. To report
the amount of content to the sender, the high watermark of the send
buffer was reduced. This happend for SOCK_STREAM and SOCK_SEQPACKET.
Sosend checks wether atomic chunks could ever fit into the send
buffer which is limited by the high watermark. This happens for
SOCK_DGRAM and SOCK_SEQPACKET. For SOCK_SEQPACKET the combination
of these mechanisms resulted in an EMSGSIZE error when the buffer
got filled. This also happened when space could be created by
reading from the other end in contradiction to the semantics of
EMSGSIZE.
Do not emulate a send buffer that has no space. It is better to
fill the buffer with fake data than to reduce its size. Thus the
high watermark always contains the real value. When disconnecting,
reset the counters. Otherwise the socket layer would try to flush
non existing data in the send buffer.
Tested by jeremy@ with a C program and the ruby tests.
OK markus@ jeremy@
|
|
|
|
|
|
|
|
| |
and a count instead of calling the callback on each one, while also renders
the 'dispose' argument superfluous.
Move unp_*() prototypes from <sys/un.h> to <sys/unpcb.h>
ok claudio@ mpi@
|
|
|
|
|
|
|
|
| |
compatibility with 4.3BSD in September 1989.
*Pick your own definition for "temporary".
ok bluhm@, claudio@, dlg@
|
|
|
|
|
| |
a SLIST.
OK mpi@ benno@
|
| |
|
|
|
|
| |
ok doug tedu
|
|
|
|
|
|
|
| |
when creating them: pipe2(), dup3(), accept4(), MSG_CMSG_CLOEXEC,
SOCK_CLOEXEC. Includes SOCK_NONBLOCK support.
ok matthew@
|
| |
|
| |
|
|
|
|
| |
after discussions with beck deraadt kettenis.
|
|
|
|
|
|
| |
pr->ps_mainproc->p_pid to get the PID.
ok matthew@
|
|
|
|
|
|
|
| |
leaking values in the padding bytes on LP64. Also, vn_stat() was lacking
the zero-fill to clean its padding.
ok kettenis@ deraadt@ phessler@
|
| |
|
|
|
|
|
|
| |
leaving us with a free type function that isn't atomic. deal with this
by erasing any reachable pointers to the vnode first, then free it.
ok deraadt guenther
|
|
|
|
|
|
|
|
| |
get{sock,peer}name() behave like accept() when the involved UNIX-domain
socket isn't bound to an address, returning an AF_UNIX sockaddr
with zero-length sun_path. Based on diff from robert@ and mikeb@
ok robert@ deraadt@
|
|
|
|
|
| |
pointer array; we can access it directly.
ok guenther
|
|
|
|
|
|
| |
shared between processes.
ok djm@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- Require sun_family to be set to AF_UNIX (also in unp_connect())
- Ensure internal sockaddr_un's always have their length set to
sizeof(struct sockaddr_un) regardless of the user specified length,
implicitly extending with NUL characters as necessary.
- Normalize sun_path to never contain a non-NUL character after a
NUL character.
Lack of NUL termination on truncated sockaddrs issue pointed out by
Michael Kerrisk on the Austin Group mailing list.
ok millert
|
|
|
|
| |
ok deraadt, miod, guenther
|
|
|
|
|
|
| |
that leaks all the file pointers. Instead make sure that the exit path via
restart: -> out: does not free the uninitialized pointer.
OK deraadt@ guenther@
|
| |
|
|
|
|
| |
ok deraadt@
|
| |
|
|
|
|
|
| |
valid after that. Copy the data into a temp buffer and then copy it back
into the shiny new cluster. Problem found by deraadt@. Ok deraadt@
|
| |
|
|
|
|
|
| |
losing them.
ok claudio
|
| |
|
|
|
|
|
|
| |
during CMSG_DATA SCM_RIGHTS fd transfers. If this is exceeded,
return EMFILE.
ok claudio guenther gilles
|
|
|
|
| |
ok claudio@
|
|
|
|
|
|
| |
that *some* char in sun_path is NUL, not necessarily the last.
ok claudio@ tedu@
|
|
|
|
|
| |
and that it is nul terminated. This means the longest path is now 103
char longs. With and OK guenther@
|
|
|
|
|
|
|
|
| |
move those flags to f_iflags; This makes rooms in the
flag member of struct file for some goodies matthew@
as planned.
ok matthew@, deraadt@.
|
|
|
|
|
|
|
| |
they're tightly bound to struct filedesc, leading to NULL derefs
during exit1().
ok henning@, millert@, kettenis@
|
|
|
|
|
| |
can go away
ok guenther
|
|
|
|
|
|
| |
so that we remember to remove it all at the same time in two years.
ok deraadt@
|
| |
|
|
|
|
| |
thread. Discussion with guenther.
|
|
|
|
|
|
|
| |
getpeereid(2), but also supplies the remote pid. This is supplied in
a 'struct sockpeercred' (unlike Linux -- they showed how little they
know about real unix by calling theirs 'struct ucred').
ok guenther ajacoutot
|
|
|
|
| |
the receiving side when passing fd's. ok deraadt@ kettenis@
|