summaryrefslogtreecommitdiff
path: root/sys/kern
AgeCommit message (Collapse)Author
2015-12-05Study of kernel code complete. Permit ioctl SIOCGIFMEDIA for pledgeTheo de Raadt
"route", which krw and mestre will be able to use in dhclient(8).
2015-12-05remove stale lint annotationsTed Unangst
2015-12-04allow utrace(2) by default.Theo de Raadt
conversation with jsg
2015-12-04remove PLEDGE_INET granting when using "getpw" in YP environnmentSebastien Marie
it makes PLEDGE_YPACTIVE enough for doing required networking with YP. It should permit to bring YP internals into the light. discuted with deraadt@
2015-12-04Add pledge "dpath", which provides access to mknod(2) and mkfifo(2).Theo de Raadt
This will be required to keep pax/tar/cpio at otherwise very high levels of pledge (and we will see where else it is beneficial). Allocate a bit for pledge "audio", which will be coming soon. good discussions with semarie
2015-12-04Do not think atomicity is required here. In any case, prepare forTheo de Raadt
ps_pledge to become 64-bits over the next few days (things are getting a bit tight; most newer pledges will be quite device-driver specific)
2015-12-03remove code that's been #ifdef'ed out for 20 yearsBret Lambert
ok deraadt@
2015-12-03Remove the /usr/share/nls/ exception from pledge(2). The libcAlexander Bluhm
native language support was deleted a month ago at u2k15. OK semarie@ deraadt@
2015-12-03pledge(pf) needs to allow DIOCKILLSRCNODES, used in relayd.Sebastian Benoit
ok deaadt@
2015-12-01solbourne went awayTheo de Raadt
2015-12-01Send Aviion to same place as Nova IITheo de Raadt
discussed with jsg
2015-11-29On a SMALL_KERNEL, pledge "pf" has to be a no-op. We cannot matchTheo de Raadt
the device node (since it does not exist...)
2015-11-29Add pledge "pf" which allows ioctls on pf(4). This will be used bySebastian Benoit
relayd and other programs manipulating the packet filter. ok deraadt@
2015-11-28move buffer size adjustment to buf_adjcnt - from Walter NetoBob Beck
ok mpi@
2015-11-28pledge: allow getsockopt IP_IPDEFTTL with promise inetSebastian Benoit
then relayd's host check engine can be pledged. ok reyk@, approach suggested by deraadt@ weeks ago.
2015-11-27Two additional ioctls for pledge("disklabel"), needed by installboot.Jeremie Courreges-Anglas
Committing on behalf of tb@, problem reported by Rolf Sommerhalder on misc@.
2015-11-25permit kern.maxpartitionsTheo de Raadt
2015-11-24Add sendsyslog2(), which accepts the syslog/openlog "logopt" flagTheo de Raadt
LOG_CONS. If syslogd is not accepting messages, direct them to the console. This allows us to remove the direct /dev/console opening code from the bowels of libc. Of course, that forgotten code was exposed by pledge. ok kettenis millert beck
2015-11-24syncTheo de Raadt
2015-11-24Add sendsyslog2... this has an additional flags variable to permitTheo de Raadt
passing LOG_CONS ok millert kettenis beck
2015-11-23the "getpw" test for /dev/tty is only needed for readpassphrase(3),Theo de Raadt
getpass(3), so don't specifically allow it for "rpath" (rpath will accept it in the end, unless it is on the whitelist)
2015-11-23Do not include <sys/atomic.h> inside <sys/refcnt.h>.Martin Pieuchot
Prevent lazy developers, like David and I, to use atomic operations without including <sys/atomic.h>. ok dlg@
2015-11-23need sys/device.hTheo de Raadt
2015-11-22For "disklabel", allow sysctl mach.chr2kblk and ioctl BIOCINQ/BIOCVOLTheo de Raadt
also, to satisfy midlayers that some fs/install tools need.
2015-11-22"getpw" should also allow access to /etc/netidTheo de Raadt
discovered by rpe
2015-11-21Retire ml_requeue(9) and mq_requeue(9).Martin Pieuchot
As Kenjiro Cho pointed out it is very hard to cancel a dequeue operation for some queueing disciplines when such it keeps some internal states. As you can see, APIs can also Live Fast & Die Young. ok dlg@
2015-11-21remove completely pledge_socket() from listen(2) and accept(2).Sebastien Marie
with pledge_socket(p, -1, state) we only check for "dns" promise against SS_DNS socket. But it isn't possible to pass a SS_DNS socket to listen(2) or accept(2) (EINVAL). So this deeper check is a bit useless... ok deraadt@
2015-11-20Neuter the pledge domain checking for listen, getpeername, and getsocknameTheo de Raadt
also. The idea is much like rpath is with files, you get an fd and then you can play with it somewhat. In the socket space once you have a fd, you can play with it somewhat. So you cannot bind, but you can accept. You can listen, getpeername, getsockname, and of course set/getsockopt is somewhat available.. yes, this makes pledge the anti-capsicum, kind of like salt from Secovlje.. reasoning due to a conversation with tedu
2015-11-20Permit msync(2) in the "stdio" set; only a few programs use it relatedTheo de Raadt
to mmap, but thinking about it nothing feels risky Long discussions with florian
2015-11-20Add pledge "disklabel", which allows sysctl kern.rawpartition, aTheo de Raadt
few disklabel ioctls, and the DIOCMAP ioctl against /dev/diskmap used to translate duid numbers into partitions. This will allow pledging of at least 12 disk/filesystem aware programs; due to the negative impact that diff will wait a bit so everyone has a chance to update their kernels. ok semarie
2015-11-20Exempt accept(2) from the pledge_socket() check part of the "domain"Theo de Raadt
check. You cannot open a socket in a domain unless permitted -- but you need to be able to accept one if the code flow asks for that to happen. The most recent check is too tight. We may need to iterate the policy here until we hit the right vibe...
2015-11-20VISTTY check in revoke() is not working well for the non-indirectedTheo de Raadt
/dev/console case, so go back to doing the direct D_TTY check. signed over a few times with guenther
2015-11-20Fix whitespace. No binary change.Jonathan Gray
2015-11-19dont try and wakeup other threads to handle pending work when weDavid Gwynne
know there's only one thread in the taskq. wakeups are much more expensive than a simple compare. from haesbart
2015-11-19corrects leaks refs to files introduced by my previous commit for pledge_socket.Sebastien Marie
reported by Mateusz Guzik with a diff. this one is a slightly modified version. ok deraadt@
2015-11-18check domain and state of socket against pledge promise.Sebastien Marie
ok deraadt@
2015-11-18In sys_revoke, inspect the VISTTY flag on the backside of VOP_GETATTR,Theo de Raadt
because that shows the /dev/console translated vnode. You either already know the story, or you don't want to know.
2015-11-17backout removal of SYS_break from stdio, suggested by deraadt@Stuart Henderson
ports using base gcc with PCH include: boost, keepassx, wxWidgets, jdk
2015-11-17Allow sysctl kern.clockrate, kern.argmax, kern.ngroups, kern.sysvshm,Theo de Raadt
and kern.posix1version. Enough to satisfy getconf, and I hope we don't need to add much more after this. Largely from jca
2015-11-16Allow TIOCEXT in pledge "tty"Theo de Raadt
Discussed with millert
2015-11-16Permit revoke(2) for a pledge "rpath tty"Theo de Raadt
ok millert semarie tedu guenther
2015-11-16Only perform revoke(2) on tty cdevs. Others paths return ENOTTY.Theo de Raadt
ok millert semarie tedu guenther
2015-11-16In getdevvp() set the VISTTY flag on a vnode to indicate the underlyingTheo de Raadt
device is a D_TTY device. (Like spec_open, but this sets the flag to satisfy pre-VOP_OPEN situations) ok millert semarie tedu guenther
2015-11-16brk/sbrk's use case is way too narrow to be a default stdio pledge.Pascal Stumpf
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@
2015-11-14Add pathconf() to pledge "rpath"; ok guentherTheo de Raadt
2015-11-14For pledge "stdio", allow the break(2) system call which backends the brk/sbrkTheo de Raadt
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
2015-11-13All setsockopt IPPROTO_IPV6 IPV6_TCLASS (v4 calls this IP_TOS)Theo de Raadt
2015-11-13Use ph_ prefix for tag-related fields.Martin Pieuchot
ok dlg@
2015-11-12Prefix flowid with ph_ and print it in m_print().Martin Pieuchot
ok dlg@
2015-11-11ktrace vnodes do not need to be opened with FREAD, as they areTheo de Raadt
only written to. (Will keep an eye out for NFS surprises) ok guenther