summaryrefslogtreecommitdiff
path: root/sbin
AgeCommit message (Collapse)Author
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
2023-09-12Revert accidentally committed debugging codeTheo Buehler
confirmed by florian
2023-09-11Improve 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
2023-09-06explicitly cast ULLONG_MAX to double when comparing to a doubleRobert Nagy
ok krw@
2023-09-06remove unused variableJonathan Gray
2023-09-05Fix indentation, found with -Wmisleading-indentation.Florian Obser
Already commited upstream.
2023-09-05Prevent warnings from -Wmissing-prototypesFlorian Obser
https://github.com/NLnetLabs/unbound/pull/931
2023-09-05Fix built.Florian Obser
The api changed to handle cookies and extended error codes. Passing in NULL for config_file disables cookie handling so we do not need to pass a valid comm_reply, NULL will do.
2023-09-05sync to unbound 1.18.0; heavy lifting by sthenFlorian Obser
2023-09-05fix mismatching declaration of argument with mismatched boundsRobert Nagy
ok tb@
2023-09-02Make sure cert_type is not 0 to prevent leak of certid->id_buf.Tobias Heider
Found by David Linder ok patrick@
2023-09-02Remove unneccessary id == NULL check after dereferencing it. id can neverTobias Heider
be NULL here. Found by tb@
2023-09-02Use a hardware based number of KDF rounds by default for passphrasesKlemens Nanni
When creating new crypto volumes with a passphrase or updating one, pick a number of rounds that aims to take around 1s instead of just 16 (on X230 and T14 machines, 16 rounds unlock pretty much instantly). New default [-r auto] never decreases rounds, only explicit '-r N' can. 16 is the absolute minimum. Motivation is to provide a saner and more modern default, especially for fresh installations utilizing new disk encryption question. Prodding for new default from and OK jsing on early "-r auto" installer diff idea to to pick MAX(auto, old-rounds) from Lucas[AT sexy DOT is] "seems acceptable to me" deraadt Feedback kettenis sthen OK op
2023-08-21Retry passphrase on mismatch by defaultKlemens Nanni
Gracefully prompt again during interactive creation and passphrase change on CRYPTO/1C volumes when confirmation fails instead of exiting, so bioctl(8) behaves more like passwd(1) in this regard. Use -s aka. non-interactive scripting mode to try just once. Input OK jsing op
2023-08-21Print softraid(4) errors on standard errorKlemens Nanni
INFO messages remain on stdin, WARN/ERROR go to stderr as usual to make silencing and scripting bioctl(8) easier. OK op jsing
2023-08-18Make -s read passphrases without prompts or confirmationKlemens Nanni
-s for non-interactive usage disables prompts, but still silently expects two inputs, which is neither intuitive nor ergonomic. Fix this get sane scriptable behaviour and documentation. Feedback OK jsing op
2023-08-14Improve error message when if_indextoname() fails.Tobias Heider
2023-08-14Add explicit NULL checks for sa_cp_addr and sa_cp_addr6.Tobias Heider
2023-08-11Add iked support for route based sec(4) tunnels.Tobias Heider
To use sec(4) instead of policy based tunnels, create a sec(4) interface and add 'iface secXX' to your policy config. sec(4) interfaces also support auto configuration for dynamic client IPs via 'request any' like all other interfaces. The config won't work without traffic selectors, 'from any to any' should work for now but I plan to make this optional in the future. ok dlg@
2023-08-08have a go at documenting the Interface config statement.David Gwynne
im not really happy with this, but it's a start.
2023-08-07add support route based ipsec vpn negotiation with sec(4) via isakmpd.David Gwynne
this adds "interface secX" to the grammar that you can use instead of specifying tunnel/transport modes and traffic selectors. if you have config like "ike interface sec0 local ... peer ...", ipsecctl will generate the right config for isakmpd to negotiate esp tunnels for all traffic between 0.0.0.0/0 and 0.0.0.0/0. however, this also specifies that they should be set up as interface SAs in the kernel for use with sec(4). this supports route-based instead of policy based ipsec encapsulation, and allows us to more easily operate with other vendors and products that also offer route-based vpns with opinions about the negotiated policy that doesnt fit with the SPD. support from many including markus@ tobhe@ claudio@ sthen@ patrick@ now is a good time deraadt@
2023-08-07support configuring interface SAs for route-based ipsec vpns.David Gwynne
add "Interface NUMBER" to the config parser to specify that once SAs have been negotiated with a peer, install the SAs with the sadb_x_iface extension set up, but skip installing the flows/SPD entries. this allows for the negotiation of multiple esp tunnels covering all traffic between 0.0.0.0/0 to 0.0.0.0/0, and then being able to do something useful with them using the routing table and sec(4) interfaces instead of having SPD entries fight over those packets in the kernel. this in turn allows interoperation with other ipsec/vpn solutions that require the negotiation of such tunnels. support from many including markus@ tobhe@ claudio@ sthen@ patrick@ now is a good time deraadt@
2023-08-04Convert calls to ibuf_length() where it is clear that the ibuf is notClaudio Jeker
NULL to ibuf_size(). In some cases it is clear that the ibuf pointer should just be checked for NULL since afterwards a new ibuf is allocated in its place. OK tb@
2023-08-02add EXIT STATUS section with information for the exec subcommandaisha
patch by Matthew Martin <phy1729 AT gmail DOT com>
2023-07-28Implement print_hexbuf() to hexdump the contents of an ibuf.Claudio Jeker
OK tb@
2023-07-28Use ibuf_data() instead of accessing the ibuf buf pointer directly.Claudio Jeker
Also convert some ibuf_add(() calls to ibuf_add_buf() where appropriate. OK tobhe@ tb@
2023-07-23use SMALL to save a shave mfs and tmpfs bits in install mediaKlemens Nanni
RAMDISK* has MFS and TMPFS disabled, so the installer can't use them. OK deraadt
2023-07-18Enable LRO for TCP per default in the network drivers.Alexander Bluhm
Large Receive Offload allows to receive aggregated packets larger than the MTU. Receiving TCP streams becomes much faster. As the network hardware is not aware whether a packet is received locally or to be forwarded, everything is aggregated. In case of forwarding it is split on output to packets not larger than the original packets. So path MTU discovery should still work. If the outgoing interface supports TSO, the packet is chopped in hardware by TCP Segmentation Offload. Currently only ix(4) and lo(4) devices support LRO, and ix(4) is limited to IPv4 and hardware newer than the old 82598 model. If the interface is added to a tpmr(4), bridge(4) or veb(4), LRO is automatically disabled. All ix(4) devices support outgoing TSO for IPv4 and IPv6. Enabling LRO on lo(4) automatically enables TSO and TCP packets larger than the MTU pass the loopback interface. LRO can be turned off per interface with ifconfig -tcplro. OK jan@
2023-07-18Kill ibuf_cat() since there is now ibuf_add_buf() in the official API.Claudio Jeker
OK tb@ tobhe@
2023-07-16Merge ibuf_get() with ibuf_getdata() and rename it to ibuf_getdata().Claudio Jeker
Also replace a ibuf_reserve() call with ibuf_add_zero() and remove a buf->buf == NULL check in ibuf_length() since it is not necessary. OK tobhe@ tb@