There's still room for improvement in the comments, but the current version might be as good as it gets this year... and I want to be able to push to GHA again without UBSAN errors :-)
Tested this on NetBSD, OpenBSD, FreeBSD, MacOS and OpenSolaris, and found lots of interesting things - but nothing that was made worse by *this* patch, and the UBSAN build stopped complaining on MacOS... also, I've stared long and hard at the code, and as long as we can trust the kernel, every variant of short/long length should be covered. Did I say that this is a shitty API that MacOS copied from FreeBSD, FreeBSD actually fixed it (by increasing the structure size a lot, so if the buffer is aligned, nothing will overrun and alignment will also be fine), and MacOS just stuck with what they have... A followup patch that implements HWADDR for OpenSolaris happened by accident while testing this :-) - will be on the list soon. Your patch has been applied to the master and release/2.6 branch (bugfix). commit f13331005d5a75f2788685485d46be1fe2f133a1 (master) commit 5380fe02b9ef4f0f2b1f0eb52100b7922965dfdb (release/2.6) Author: Arne Schwabe Date: Sun Dec 31 18:34:31 2023 +0100 Fix unaligned access in macOS, FreeBSD, Solaris hwaddr Signed-off-by: Arne Schwabe <a...@rfc2549.org> Acked-by: Gert Doering <g...@greenie.muc.de> Message-Id: <20231231173431.31356-1-g...@greenie.muc.de> URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg27885.html Signed-off-by: Gert Doering <g...@greenie.muc.de> -- kind regards, Gert Doering _______________________________________________ Openvpn-devel mailing list Openvpn-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/openvpn-devel