summaryrefslogtreecommitdiff
path: root/sbin
AgeCommit message (Collapse)Author
2024-02-11Remove needless includes of netinet6/ip6_var.h header in userland.Alexander Bluhm
OK millert@
2024-02-07fix anchortypes bounds testJonathan Gray
found by "buffer overflow 'anchortypes' 10 <= 12" smatch error feedback and ok sashan@, ok miod@ on an earlier version
2024-02-06Pass struct iked directly to ca_reset() instead of passing it via psTobias Heider
discussed with markus@
2024-02-06Tweak previous. Passing "dns" to pledge(2) is suitable for the purpose.YASUOKA Masahiko
input deraadt, ok tobhe
2024-02-03Remove Softdep.Bob Beck
Softdep has been a no-op for some time now, this removes it to get it out of the way. Flensing mostly done in Talinn, with some help from krw@ ok deraadt@
2024-02-03Stop spamming syslog when the network does something silly.Florian Obser
From Stefan R. Filipek, thanks!
2024-02-03fix off-by-one in bounds testJonathan Gray
found by "buffer overflow 'peerxfs' 6 <= 6" smatch error tobhe@ had a remote peer attempt a transform type of 6 and it is caught by earlier checks before getting here. ok tobhe@
2024-02-03correct buffer size argument to snprintf in print_proto()Jonathan Gray
found by "snprintf() is printing too much 8192 vs 1024" smatch error ok tobhe@ stsp@
2024-02-02The fix to pfctl_kill_src_nodes() comes from Olivier Croquin.Alexandr Nedvedicky
bluhm@ pointed out pfctl_net_kill_states() suffers from the same copy'n'paste typo. Commit combines both fixes. OK @bluhm, OK @kn
2024-01-29Open /etc/{services,protocols} before pledge(2).YASUOKA Masahiko
ok tobhe
2024-01-26Put checksum flags in bpf_hdr to use them in userland dhcpleased.Jan Klemkow
Thus, dhcpleased accept non-calculated checksums which were verified by hardware/hypervisor. With tweaks from dlg@ ok bluhm@ mkay tobhe@
2024-01-24Use per connection peerid for control repliesTobias Heider
instead of 'broadcasting' replies for 'ikectl show sa' and similar control requests, we now assign a uniq peerid to each request and pass this peerid between the processes so the reply can be sent on the matching connection. from markus@
2024-01-19Rename WSDISPLAY_TYPE_RKDRM to WSDISPLAY_TYPE_KMS such that we can use itMark Kettenis
for other generic KMS drivers. ok jsg@, matthieu@
2024-01-17Convert to use imsg_get_fd()Claudio Jeker
proc_forward_imsg() does not need to forward file descriptors so just use -1 there. In other places shuffle debug messages around or use a helper variable since imsg_get_fd() can only be called once. OK tb@ tobhe@
2024-01-15Add debug message for no policy found.Jan Klemkow
In this case iked would just silently drop incomming connections. Thus, the user has a chance to figure out whats going on. ok tobhe@
2024-01-15Include cert_partial_chain in iked_static instead of sending a separateTobias Heider
message. from markus@
2024-01-15Currently 'pfctl -a "*" -sr' recursively walks anchor tree and showsAlexandr Nedvedicky
rules found in every anchor. This commit introduces the same behavior for tables. Command 'pfctl -a "*" -sT' prints all tables attached to every anchor loaded to pf(4). Inconsistency has been noticed by Klemens (kn@). OK @bluhm, OK @kn
2024-01-11ifconfig.8: reorder hwfeature listJan Klemkow
ok jmc@
2024-01-09Delete support for FFS filesystems before the in-inode symlinkPhilip Guenther
optimization. As observed by ali_farzanrad(at)riseup.net, support for these was broken in the 5.5 release in early 2014 by the time_t changes. No one noticed before now, so clearly this isn't something we need to continue to support; rejecting in ffs_validate() is an improvement. Also: simplify DIRSIZ(), drop OLDDIRFMT and NEWDIRFMT, tests of fs_maxsymlinklen against zero, #ifdef tests of FS_44INODEFMT, and remove support for newfs -O0, last used in 2016. ok miod@
2023-12-21Fix a few unchecked allocations; ok millert@ miod@Otto Moerbeek
2023-12-20Don't unset the SA tag set by ipsec_sa_tag in ipsec_sa_iface.Tobias Heider
Fixes SA tagging and a possible leak. from markus@
2023-12-18Check if calloc calls succeeded; ok millert@Otto Moerbeek
2023-12-14Use imsg_get_fd() to access the fd passed with the imsg.Claudio Jeker
Go ahead florian@ OK tb@
2023-12-12ibuf_getdata() abuses the rpos from the ibuf. This is no longer allowedClaudio Jeker
and breaks because ibuf_seek() now uses rpos itself. Now this is just ibuf_get_ibuf() with an extra allocation done. OK tobhe@ tb@
2023-11-25whitespace; spotted by knFlorian Obser
2023-11-25First stab at IPv6-only preferred from RFC8925.Florian Obser
This lets dhcpleased(8) request "IPv6-only preferred". If the server replies with this option dhcpleased stops and does not request a lease and deconfigures IPv4 on the interface. For now this is pretty much useless unless one dynamically configures pf(4) to act as a CLAT. gelatod(8) from ports can help with this. However, this helps me while hacking on a kernel based stateless CLAT by moving dhcpleased out of the way while having an IPv6-mostly network configured to compare behaviour with macOS. Input jmc OK phessler Input & OK sthen
2023-11-24Empty IKEv2 DPD messages should not contain extra NONE payloadsTobias Heider
from markus@
2023-11-23add an endpoint command for "bridges" that use addresses as endpoints.David Gwynne
this can be used to add static entries on interfaces like vxlan(4).
2023-11-23add support for specifying ports on the src address in tunnel endpoints.David Gwynne
2023-11-18Scan past whitespace before checking if flag string startsKenneth R Westerback
with "0x". Pointed out by Philippe Meunier.
2023-11-17Do not log errors form pcap_dispatch() caused by signals.Claudio Jeker
pcap_dispatch() returns -1 (PCAP_ERROR) or -2 (PCAP_ERROR_BREAK) the latter is used when a signal is received and is not an error. So limit the code to log errors to np == -1. OK semarie@ sashan@
2023-11-12fix the signal numbers passed to siginterrupt.David Gwynne
from dhill@
2023-11-10GPT partitions have many attributes. Don't stomp on them all whenKenneth R Westerback
using 'flag <part #>' to make a partition the only bootable partition. Just turn off the bootable bit in the other partitions. ok dlg@
2023-11-10Enhance 'flag' to accept hex values in addition to the current 0Kenneth R Westerback
.. INT64_MAX decimal values.. Easier to specify the 64 bits of GPT partition attributes and 0x8000000000000000 (a.k.a. MS_NOAUTOMOUNT, a.k.a. 1 << 63) becomes accessable. Prompted by bug report and testing by Philippe Meunier. Thanks! ok dlg@
2023-11-10Always prefer group from initial KE payload as responder if supported.Tobias Heider
from markus@
2023-11-10MNT_SOFTDEP and mount -o softdep no longer have any effectIngo Schwarze
OK kn@ jmc@
2023-11-09avoid restartable syscalls with siginterrupt() against all our handlers.David Gwynne
pflogd uses blocking bpf reads, but installs a bunch of signal handlers to handle cleanly closing and (re)opening the log file. signal() by default sets the handlers up so they're restartable. this has the effect that when pflogd receives a signal while waiting in bpfread, the signal handler runs and sets a flag saying the file should be rotated or closed or whatever, but then the kernel restarts the read. when pflogd used a bpf read timeout, pflogd would run it's "event" loop every time the read timeout expired. this meant even though the bpf read was restarted, by having the read timeout expire every 500ms the flag the signal handlers set would be processed in a relatively short period of time. after moving bpf to a wait timeout, pflogd basically has to wait for a packet to be captured before the bpf read will return. if you're trying to kill pflogd on an idle firewall then you're basically stuck. making the signal handlers not restartable allows bpfread to fail with EINTR so pflogd can go around it's even loop and exit as expected. reported by Mikhail on bugs@ ok claudio@ pflogd needs a rewrite though.
2023-11-09sort .xr after previous; from jmcKlemens Nanni
2023-11-09link to showmount(8); OK deraadtKlemens Nanni
2023-11-03typo: ignorning -> ignoringTheo Buehler
From Laurie Tratt, ok florian
2023-11-02Use pfctl_fopen (which checks to ensure the given file isn't a directory)Stuart Henderson
for pfctl -f /path/to/pf.conf. Otherwise, if you accidentally use a dir instead of a file (e.g. if you have an /etc/pf directory and don't notice the name when tab-completing), you successfully install an empty ruleset. ok sashan@
2023-10-29Use clock_gettime(), not timespec_get() like other parts of ifconfig.Todd C. Miller
This makes is possible to build the base system with a C99 compiler. OK deraadt@ mvs@
2023-10-26whitespace cleanup my fingers couldn't avoid doing while i was re-readingTheo de Raadt
the parsing code
2023-10-10Print at most pkgsize - hdrsize bytes for pfkey tag and identity toTobias Heider
prevent out-of-bounds read in strlen(). ok tb@
2023-10-10Do not copy stack garbage, that's not going to be used.Florian Obser
Pointed out by gcc via tb. rdns_count is validated by all callers of propose_rdns(), so we can trust it here to be sensible. While here fix a pasto in an error message. OK tb
2023-10-09Add pledge("stdio") before parsing pfkey messages. This applies toTobias Heider
ipsecctl -m and ipsecctl -s. Refactor ipsecctl_show_*() to setup all sysctls first before dropping privileges and finally parsing and printing IPsec SAs and flows. feedback and ok mbuhl@ ok deraadt@
2023-10-07Retry on empty passphraseKlemens Nanni
They must not be empty, or else creation/unlock fails (and boot loaders would not be able to abort and drop back to the boot> prompt). [-p passfile] handles this with "invalid passphrase length", so align the interactive prompt and retry there. -s remains a one-shot whilst getting a better error message. This is user friendlier and fixes the last installer "bug" on my list wrt. disk encryption where hitting Enter twice at the passphrase prompt would abort bioctl(8) and thus the installation. OK deraadt
2023-10-06rename pass{word -> file} variableKlemens Nanni
It contains the path to the file containing a passphrase; password reads misleading and was also the only usage of "word" in contrast to consistent "phrase" usage.
2023-09-15Improve handling of ENOBUFS by not running in a tight loop forever.Florian Obser
This cherry-picks upstream git commit 0ee44ef384593ed0382d1ce6048d5a9c9440b45c. Issue reported by landry@, which could be traced back to a buggy WiFi driver that would constantly return ENOBUFS. This in turn lead unwind(8) enter a tight loop through poll / sendto without making any progress and burning 100% cpu. OK sthen I missed to commit this file when commiting to unbound. Pointed out by tb, thanks!
2023-09-14satisfy non-c99 compilersTheo de Raadt