From patchwork Thu Aug 13 00:13:01 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gert Doering X-Patchwork-Id: 1385 Return-Path: Delivered-To: patchwork@openvpn.net Delivered-To: patchwork@openvpn.net Received: from director9.mail.ord1d.rsapps.net ([172.28.255.1]) by backend30.mail.ord1d.rsapps.net with LMTP id QMfRFwEXNV+eBAAAIUCqbw for ; Thu, 13 Aug 2020 06:33:37 -0400 Received: from proxy8.mail.ord1c.rsapps.net ([172.28.255.1]) by director9.mail.ord1d.rsapps.net with LMTP id oNeiFwEXNV+iWAAAalYnBA (envelope-from ) for ; Thu, 13 Aug 2020 06:33:37 -0400 Received: from smtp39.gate.ord1c ([172.28.255.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) by proxy8.mail.ord1c.rsapps.net with LMTP id KFpSFwEXNV9GBgAAHz/atg ; Thu, 13 Aug 2020 06:33:37 -0400 X-Spam-Threshold: 95 X-Spam-Score: 0 X-Spam-Flag: NO X-Virus-Scanned: OK X-Orig-To: openvpnslackdevel@openvpn.net X-Originating-Ip: [216.105.38.7] Authentication-Results: smtp39.gate.ord1c.rsapps.net; iprev=pass policy.iprev="216.105.38.7"; spf=pass smtp.mailfrom="openvpn-devel-bounces@lists.sourceforge.net" smtp.helo="lists.sourceforge.net"; dkim=fail (signature verification failed) header.d=sourceforge.net; dkim=fail (signature verification failed) header.d=sf.net; dmarc=none (p=nil; dis=none) header.from=greenie.muc.de X-Suspicious-Flag: YES X-Classification-ID: 719347da-dd50-11ea-ba78-5452006c005a-1-1 Received: from [216.105.38.7] ([216.105.38.7:56692] helo=lists.sourceforge.net) by smtp39.gate.ord1c.rsapps.net (envelope-from ) (ecelerity 4.2.38.62370 r(:)) with ESMTPS (cipher=DHE-RSA-AES256-GCM-SHA384) id 8B/A2-17349-007153F5; Thu, 13 Aug 2020 06:33:36 -0400 Received: from [127.0.0.1] (helo=sfs-ml-4.v29.lw.sourceforge.com) by sfs-ml-4.v29.lw.sourceforge.com with esmtp (Exim 4.90_1) (envelope-from ) id 1k6AXR-0001fS-KT; Thu, 13 Aug 2020 10:32:49 +0000 Received: from [172.30.20.202] (helo=mx.sourceforge.net) by sfs-ml-4.v29.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.90_1) (envelope-from ) id 1k6AXQ-0001fL-F5 for openvpn-devel@lists.sourceforge.net; Thu, 13 Aug 2020 10:32:48 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=Content-Transfer-Encoding:MIME-Version:Message-Id: Date:Subject:To:From:Sender:Reply-To:Cc:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=v2JSAFfwmbwfe6h2pWs1Rb7I5+2fXZu6K8of1uLJH/4=; b=T3Eke5yX4DqwZngJqiY1omwCo1 b4cDS9h64ZgJeVys3tDOpC2p0fL6ne3IRP0ZbAXnZ9byG1Cn1wdUpNqolpxGAsZJUrv62u2zZJDXu wl5dJhCib4wAjH0qe0sdvezgidLuuesDAPUDDajD2vNcKsksQCdOIOeKuTEJDf+qDzso=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=Content-Transfer-Encoding:MIME-Version:Message-Id:Date:Subject:To:From: Sender:Reply-To:Cc:Content-Type:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Id:List-Help:List-Unsubscribe:List-Subscribe:List-Post: List-Owner:List-Archive; bh=v2JSAFfwmbwfe6h2pWs1Rb7I5+2fXZu6K8of1uLJH/4=; b=X QvjeGB9HqkPj0F8pPnmTP3IllTe8JsW/aKCwXbmX0ArvrZfPVAhMtvhumxZ13GzA29QRiuI1RLUQy GTqSwTZLfhOxM3cGFbnEHUGxm1nmRwML5UZjcYilCOkTIB7bJlLjY3AarIQ1jlmIij8EvTzHVkYoL 22mpFOMiT7ZD62fA=; Received: from vmail1.greenie.net ([195.30.8.66]) by sfi-mx-4.v28.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92.2) id 1k6AXN-00C1rn-RZ for openvpn-devel@lists.sourceforge.net; Thu, 13 Aug 2020 10:32:48 +0000 Received: from oi2019.ov.greenie.net (oi2019.ov.greenie.net [IPv6:2001:608:0:814:0:0:f000:20]) by vmail1.greenie.net (8.16.1/8.12.11) with ESMTPS id 07DAD1S7099658 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Thu, 13 Aug 2020 12:13:01 +0200 (CEST) Received: from oi2019.ov.greenie.net (oi2019 [127.0.0.1]) by oi2019.ov.greenie.net (8.15.2+Sun/8.15.2) with ESMTP id 07DAD1qj012765 for ; Thu, 13 Aug 2020 12:13:01 +0200 (CEST) Received: (from gert@localhost) by oi2019.ov.greenie.net (8.15.2+Sun/8.15.2/Submit) id 07DAD1VU012764 for openvpn-devel@lists.sourceforge.net; Thu, 13 Aug 2020 12:13:01 +0200 (CEST) From: Gert Doering To: openvpn-devel@lists.sourceforge.net Date: Thu, 13 Aug 2020 12:13:01 +0200 Message-Id: <20200813101301.12720-1-gert@greenie.muc.de> X-Mailer: git-send-email 2.23.0 MIME-Version: 1.0 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.6.2 (vmail1.greenie.net [IPv6:2001:608:1:995a:20c:29ff:feb8:10eb]); Thu, 13 Aug 2020 12:13:01 +0200 (CEST) X-Spam-Report: Spam Filtering performed by mx.sourceforge.net. See http://spamassassin.org/tag/ for more details. 0.0 URIBL_BLOCKED ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [URIs: muc.de] 0.0 HEADER_FROM_DIFFERENT_DOMAINS From and EnvelopeFrom 2nd level mail domains are different 0.0 SPF_NONE SPF: sender does not publish an SPF Record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record X-Headers-End: 1k6AXN-00C1rn-RZ Subject: [Openvpn-devel] [PATCH] Fix stack overflow in OpenSolaris NEXTADDR() X-BeenThere: openvpn-devel@lists.sourceforge.net X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: openvpn-devel-bounces@lists.sourceforge.net X-getmail-retrieved-from-mailbox: Inbox 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. Signed-off-by: Gert Doering Acked-By: Arne Schwabe --- src/openvpn/route.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/openvpn/route.c b/src/openvpn/route.c index 24563ed6..f127a90a 100644 --- a/src/openvpn/route.c +++ b/src/openvpn/route.c @@ -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)))