summaryrefslogtreecommitdiff
path: root/sys
AgeCommit message (Collapse)Author
2015-10-23Introduce a new sysctl NET_RT_IFNAMES that returns only ifnames to ifindexClaudio Jeker
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
2015-10-23Zap pv allocation abstraction layer.Mark Kettenis
ok mlarkin@
2015-10-23Fix uvm_object reference counting. While these reference counts aren't reaalyMark Kettenis
used (ttm bo's have their own reference counts), we can't let the reference count go negative as this will freak out the upper uvm layers. Since the uvm_object reference count is still a useful debugging tool (ddb will display it for example), adjust it such that the uvm_object reference count represents the number of references held by the uvm layer. tested by matthieu@ ok jsg@
2015-10-23enable viornd on RAMDISK_CDMike Larkin
ok kettenis@, deraadt@
2015-10-23pass the right sizes to free.David Gwynne
2015-10-23inline the hfsc_active TAILQ.David Gwynne
make cl_actc in hfsc_class a TAILQ rather than a pointer to a TAILQ that gets allocated seaprately.
2015-10-23inline the hif_eligible TAILQ.David Gwynne
make hif_eligible in hfsc_if a TAILQ rather than a pointer to a TAILQ that gets allocated separately. "look ma, i saved 4 or 8 bytes"
2015-10-23counting packets in hif_packets in hfsc_if is redundant.David Gwynne
the ifqueue struct has the same information, and hif_packets is never read separately. trim it.
2015-10-23tweak the vnetid so it can be optional and therefore cleared/deleted.David Gwynne
the abstract vnetid is promoted to a uin32_t, and adds a SIOCDVNETID ioctl so it can be cleared. this is all because i set an assignment on implementing a virtual network interface and the students got confused when vnetid 0 didnt show up in ifconfig output. the vnetid in the vxlan(4) protocol is optional, but the current code confuses 0 with no vnetid being set. this makes it clear. ok reyk@ who also simplified my diff
2015-10-23Add 3 new pledge requests. "ps" exposes enough sysctl information forTheo de Raadt
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.
2015-10-23remove the pointer from hfsc_class structs back to hfsc_if.David Gwynne
you get to hfsc_class via a hfsc_if, so just pass the hfsc_if around on the stack when we need it rather than following the pointer back. most of this change is passing the hif on the stack. ok mpi@ henning@
2015-10-23Allow hw.ncpu sysctl (a few reasons showed up in my mailbox rapidly..)Theo de Raadt
2015-10-23replace pointer arithmetic and casts with offsetofJonathan Gray
ok mpi@ bluhm@
2015-10-23replace pointer arithmetic and casts with offsetofJonathan Gray
ok dlg@ krw@
2015-10-22Build boot blocks with -msmall-data -msmall-text.Miod Vallat
2015-10-22Drop historical comment and an old '#if notyet'.Martin Pieuchot
2015-10-22Kill link_rtrequest(), introduce in 1990 to "fix" the resultMartin Pieuchot
of rt_getifa() when adding link level route from outside the kernel. ok claudio@
2015-10-22Use only one refcounting mechanism for route entries.Martin Pieuchot
ok bluhm@, dlg@, claudio@
2015-10-22Only check for rt_ifp now that it is alays the same as rt_ifa->ifa_ifp.Martin Pieuchot
ok millert@, bluhm@
2015-10-22Make sure that the address matching the key (destination) of a routeMartin Pieuchot
entry is attached to this entry. ok phessler@, bluhm@
2015-10-22Use rt_ifp instead of rt_ifa->ifa_ifp.Martin Pieuchot
ok bluhm@
2015-10-22Kill dead code, ifa is specified and won't change.Martin Pieuchot
ok bluhm@
2015-10-22Inspired by satosin(), use inline functions to convert sockaddr dl.Alexander Bluhm
Instead of casts they check wether the incoming object has the expected type. So introduce satosdl() and sdltosa() in the kernel. OK mpi@
2015-10-22Do not pass an ``ia'' just to dereference ``ia_ifp''.Martin Pieuchot
ok claudio@, bluhm@, jsg@
2015-10-22remove some horrible iwm typedefsJonathan Gray
ok stsp@
2015-10-22Further study shows "route" should allow all address families in NET_RT_DUMPTheo de Raadt
With benno
2015-10-22Do not dereference ``ifa_ifp'' when we already have an ``ifp'' pointer.Martin Pieuchot
2015-10-22After some consideration, simply allow TIOCSCTTY in the "tty" pledge.Theo de Raadt
Discussion with nicm.
2015-10-22Do not dereference ``ia_ifp'' when we already have an ``ifp'' pointer.Martin Pieuchot
2015-10-22Use rt_ifp as intended.Martin Pieuchot
During s2k15 we fixed this ugly 20+ years loopback hack of having a rt_ifp different than rt_ifa->ifa_ifp. ok millert@, bluhm@
2015-10-22Kill dead code missed in per-ifp counter removal.Martin Pieuchot
ok millert@, bluhm@
2015-10-22rename ml_join to ml_enlist and expose it to the rest of the kernel.David Gwynne
2015-10-21Setting fcntl(F_SETOWN) for a pipe failed with inappropriate ioctlAlexander Bluhm
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@
2015-10-21Return the correct error code when a table already exists.Martin Pieuchot
2015-10-21u_short -> unsigned int for rtableid.Martin Pieuchot
2015-10-21Do not call uvm_swap_finicrypt_all() a second time in dumpsys().Martin Pieuchot
ok tedu@, deraadt@, miod@
2015-10-20add a new getsockopt option IP_IPDEFTTL to retrieve the default ttl.Sebastian Benoit
this can be used as an alternative to sysctl net.inet.ip.ttl, in programs that use pledge(). ok reyk@, "Like this" deraadt@
2015-10-20At guenther's suggestion replace dnssocket() with a SOCK_DNS flag onTheo de Raadt
socket(). Without pledge, all other socket behaviours become permitted, except this one case: connect/send* only works to *:53. In pledge mode, a very few are further restricted. Some backwards compatibility for the dnssocket/dnsconnect calls will remain in the tree temporarily so that people can build through the transition. ok tedu guenther semarie
2015-10-20Add SIOCGIFGMEMB to "route" (returns a list of all interfaces who areReyk Floeter
member of the given group). This is used by some parse.y. OK deraadt@
2015-10-20Fix 802.1p VLAN priority code points for VLAN_HWTAGGING.Christopher Zimmermann
Our in-kernel ether-vtag has a different layout to the vr TXSTAT register. ok sthen@
2015-10-20clear whitelisted-paths view in pledge.Sebastien Marie
the following diff adds a clear view of whitelisted-paths in pledge. before, whitelisting "/usr/local/bin" path would make only "/usr/local/bin" VNODE was present and let "/usr/local", "/usr", and "/" been ENOENT. It was a somehow odd filesystem hierarchy, and it breaks realpath(3). with this diff, the directories that are one of the parents of a whitelisted-directory become visible to stat(2) related syscalls, but only with restricted permissions: stat(2) will lie a bit, and saying they owned by root:wheel and mode is --x--x--x. Note that only stat(2) is affected by this "view", and the owner/mode aren't effectively changed: it is just a "lie". while here, refactor a bit pledge_namei() in order to avoid multiple for-loop on whitelisted-path array. ok deraadt@
2015-10-20allow SO_ERROR all the timeTheo de Raadt
2015-10-20Always allow the setsockopt & getsockopt system calls... however, in theTheo de Raadt
default case only allows SOL_SOCKET SO_RCVBUF which is very common in network-facing daemons. Many of them manage this on a socket after dropping abilities which can get them _new_ sockets.. syslogd, bgpd, relayd, etc etc. Other sockopts still require specific pledges. Tested by bluhm.
2015-10-19Enable some code that does power management magic.Mark Kettenis
2015-10-19Properly restore the prefetchable memory window upon resume.Mark Kettenis
ok deraadt@
2015-10-19Allow setpriority in "proc" as well, since a few shells have "nice"Theo de Raadt
builtin. make a note that setpriority() should be weakened, unless "id" is also present. pointed out by Theo Buehler
2015-10-19Revert transfer submission to r1.85. Seems to make okan@'s scannerMartin Pieuchot
work properly.
2015-10-19Print vnode type for sendfd/recvfd not file type, ok semarieNicholas Marriott
2015-10-19Stop checking for RTF_UP directly, call rtisvalid(9) instead.Martin Pieuchot
While here add two missing ``rtableid'' checks in in6_selectsrc(). ok bluhm@
2015-10-19Stop checking for RTF_UP directly, call rtisvalid(9) instead.Martin Pieuchot
While here add a missing ``rtableid'' check in in_selectsrc(). ok bluhm@