Fix stack overflow in OpenSolaris NEXTADDR()
PATCH 1/1 Fix stack overflow in OpenSolaris NEXTADDR()
Commit 5fde831c5807 fixed NEXTADDR() for all *BSDs and MacOS.
OpenSolaris has to use a slightly different macro due to lack of sockaddr->sa_len - but it has the same problem, first rounding up, then memmove()'ing. Switch order.
--- src/openvpn/route.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
src/openvpn/route.c +1 -1
@@ -3429,7 +3429,7 @@ struct rtmsg {#if defined(TARGET_SOLARIS )#define NEXTADDR (w, u) \ if (rtm_addrs & (w)) { \ - l = ROUNDUP(sizeof(u)); memmove(cp, &(u), l); cp += l; \ + l = sizeof(u); memmove(cp, &(u), l); cp += ROUNDUP(l); \ }#define ADVANCE (x, n) (x += ROUNDUP(sizeof(struct sockaddr_in)))
Signature · 1 line
2.23.0
Am 13.08.20 um 12:13 schrieb Gert Doering:
Quoted 17 lines
Commit
5fde831c5807fixedNEXTADDR()for all *BSDs and MacOS.OpenSolaris has to use a slightly different macro due to lack of
sockaddr->sa_len- but it has the same problem, first rounding up, then memmove()'ing. Switch order.Signed-off-by Gert Doering <[email protected]...>--- src/openvpn/route.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)src/openvpn/route.c +0
-0
src/openvpn/route.c struct rtmsg { · line 3435
Quoted 8 lines
src/openvpn/route.c +1
-1@@ -3429,7 +3429,7 @@ struct rtmsg {#if defined(TARGET_SOLARIS )#define NEXTADDR (w, u) \ if (rtm_addrs & (w)) { \ - l = ROUNDUP(sizeof(u)); memmove(cp, &(u), l); cp += l; \ + l = sizeof(u); memmove(cp, &(u), l); cp += ROUNDUP(l); \ }#define ADVANCE (x, n) (x += ROUNDUP(sizeof(struct sockaddr_in)))
Patch has been applied to the master, 2.5 and 2.4 branch (bugfix).
commit 7e65483d1227adfb855844467e4d30894ffc355d (master) commit 7b9dd9b091a3cad126642314ea945bafa4e91481 (release/2.5) commit 5f88c077de8da4a4c5369ae67f5815e4abc50edc (release/2.4)
Author: Gert Doering Date: Thu Aug 13 12:13:01 2020 +0200
Fix stack overflow in OpenSolaris NEXTADDR()
Signed-off-by: Gert Doering <[email protected]...>
Acked-by: Arne Schwabe <[email protected]...>
Message-Id: <[email protected]...>
URL: https://www.mail-archive.com/[email protected]/msg20731.html
Signed-off-by: Gert Doering <[email protected]...>--
kind regards,
Gert Doering