>Synopsis: relayd reload race crash
>Category: system
>Environment:
System : OpenBSD 7.8
Details : OpenBSD 7.8 (GENERIC.MP) #1: Sat Nov 29 11:02:59 MST 2025
[email protected]:/usr/src/sys/arch/amd64/compile/GENERIC.MP
Architecture: OpenBSD.amd64
Machine : amd64
>Description:
relayd ca proc will race with in flight requests while being reloaded,
and crash if in flight requests appear at the wrong time.
this was brought up by rnkn on IRC, but this was also mentioned a few
years ago in https://marc.info/?l=openbsd-tech&m=163309504711482&w=2
>How-To-Repeat:
reload while also handling traffic, something to the effect of
doas watch -s 0.1 relayctl -s /tmp/relayd.sock reload
watch -s 0 curl -kso /dev/null https://127.0.0.1:444
fugu$ cat x.conf
socket "/tmp/relayd.sock"
table <www> { 127.0.0.1 }
http protocol "proxy" {
tls keypair "test"
return error
}
relay "https" {
listen on 0.0.0.0 port 444 tls
protocol "proxy"
forward to <www> port 80
}
fugu$ doas ./obj/relayd -d -f x.conf
startup
adding 1 hosts from table www:80 (no check)
adding 1 hosts from table www:80 (no check)
adding 1 hosts from table www:80 (no check)
<snip>
adding 1 hosts from table www:80 (no check)
adding 1 hosts from table www:80 (no check)
adding 1 hosts from table www:80 (no check)
ca: ca_dispatch_relay: invalid relay hash
'SHA256:764076891ced15921fb2ec023df3232c194dccac8c6b9fde2565ca01ed13874d'
hce exiting, pid 71488
pfe exiting, pid 40741
ca exiting, pid 48707
relay: pipe closed
lost child: pid 39177 exited abnormally
ca exiting, pid 20355
lost child: pid 71618 exited abnormally
relay exiting, pid 83235
relay exiting, pid 71571
parent terminating, pid 32006
>Fix: