summaryrefslogtreecommitdiff
path: root/sys
AgeCommit message (Collapse)Author
2015-10-17Add pledge "id" support. This request permits setuid/seteuid/setresuid,Theo de Raadt
setgid/setegid/setresgid, setgroups, setlogin, and setpriority. setrlimit and getpriority are also allowed (they are also in "proc") some of these were previously permitted in "proc" but have been removed. this seperation is intentional. "proc" is intended for reasoning about the relationship of a process "with other processes", whereas "id" deals the powerful/dangerous concept of unix ids. "id" will see some action very soon. ok gilles tedu semarie doug
2015-10-17Allow a few 'get' ioctls for pledge("route"). route6d will soon use this.Jeremie Courreges-Anglas
ok deraadt@
2015-10-16Also allow 6 as a miblen for NET_RT_DUMP, not all users specify a rtable.Jeremie Courreges-Anglas
ok deraadt@
2015-10-16Make sched_barrier() use its own task queue to avoid deadlocks.Martin Pieuchot
Prevent a deadlock from occuring when intr_barrier() is called from a non-primary CPU in the watchdog task, also enqueued on ``systq''. ok kettenis@
2015-10-16Repair the pty check for kernels without pty support.Theo de Raadt
2015-10-16Allow PTMGET with "tty rpath wpath" but restrict only to /dev/ptm byNicholas Marriott
checking cdevsw. ok deraadt
2015-10-16Always allow a r/w opening of /dev/null though the namei check. ThisTheo de Raadt
pattern is common, especially because of daemon(3) usage. Will probably help some daemons move their pledge() calls further upwards. ok doug,
2015-10-16delete pledge_bind_check() function and remove pledge_bind_check() call from ↵Sebastien Marie
sys_bind(). bind(2) still require PLEDGE_INET or PLEDGE_UNIX in order to be called, due to SYS_bind entry in pledge_syscalls array. The diff restores also the ability for PLEDGE_UNIX to call bind(2) (pledge_bind_check function missed that). problem spotted by doug@ OK deraadt@
2015-10-16Place TIOCSTI reminder block betterTheo de Raadt
2015-10-16For "tty" pledges, treat TIOCGPGRP and TIOCGWINSZ like TIOCGETA -Theo de Raadt
returning ENOTTY instead of killing the process.
2015-10-16Implement real "flock" request and add it to userland programs thatTodd C. Miller
use pledge and file locking. OK deraadt@
2015-10-16If a DOWN route entry is passed to a L2 output function, be dumb andMartin Pieuchot
simply use it. In most of the cases doing a route lookup at this point is a noop as it will return you the same DOWN entry you already have. The exception is the case where the route has been removed from tree since your kernel looked for it. So what? It's just a blue packet. Note that this "exception" can only happen if your sending path does not run under the KERNEL_LOCK. ok mikeb@
2015-10-16Put some iwm(4) debug code into #ifdef IWM_DEBUG.Stefan Sperling
ok mpi@
2015-10-16Clean up iwm(4) scanning logic a bit: Reset sc_scanband in callers ofStefan Sperling
iwm_mvm_scan_request() and always call ieee80211_end_scan() when done. ok mpi@
2015-10-16Oops, committed old version of previous diff with a typo in it: NLL -> NULLStefan Sperling
2015-10-16In iwm(4), correctly size and map the mbuf used for large firmware commands.Stefan Sperling
Fixes occasional firmware errors while bringing the interface up or scanning. ok phessler@
2015-10-16FIOSETOWN/FIOGETOWN were added to "ioctl", but study finds no programsTheo de Raadt
currently needing them. delete 'em for now. ok doug
2015-10-16Add TIOCCBRK and TIOCSDTR to the whitelist for pledge ioctl.Doug Hogan
cu(1) uses these. ok deraadt@
2015-10-15When using a pf rule with both nat-to and rdr-to, it could happenAlexander Bluhm
that the nated source port was reused as destination port. Do not initialize nport at the beginning of the function, but where it is needed. OK sashan@
2015-10-15No need to create links for xxboot now that MI installboot is the preferredMiod Vallat
way to install boot blocks.
2015-10-15Add TIOCFLUSH to "tty" in support of tcflush()Theo de Raadt
2015-10-15Exposing FIOASYNC in pledge "ioctl" is a mistake; remove it, cannot find ↵Theo de Raadt
safe uses of it
2015-10-15Let the rx path of cnmac run without the kernel lock. To avoid the needVisa Hankala
of a mutex, the path no longer cleans up the queue of tx requests. ok mpi@
2015-10-15Fix previous. The port number is not included in sc_src and it isYASUOKA Masahiko
checked already at beginning of the loop. ok reyk
2015-10-15in6_pcbconnect() returns EADDRNOTAVAIL whenVincent Gross
all the ports in the range portfirst .. portlast are in use. ok millert@, mpi@
2015-10-15FIOCLEX & FIONCLEX should be in base ioctl setTheo de Raadt
2015-10-15avoid using a var uninitialisedJonathan Gray
ok jung@
2015-10-14FALTHROUGH->FALLTHROUGH in comment, ok deraadt a few days agoStuart Henderson
2015-10-14Add a dummy "flock" request that will allow file locking. It isTodd C. Miller
not currently enforced but we want the kernel to be able to parse it for an upcoming diff in the next few days.
2015-10-14When pledged with "fattr", allow chown to supplimentary groups. ThisTheo de Raadt
came out of a discussion regarding "sort foo -o foo". ok semarie
2015-10-14Init a variable in the recently added carp_vhe_match() function clangJonathan Gray
and mpi believe could be used uninitialised. ok mpi@
2015-10-14Reset the RTF_CONNECTED flag when cloning an entry.Martin Pieuchot
While here check for RTF_CLONED insted of RTM_RESOLVE when adding an entry. Found while debugging naddy@'s NFS vs em(4) vs rtisvalid(9) issue.
2015-10-14Rewrite the logic around the dymanic array of routing tables to helpMartin Pieuchot
turning rtable_get(9) MP-safe. Use only one per-AF array, as suggested by claudio@, pointing to an array of pointers to the routing table heads. Routing tables are now allocated/initialized per-AF. This will let us allocate routing table on-demand instead of always having an AF_INET, AF_MPLS and AF_INET table as soon as a new rtableID is used. This also get rid of the "void ***" madness. ok dlg@, jmatthew@
2015-10-14pledge "tty" can allow ioctl TIOCEXCL on a ttyTheo de Raadt
2015-10-14sendmsg() is allowed to pass cmsg's which are not CMSG_RIGHTS - lastTheo de Raadt
refactoring inverted the checks; spotted by sthen in ping6.
2015-10-13Prevent a NULL-pointer dereference when closing a ugen(4) nodeMartin Pieuchot
in case the kernel failed to change the interface of a device. Found the hardway by okan
2015-10-133 more headers required for one stinking inet6 ioctl..Theo de Raadt
2015-10-13- pf_insert_src_node(): global argument (arg6) is useless, functionAlexandr Nedvedicky
always gets pointer to rule. - pf_remove_src_node(): function should always remove matching src node, regardless the sn->rule.ptr being NULL or valid rule - sn->rule.ptr is never NULL, spotted by mpi and Richard Procter _von_ gmail.com OK mpi@, OK mikeb@
2015-10-13Allow ioctl SIOCGNBRINFO_IN6 in case of "route", for use by ndp.Theo de Raadt
2015-10-13NET_RT_FLAGS must also accept a proto selection.Theo de Raadt
2015-10-13allow getsockopt IP_RECVDSTPORT & IPV6_RECVDSTPORT for an "inet" pledgeTheo de Raadt
2015-10-13Make use of rtisvalid(9) to check if local route entries match existingMartin Pieuchot
configured addressses. ok mikeb@
2015-10-13Simplify arptfree() to no longer look at the route entry's refcounter.Martin Pieuchot
ARP entries with an expired timeout are now removed from the tree even if they are cached somehwere else. This also reduces differences with NDP. ok bluhm@
2015-10-13Use rtisivalid(9) to check if the given (cached) route can be used.Martin Pieuchot
Note that after calling rtalloc(9) we only check if a route has been returned or not and do not check for its validity. This cannot be improved without a massive refactoring. The kernel currently *do* use !RTF_UP route due to a mismatch between the value of ifp->if_link_state and the IFF_UP|IFF_RUNNING code. I'd explain the RTF_UP flag as follow: . If a cached route entry w/o RTF_UP is passed to ip{6,}_output(), . call rtalloc(9) to see if a better entry is present in the tree. This is enough to support MPATH and route cache invalidation. ok bluhm@
2015-10-13Make sure RTF_LOCAL route entries are UP when added to the tree.Martin Pieuchot
This is required to maintain the original BSD behavior of locally configured addresses being always reacheable. Some interfaces are^w^W^Wem(4) is special and generally has a DOWN link state when configured by netstart(8). As a result all the route entries cloned/added before its link state goes to UP are also marked as DOWN. Note that this problem was not present when local addresses were attached to lo0. ok mikeb@
2015-10-13Initialize va_filerev in vattr_null() to avoid leaking stack garbage;Philip Guenther
problem pointed out by Martin Natano (natano (at) natano.net) Also, stop chaining assignments (foo = bar = baz) in vattr_null(). The exact meaning of those depends on the order of the sizes-and- signednesses of the lvalues, making them fragile: a statement here mixed *six* types, but managed to get them in a safe order. Delete a 20+ year old XXX comment that was almost certainly bemoaning a bug from when they were in an unsafe order. ok deraadt@ miod@
2015-10-13Add some newer DT_* and DF_* constantsPhilip Guenther
ok kettenis@ miod@
2015-10-13Pledge "fattr" request should allow fchflags().Doug Hogan
"add it" deraadt@
2015-10-12pledge "proc" request should allow setsid()Theo de Raadt
2015-10-12Remove the "cmsg" attribute, as promised. Use "sendfd" or "recvfd",Theo de Raadt
depending on what you need. inet/inet6 cmsg's come through unmolested -- that is something to consider later.