summaryrefslogtreecommitdiffstats
path: root/src/privsep-inet.c
Commit message (Collapse)AuthorAge
* Rename Master to ManagerRoy Marples2021-02-02
|
* eloop: Make the API more like native poll/kqueue/epollRoy Marples2021-02-02
| | | | | | | | | Just have the one callback, but return an abstracted event mask to work out if we can read/write have something else. Log diagnostics if the event mask is unexpected. While here add more logging if we fail to register an event to monitor.
* A belated welcome to 2021Roy Marples2021-01-31
|
* privsep: Only start network proxy if we need toRoy Marples2020-10-07
| | | | Do this before starting it rather than it shutting down.
* privsep: Log if the platform sandbox is unavailable or availableRoy Marples2020-09-20
| | | | This is kinda important.
* privsep: Fold capsicum and pledge entry points into ps_entersandboxRoy Marples2020-09-19
|
* privsep: Only the master process accepts signalsRoy Marples2020-08-20
| | | | | The master process dictates when processes should stop, which allows for a clean shutdown when the admin issues `pkill dhcpcd`.
* privsep: Simplyfy signal handlingRoy Marples2020-06-16
| | | | | All privsep processes only need to act on SIGTERM. The privileged actioneer also needs to act on SIGCHLD.
* privsep: Don't handle any signals meant for the main processRoy Marples2020-06-16
| | | | Just incase someone issues a killall -HUP dhcpcd
* privsep: Limit rights generically rather than Capsicum specifcRoy Marples2020-06-05
| | | | | | | | | You never know when another sandbox tech comes around. While here, add limits for every socket in the unpriviledged processes. Some were absent before. Also, note that RLIMIT_NOFILE breaks our control socket so temporary disable that.
* privsep: Only open raw sockets for the needed protocols.Roy Marples2020-06-01
| | | | | Just warn about any errors rather than forcing an early exit as well. While here, fix startup if DHCPv6 disabled globally but enabled per if.
* privsep: Validate ICMP messages we send as wellRoy Marples2020-05-21
|
* privsep: Validate UDP portsRoy Marples2020-05-21
| | | | Just like we filter the ioctls.
* privsep: inet processes no longer need inet pledgeRoy Marples2020-05-20
|
* privsep: Enable Capsicum for all processes.Roy Marples2020-05-19
| | | | | | | | | | | | | | | | | Except for the priviledged process. This is quite an in-depth change: * ARP is now one process per address * BPF flags are now returned via privsep * BPF write filters are locked when supported * The root process sends to the network The last step is done by opening RAW sockets and then sending a UDP header (where applicable) to avoid binding to an address which is already in use by the reader sockets. This is slightly wasteful for OS's without sandboxing but does have the very nice side effect of not needing a source address to unicast DHCPs replies from which makes the code smaller.
* BPF: Set write filters where supportedRoy Marples2020-05-15
| | | | | While here make Capsicum and Pledge more granular so we can easily Pledge the BPF BOOTP process but not the ARP one.
* privsep: Handle all file IO in the Priviledged ActioneerRoy Marples2020-05-12
| | | | | | | | | | This allows us to move the database directory back into the root of the filesystem. While here, harden the files by denying any user read access to them. As part of this change, init the DUID from any machine data and cache the default DHCP vendor field before dropping priviledges as we may lose access to this later.
* privsep: Implement pledge(2) support as found on OpenBSDRoy Marples2020-05-10
|
* privsep: Enable capsicum for network facing processesRoy Marples2020-05-07
| | | | | | | All fd's in network facing processes are fully limited. Capability mode is only enabled for BPF processes because it's too restrictive otherwise - the reasons are noted in the commit.
* privsep: Remove unsued function.Roy Marples2020-05-07
|
* dhcpcd: Fix separation of per interface and per familyRoy Marples2020-04-23
| | | | While here improve privsep proess titles for this.
* privsep: Don't abort if we fail to init a protocol.Roy Marples2020-04-16
| | | | It's only an error if we cannot init anything.
* spelling: Correct both privilege and separationRoy Marples2020-02-10
| | | | Found by Arfrever.
* ioctl: The POSIX signature differs from BSD and glibcRoy Marples2020-01-08
| | | | | | | | | | BSD and glibc have the signature for request as unsigned long. musl and Solaris have a signed int. As such, we need to detect this at compile time and adjust the signature of our internal ioctl functions to match. To keep the onwire format the same, memcpy the request to the unsigned long request and back again, thus preserving the signedness.
* Welcome to 2020!Roy Marples2020-01-03
|
* privsep: guard spawn debug messages behind PRIVSEP_DEBUGRoy Marples2019-11-29
|
* privsep: Sprinkle some constRoy Marples2019-11-28
|
* Solaris: start privsep supportRoy Marples2019-11-29
| | | | Compiles but lacks support for DLPI and ioctl needs rework.
* privsep: Add support for priviledge separationRoy Marples2019-11-28
Not enabled by default - enable with ./configure --enable-privsep Requires a user added to the system - default _dhcpcd Several processes will be spawned off the main state engine: a privileged actioneer and a generic network proxy. Only the privileged actioneer process will retain root permissions. When required, the privileged actioneer will also spawn BPF listeners for BOOTP (DHCP) and ARP. The BOOTP BPF listener should be a short lived process. On kernels with RFC 5227 support, the ARP BPF listener will only be used for ARPing and announcing a preferred address and will also be a short lived process. When not running in master mode, an address listener will be spawned for each address (with the exception of RA dervived addresses) dhcpcd cares about. TODO: * Solaris support. * ARP BPF address filtering.