mlarkin [Fri, 18 Jun 2021 22:44:21 +0000 (22:44 +0000)]
Enable oce(4) for riscv64
"free commit" kettenis@
deraadt [Fri, 18 Jun 2021 22:30:35 +0000 (22:30 +0000)]
sync
cheloha [Fri, 18 Jun 2021 22:21:29 +0000 (22:21 +0000)]
alarm.3: miscellaneous improvements to alarm(3) documentation
Improve the alarm(3) manpage:
- Better one-line description of the interface.
- Carefully describe what alarm(3) actually does. In particular, the
first paragraph of the current DESCRIPTION is misleading in several
ways.
- Remove mention of the 100 million second limit. As of kern_time.c v1.154,
setitimer(2) no longer has this limit on OpenBSD.
- An alarm is "pending" if it has been scheduled but has not yet
"expired".
- Rewrite RETURN VALUES. Remind the reader that calling alarm(3)
cancels any pending alarm. Enumerate all the cases where alarm(3)
could return zero.
- Remove all descriptions of errors and errno. With the removal of
the 100 million second limit, alarm(3) basically cannot fail on
OpenBSD unless the stack is corrupted.
Unfortunately, the standard does not prescribe a portable return
value to report an error to the caller.
- Add a CAVEATS section. Discourage use of alarm(3) and setitimer(2)'s
ITIMER_REAL timer in the same program.
With input from millert@, deraadt@, and jmc@.
Thread: https://marc.info/?l=openbsd-tech&m=
162403868814857&w=2
ok millert@, jmc@
kettenis [Fri, 18 Jun 2021 21:52:47 +0000 (21:52 +0000)]
When we do a context switch, always set the FPU to "off" for the old proc.
Disable the optimization to mark the new proc "clean" since it causes
random failures in regress. Hopefully we can revisit this soon.
ok drahn@
drahn [Fri, 18 Jun 2021 21:32:06 +0000 (21:32 +0000)]
Provide directions on how to install Unmatched
ok jsg@(with suggested improvements) mlarkin@
kettenis [Fri, 18 Jun 2021 21:05:16 +0000 (21:05 +0000)]
Need to enable interrupts while processing supervisor traps as well.
yikes deraadt@, ok mlarkin@
deraadt [Fri, 18 Jun 2021 20:58:16 +0000 (20:58 +0000)]
do not guess at MP support yet.
jsing [Fri, 18 Jun 2021 18:26:38 +0000 (18:26 +0000)]
Remove SSL_CTX_set_read_ahead() calls - it is now the default for DTLS.
cheloha [Fri, 18 Jun 2021 15:59:14 +0000 (15:59 +0000)]
setitimer(2): increase timer limit to UINT_MAX seconds
Currently setitimer(2) rejects timers larger than 100 million seconds
and sets EINVAL.
With the change to kclock timeouts there is no longer any reason to
use this arbitrary value. Kclock timeouts support the full range of a
timespec, so we can increase the upper bound without practical risk of
arithmetic overflow.
If we push the limit to UINT_MAX we can support the full input range
of alarm(3). We can then simplify the alarm.3 manpage in a separate
patch.
We can push the limit even higher in the future if we find software
that doesn't like the UINT_MAX limit. Until then, UINT_MAX seconds
(over 68 years) is plenty for all practical timers.
ok claudio@
bluhm [Fri, 18 Jun 2021 15:34:21 +0000 (15:34 +0000)]
The crypto(9) framework used by IPsec runs on a kernel task that
is protected by kernel lock. There were crashes in swcr_authenc()
when it was accessing swcr_sessions. As a quick fix, protect all
calls from network stack to crypto with kernel lock. This also
covers the rekeying case that is called from pfkey via tdb_init().
OK mvs@
dv [Fri, 18 Jun 2021 14:35:59 +0000 (14:35 +0000)]
vmd diskfmt regress: don't copy source files, cleanup disk images
Previous version of the diskfmt regress tests for vmd(8) would copy
source files from the tree in order to compile them. Using some of
the ssh regress tests as inspiration, use the .PATH to allow building
object files from other parts of the tree in place.
Since 4G disk images are made as part of the test, clean those up
when done by adding in a proper REGRESS_CLEANUP target.
"go for it" mlarkin@
mortimer [Fri, 18 Jun 2021 14:09:31 +0000 (14:09 +0000)]
Limit regress libexecinfo to amd64 or llvm >=12.
Only amd64 has unwind info by default, so this regress test only works
on amd64. In llvm12, more architectures have unwind info by default, so
this test should work on those architectures.
Found by bluhm. OK bluhm@
kettenis [Fri, 18 Jun 2021 12:12:22 +0000 (12:12 +0000)]
Enable 32-bit I/O addressing. This gets rid of the io address conflict
messages on the HiFive Unmatched.
ok patrick@
florian [Fri, 18 Jun 2021 11:46:06 +0000 (11:46 +0000)]
special is SMALL
florian [Fri, 18 Jun 2021 11:44:48 +0000 (11:44 +0000)]
fix SMALL build
florian [Fri, 18 Jun 2021 11:43:38 +0000 (11:43 +0000)]
special is SMALL
nicm [Fri, 18 Jun 2021 07:46:54 +0000 (07:46 +0000)]
Mention %1 under choose-tree also.
jsg [Fri, 18 Jun 2021 06:53:42 +0000 (06:53 +0000)]
recognise BCM5762 B0
from Brad
guenther [Fri, 18 Jun 2021 06:17:28 +0000 (06:17 +0000)]
The pmap needs to know which CPUs to send IPIs when TLB entries
need to be invalidated. Instead of keeping a bitset of CPUs in
each pmap, have each cpu_info track which pmap it has loaded: replace
pmap->pm_cpus with cpu_info->ci_proc_pmap. This reduces the atomic
operations (and cache thrashing) and simplifies cpu_switchto()
Also, fix a defect in cpu_switchto()'s "am I loading the same cr3?"
test: ignore the CR3_REUSE_PCID bit when checking that. This makes
switching between kernel threads slightly less costly.
over a week in snaps with no complaints
looks ok to mlarkin@ kettenis@ mpi@
jsg [Fri, 18 Jun 2021 04:29:09 +0000 (04:29 +0000)]
initial plic(4) sfcc(4) sfclock(4)
dv [Thu, 17 Jun 2021 22:03:33 +0000 (22:03 +0000)]
vmd(8): handle VIRTIO_BLK_T_GET_ID, check descriptor r/w flags
Linux guests like to issue VIRTIO_BLK_T_GET_ID commands in attempts
to read the device serial number. It's not part of the virtio spec,
but has been part of QEMU and Bhyve for multiple years. It will be
landing in the next version of virtio (1.2), so this stubs out
handling for the request type. The added benefit is it helps squelch
log noise from Linux guests.
For now, no serial number is set and the request status is set to
VIRTIO_BLK_S_UNSUPP to tell the driver we don't support it.
While here, swap the response to VIRTIO_BLK_T_FLUSH{,_OUT} to be
also returning VIRTIO_BLK_S_UNSUPP. It's not negotiated nor
implemented. Lastly, add checks for validating the vioblk device
is only reading/writing descriptors with approrpriate read/write-only
flags per the virtio spec.
With input from claudio@, OK mlarkin@
sthen [Thu, 17 Jun 2021 18:33:15 +0000 (18:33 +0000)]
sync
jmc [Thu, 17 Jun 2021 18:18:15 +0000 (18:18 +0000)]
compar is a function arg (Fa) not function name (Fn);
kettenis [Thu, 17 Jun 2021 16:10:50 +0000 (16:10 +0000)]
Add sfclock(4), a driver for the PRCI (Power Reset Clocking Interrupt) block
of the SiFive FU740 SoC.
ok deraadt@
mpi [Thu, 17 Jun 2021 16:10:39 +0000 (16:10 +0000)]
Revert previous: unref of amap outside of the KERNEL_LOCK().
This change introduced or exposed a leak of anons which result in system
freezes.
anton@ observed a high number of INUSE for anonpl and semarie@ saw multiple
processes waiting in the fault handler on "flt_noramX" probably the one
related to allocating an anon.
kettenis [Thu, 17 Jun 2021 16:09:08 +0000 (16:09 +0000)]
On OpenBSD _JBLEN is the number of slots (of type long) in jmp_buf.
We don't need 256 slots, so change it to 32 which leaves us with a few
spare slots and is probably what was intended.
This fixes building emacs which does some insane setjmp(3)/longjmp(3)
stuff and gets upset when jmp_buf is 2048 bytes.
ok deraadt@
claudio [Thu, 17 Jun 2021 16:05:25 +0000 (16:05 +0000)]
Implement RFC 7313 enhanced route refresh. It is off by default and
can be enabled with 'announce enhanced refresh yes'
Similar to graceful restart this allows to mark routes as stale, refresh
them and the flush out routes that are still stale. Enhanced route refresh
uses a begin of rr and a end of rr message to signal the various stages.
A future enhancement would be the addition of a timeout in case the EoRR
message is not sent in reasonable time.
OK denis@ job@
job [Thu, 17 Jun 2021 15:59:23 +0000 (15:59 +0000)]
Add simple BGP Enhanced Route Refresh Message decoding
seems OK claudio@
tobhe [Thu, 17 Jun 2021 13:28:20 +0000 (13:28 +0000)]
Skip flows in ikev2_cp_addr() if they don't contain a dynamic (0.0.0.0)
address before checking sa_addrpool. Fixes a bug where no flows are added
if a single address instead of a pool is configured in config address.
Reported by Sebastien Leclerc
ok patrick@
kettenis [Thu, 17 Jun 2021 12:55:38 +0000 (12:55 +0000)]
Like ARM, RISC-V does not implement floating point exceptions.
claudio [Thu, 17 Jun 2021 10:28:36 +0000 (10:28 +0000)]
Refactor common code for peer filtering out into rde_skip_peer()
and use it in the two places that need to keep in sync.
OK sthen@
kettenis [Thu, 17 Jun 2021 09:30:32 +0000 (09:30 +0000)]
Add BCM5725 support. Based on a diff from Brad Smith.
ok jsg@
kettenis [Thu, 17 Jun 2021 09:29:36 +0000 (09:29 +0000)]
regen
kettenis [Thu, 17 Jun 2021 09:29:01 +0000 (09:29 +0000)]
Add Broadcom BCM5725. Based on a diff from Brad Smith.
ok jsg@
claudio [Thu, 17 Jun 2021 08:45:37 +0000 (08:45 +0000)]
Add a bit of extra paranoia befor the up_generate_updates() call in
rde_up_dump_upcall(). This is the 4th place up_generate_updates() is
called.
claudio [Thu, 17 Jun 2021 08:43:06 +0000 (08:43 +0000)]
In Rev 1.511 I moved peer related checks from inside up_generate_updates()
to rde_generate_updates() but forgot to add the same checks to
rde_softreconfig_out(). As a result a config reload could result in
prefixes for a not-negotiated address family to leak into the Adj-RIB-Out.
Adjust both rde_generate_updates() and rde_softreconfig_out() to use the
same filter logic.
Also adjust rde_up_flush_upcall() to pass the peer as argument instead of
using prefix_peer(). The up_generate_updates() call there does not need
any filtering since the walker runs on the Adj-RIB-Out and just withdraws
everything.
OK job@ on a previous diff
claudio [Thu, 17 Jun 2021 08:16:04 +0000 (08:16 +0000)]
Better error message when a bad nexthop is passed to nexthop_hash().
OK job@
claudio [Thu, 17 Jun 2021 08:14:50 +0000 (08:14 +0000)]
Before adding a prefix to the Adj-RIB-Out modify the attributes to the
ones being sent out. Mainly prepend the ASPATH if needed and also change
the nexthop to the one being sent.
This should make the `bgpctl show rib out` output show the values the
peer receives.
OK job@
dlg [Thu, 17 Jun 2021 00:18:09 +0000 (00:18 +0000)]
more consistently use pfsync_free_deferral to free the mbuf.
pfsync_free_deferral doesnt need to check pd_m for NULL before
calling m_freem because m_freem does that anyway.
if pf_setup_pdesc in pfsync_undefer_notify failed, the mbuf was
freed but the pd_m pointer was not cleared, which would have led
to a double free when pfsync_free_deferral tried to do the same
thing for it.
if pfsync_undefer is supposed to drop the mbuf, let pfsync_free_deferral
do it for us.
ok jmatthew@
dv [Wed, 16 Jun 2021 16:55:02 +0000 (16:55 +0000)]
cleanup vmd(8) includes and header files
Lots of organic growth other the years lead to unnecessary includes
(proc.h everywhere) and odd dependencies between header files. This
cleans things up a bit to help with upcoming cleanup around dhcp
code.
No functional change.
"go for it" mlarkin@
kettenis [Wed, 16 Jun 2021 16:48:07 +0000 (16:48 +0000)]
ociic(4) and dapmic(4)
jmc [Wed, 16 Jun 2021 16:41:42 +0000 (16:41 +0000)]
add entries for dapmic and ociic; ok kettenis
job [Wed, 16 Jun 2021 16:24:11 +0000 (16:24 +0000)]
Add command line option to show the version
OK claudio@
krw [Wed, 16 Jun 2021 15:40:47 +0000 (15:40 +0000)]
Ensure that the '-i' command line option and the 'reinit [mbr]'
editing commnd completely remove any existing on-disk GPT header
when writing the MBR.
'-ig'/'reinit gpt' must be used to create GPT format.
Previous interactions between '-i', '-b' and overly clever
'reinit' produced surprising, inconsistent and incorrect
behaviour.
ok deraadt@ kettenis@
visa [Wed, 16 Jun 2021 14:26:30 +0000 (14:26 +0000)]
kqueue: kq_lock is needed when updating kn_status
The kn_status field of struct knote is part of kqueue's internal state.
When kn_status is being updated, kq_lock has to be locked. This is true
even with MP-unsafe event filters.
OK mpi@
florian [Wed, 16 Jun 2021 14:08:38 +0000 (14:08 +0000)]
Actually request classless static routes from the dhcp server; missed
in previous.
florian [Wed, 16 Jun 2021 14:06:17 +0000 (14:06 +0000)]
Implement classless static routes dhcp option.
For this we need to be able to handle multiple routes being sent from
the engine to the main process as well as to the control tool.
The configuration of the various cases (default route, directly
connected routes, non-default route via a gateway) was inspired by
dhclient's set_routes() and should behave the same way.
Tested by Uwe Werler
kettenis [Wed, 16 Jun 2021 13:56:46 +0000 (13:56 +0000)]
ociic(4) and dapmic(4)
kettenis [Wed, 16 Jun 2021 12:37:23 +0000 (12:37 +0000)]
Add ociic(4) and dapmic(4). The first is a driver for the OpenCores I2C
controller and the latter is a driver for the Dialog DA9063 PMIC. The
dapmic(4) driver currently supports the integrated RTC and also provides
support for resetting and powering down an application processor. This
functionality is used to support rebooting the SiFive Unmatched board.
ok deraadt@
jsg [Wed, 16 Jun 2021 12:00:15 +0000 (12:00 +0000)]
don't define __HAVE_ACPI to unbreak radeondrm build
found the hard way by matthieu@ ok kettenis@
nicm [Wed, 16 Jun 2021 11:57:04 +0000 (11:57 +0000)]
Minor fixes to option descriptions.
mpi [Wed, 16 Jun 2021 09:02:21 +0000 (09:02 +0000)]
Change the prefix of UVM object functions to match NetBSD's.
For example uvm_objinit() becomes uvm_obj_init(). Reduce differences
between the trees and help porting new functions needed for UVM object
locking.
No functionnal change.
nicm [Wed, 16 Jun 2021 08:37:58 +0000 (08:37 +0000)]
Pass Ctrl keys through as is when given as hex, GitHub issue 2724.
jsing [Tue, 15 Jun 2021 19:09:03 +0000 (19:09 +0000)]
Mop up part of dtls1_dispatch_alert().
The original DTLS code had some strange alert handling code (basically one
type of alert included extra data) - a few years later this was "fixed",
however the rest of the code was left as is.
This means that rather than sending the alert data from send_alert
(like ssl3_dispatch_alert() does), we have a local buffer on the stack,
which we memset, copy the send_alert bytes into, then send from.
ok inoguchi@ tb@
claudio [Tue, 15 Jun 2021 18:42:23 +0000 (18:42 +0000)]
Remove the uvshrink logic and keep the unveil list in the order of insertion.
unveil_lookup() is now doing a dumb linear search. The problem with the
uvshrink logic was that ps_uvpcwd was a pointer into this array and after
compation it pointed to the wrong element. Also future unveil caches would
suffer from the same issue.
OK semarie@
mpi [Tue, 15 Jun 2021 16:38:09 +0000 (16:38 +0000)]
Use a macro to assert that given uobjs correspond to anonymous objects.
Reduce the difference with NetBSD.
ok kettenis@
mpi [Tue, 15 Jun 2021 16:35:21 +0000 (16:35 +0000)]
Unref/free amaps before grabbing the KERNEL_LOCK().
This is possible now that amaps & anons are protected by a per-map rwlock.
ok kettenis@, jmatthew@
claudio [Tue, 15 Jun 2021 10:38:53 +0000 (10:38 +0000)]
Filter out packets that are not IPv4. This code came from dhcp programs
where this filtering was done in bpf but here vmd needs to make sure to
not look at non IPv4 packets.
OK florian@ and dv@
dlg [Tue, 15 Jun 2021 10:10:22 +0000 (10:10 +0000)]
use getnsecuptime instead of getmicrouptime.
working on a uint64_t is easier than remembering how timercmp and
timersub works.
ok jmatthew@
matthieu [Tue, 15 Jun 2021 09:52:04 +0000 (09:52 +0000)]
Increase MAXDSIZ to 16GB. ok kettenis@
dlg [Tue, 15 Jun 2021 08:36:19 +0000 (08:36 +0000)]
get the uptime before comparing to it.
"that seems kind of important" jmatthew@
dlg [Tue, 15 Jun 2021 05:24:46 +0000 (05:24 +0000)]
factor out nsecuptime and getnsecuptime.
these functions were implemented in a bunch of places with comments
saying it should be moved to kern_tc.c when more pop up, and i was
about to add another one. i think it's time to move them to kern_tc.c.
ok cheloa@ jmatthew@
dlg [Tue, 15 Jun 2021 05:06:24 +0000 (05:06 +0000)]
rework pfsync deferal timeout handling.
instead of having a timeout per deferred packet structure, use a
single timeout in pfsync that pulls items off the list of deferred
packets.
this avoids confusion about whether a timeout is handling the defer
or another context owns it. this way round, the context that removes
a defer from the list owns it and is responsible for completing it.
this should fix a panic we hit on the firewalls at work. there's
still another one that needs a fix, but sashan@ has been looking
at it. this might make it simpler to deal with though.
ok sashan@ jmatthew@
kettenis [Mon, 14 Jun 2021 20:54:04 +0000 (20:54 +0000)]
Simplify the way we handle PCI configuration space access. Instead of
splitting the configuration space access window in a part for type 0 and
a part for type 1 commands, use a single window. The code already flips
between type 0 and type 1 so there is no benefit in having this complication.
Fixes the PCIe host bridge on the SiFive FU740 SoC.
ok drahn@, patrick@
eric [Mon, 14 Jun 2021 17:58:15 +0000 (17:58 +0000)]
add required headers for smtpd.h and remove unnecessary ones in other files.
ok jung@
krw [Mon, 14 Jun 2021 17:34:06 +0000 (17:34 +0000)]
Only use of 'reinited' died in cmd.c r1.100. It is now set in a
couple of places but never checked. Retire it.
No functional change.
jsing [Mon, 14 Jun 2021 14:22:52 +0000 (14:22 +0000)]
Simplify nonce handling in the TLSv1.2 record layer.
Pass the CBS for the sequence number through, which also allows us to do
more sensible length checks. Also, add a missing length check while here.
ok inoguchi@ tb@
krw [Mon, 14 Jun 2021 12:46:47 +0000 (12:46 +0000)]
Somewhere in the recent churn a couple of memset()'s
inadvertantly got lost.
Restore merciless zapping of gpt header & partition entries when
'-i -g' or 'reinit [gpt]' are invoked.
sthen [Mon, 14 Jun 2021 12:28:58 +0000 (12:28 +0000)]
snmpd.conf(5): fix typo/plurals and tweak wording. ok jmc martijn
job [Mon, 14 Jun 2021 12:08:50 +0000 (12:08 +0000)]
Fix ROA & MFT version check handling
This check was incomplete: to correctly verify the ASN1 INTEGER holding
the version component, first the context specific explicit tag would need
to be checked.
However, the X.690 spec (section 11.5) states that if the one should not
encode a component if it is the default value. There are no RFCs specifying
new versions of ROA or MFT, so checking the content of the version component
should be skipped entirely.
Thus if the version component is present, something is wrong.
kettenis [Mon, 14 Jun 2021 12:06:06 +0000 (12:06 +0000)]
Remove unused prototypes.
claudio [Mon, 14 Jun 2021 10:01:23 +0000 (10:01 +0000)]
Change errors for file manipulations from err(3) to warn(3) and adjust the
surrounding code to handle these errors gracefully. When rpki-client runs
out of space it will keep on running including the cleanup at the end.
This way the temporary and old files are removed hopfully giving back some
space. This affects mainly RRDP and the initial fetch of TA files.
OK job@
claudio [Mon, 14 Jun 2021 09:54:15 +0000 (09:54 +0000)]
Do a fstatvfs() call to figure out if the filesystem used for the cache
is large enough for the cache. People like to build VM images with way
too small filesystems and so warning about this situation should help.
With deraadt@ and job@
kettenis [Mon, 14 Jun 2021 08:19:39 +0000 (08:19 +0000)]
Use uint64_t instead of u_long for pcitag_t.
jsg [Mon, 14 Jun 2021 06:27:22 +0000 (06:27 +0000)]
"scsibus* at hba?" was replaced by "scsibus* at scsi?" in 2011
matthieu [Mon, 14 Jun 2021 06:10:44 +0000 (06:10 +0000)]
reset ppc_altivec if 'option ALTIVEC' is not present.
This makes sysctl machdep.altivec return 0 in this case, allowing
applications to select the non-altivec code path.
Issue with pixman reported by cwen@ ok jca@ gkoehler@ deraadt@
jsg [Mon, 14 Jun 2021 06:09:28 +0000 (06:09 +0000)]
add a few more phys known to attach to usb ethernet
jsg [Mon, 14 Jun 2021 06:03:50 +0000 (06:03 +0000)]
fix whitespace
jsg [Mon, 14 Jun 2021 05:33:16 +0000 (05:33 +0000)]
mention sqphy(4)
shows up in submitted dmesgs
aue0: ELSA AG MicroLink USB2Ethernet, rev 1.10/1.01, addr 2
sqphy0 at aue0 phy 1: Seeq 80225 10/100 PHY, rev. 0
tb [Mon, 14 Jun 2021 05:32:10 +0000 (05:32 +0000)]
Remove TLS1_AD_INTERNAL_ERROR from internal visibility again
With tls_server.c r1.47 this is no longer needed.
deraadt [Mon, 14 Jun 2021 04:50:01 +0000 (04:50 +0000)]
sync
tb [Mon, 14 Jun 2021 03:53:59 +0000 (03:53 +0000)]
Use SSL_AD_INTERNAL_ERROR
One instance of TLS1_AD_* was missed and broke the tree in the recent
switch to using only one version of alert defines internally.
deraadt [Mon, 14 Jun 2021 03:50:23 +0000 (03:50 +0000)]
Add a few more drivers that people might need.
ok drahn
deraadt [Mon, 14 Jun 2021 03:48:41 +0000 (03:48 +0000)]
add PCITAG_NODE and PCITAG_OFFSET
ok drahn
drahn [Mon, 14 Jun 2021 03:04:02 +0000 (03:04 +0000)]
enable nvme, a few pci devices and a bunch of usb stuff.
will cleanup later, enabling additional systems.
deraadt [Mon, 14 Jun 2021 02:04:11 +0000 (02:04 +0000)]
ugly hack around broken build until people wake up.
deraadt [Mon, 14 Jun 2021 00:36:13 +0000 (00:36 +0000)]
32-bit systems incorrectly parse the (64-bit) length of ustar extended
headers (hd->size) using a 32-bit operation.
from Samanta Navarro
ok guenther
krw [Sun, 13 Jun 2021 23:53:51 +0000 (23:53 +0000)]
There is no '!' in HiFive.
Pointed out by kettenis@
dv [Sun, 13 Jun 2021 21:43:35 +0000 (21:43 +0000)]
fix and enable diskfmt regress test for vmd(8)
Clean the rot in the diskfmt test, updating it to work with current
vmd(8) and vmctl(8). Remove the needs to qemu since vmctl can create
qcow2 images now.
Now that it's a test that doesn't need a port, enable it in the
parent Makefile.
There's still some work needed to get "make clean" properly cleaning
up after the tests.
OK ori@
kettenis [Sun, 13 Jun 2021 21:11:54 +0000 (21:11 +0000)]
Save and restore errno around FUTEX_WAIT futex(2) operations. While there
remove the unused _wait() function in librthread such that we don't have to
add the save/restore sequence there.
Fixed building Python as a race with another thread unlocking a futex(2)
would make futex(2) set errno to EAGAIN which would confuse Python in
beleiving that readdir(2) failed instead of reaching the end of the
directory.
Spotted and tested by tb@
ok bluhm@
kettenis [Sun, 13 Jun 2021 16:27:15 +0000 (16:27 +0000)]
Add support for sfuart(4) as a console.
ok drahn@
jsing [Sun, 13 Jun 2021 15:51:10 +0000 (15:51 +0000)]
Add SSL_AD_MISSING_EXTENSION.
This is an alert that was added in TLSv1.3 - we already use it internally,
but did not provide the SSL_AD_* define previously.
ok tb@
jsing [Sun, 13 Jun 2021 15:47:11 +0000 (15:47 +0000)]
Define SSL_AD_* as actual values.
Rather than having SSL_AD_* as defines that refer to SSL3_AD_* or
TLS1_AD_*, just give them actual values directly since it is more readable
and the indirection provides no value. Place SSL3_AD_* and TLS1_AD_* under
#ifndef LIBRESSL_INTERNAL to prevent further usage.
ok tb@
jsing [Sun, 13 Jun 2021 15:34:41 +0000 (15:34 +0000)]
Remove tls1_alert_code().
After running the preprocessor, this function becomes:
switch (code) {
case 0:
return (0);
case 10:
return (10);
case 20:
return (20);
...
}
Its intended purpose was to prevent SSLv3 alerts being sent from TLS code,
however now that we've removed "no_certificate" from LibreSSL's reach, it
no longer does anything useful.
ok tb@
krw [Sun, 13 Jun 2021 15:32:36 +0000 (15:32 +0000)]
Have gedit() and gsetpid() both return CMD_CLEAN if no data has
changed, thus keeping the modified indicator correct and avoiding
early bailout when editing a gpt partition w/o changing the type.
jsing [Sun, 13 Jun 2021 15:29:54 +0000 (15:29 +0000)]
Place obsolete alerts under #ifndef LIBRESSL_INTERNAL.
ok tb@
jsing [Sun, 13 Jun 2021 15:29:19 +0000 (15:29 +0000)]
Remove references to obsolete alerts.
The "no_certificate" alert only existed in SSLv3, while the
"decryption_failed" and "export_restriction" alerts were removed in
TLSv1.1.
ok tb@
krw [Sun, 13 Jun 2021 14:39:05 +0000 (14:39 +0000)]
Tweak gsetpid() to restore partition info in case of an error,
and mark the partition dirty only if something changed.
More aligned with gedit() and safer when invoked directly from
Xsetpid().
krw [Sun, 13 Jun 2021 14:14:56 +0000 (14:14 +0000)]
UUID_STR_LEN+1 is less mysterious than '37'.
krw [Sun, 13 Jun 2021 13:48:00 +0000 (13:48 +0000)]
Don't ignore a GPT that claims the last usable LBA is located
past the address where alternate partition entries would be
written.
Just adjust the GPT header value (gh_lba_end) to the highest safe
value and carry on.
Issue encountered in the wild by mlarkin@ while accessing some
disk images.
ok deraadt@