From patchwork Fri May 13 00:15:26 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gert Doering X-Patchwork-Id: 2459 Return-Path: Delivered-To: patchwork@openvpn.net Delivered-To: patchwork@openvpn.net Received: from director15.mail.ord1d.rsapps.net ([172.30.191.6]) by backend41.mail.ord1d.rsapps.net with LMTP id KIFNNlUzfmIvKgAAqwncew (envelope-from ) for ; Fri, 13 May 2022 06:30:45 -0400 Received: from proxy4.mail.ord1d.rsapps.net ([172.30.191.6]) by director15.mail.ord1d.rsapps.net with LMTP id KLLrAlYzfmLNOAAAIcMcQg (envelope-from ) for ; Fri, 13 May 2022 06:30:46 -0400 Received: from smtp9.gate.ord1d ([172.30.191.6]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) by proxy4.mail.ord1d.rsapps.net with LMTPS id 4JiJAlYzfmKgNAAAiYrejw (envelope-from ) for ; Fri, 13 May 2022 06:30:46 -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: smtp9.gate.ord1d.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: bef633a4-d2a7-11ec-b28e-525400bd3b1f-1-1 Received: from [216.105.38.7] ([216.105.38.7:59924] helo=lists.sourceforge.net) by smtp9.gate.ord1d.rsapps.net (envelope-from ) (ecelerity 4.2.38.62370 r(:)) with ESMTPS (cipher=DHE-RSA-AES256-GCM-SHA384) id 31/A5-02354-5533E726; Fri, 13 May 2022 06:30:45 -0400 Received: from [127.0.0.1] (helo=sfs-ml-1.v29.lw.sourceforge.com) by sfs-ml-1.v29.lw.sourceforge.com with esmtp (Exim 4.94.2) (envelope-from ) id 1npSYL-0006WI-0v; Fri, 13 May 2022 10:29:45 +0000 Received: from [172.30.20.202] (helo=mx.sourceforge.net) by sfs-ml-1.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1npSYK-0006W6-2G for openvpn-devel@lists.sourceforge.net; Fri, 13 May 2022 10:29:44 +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=HGHBRapu/kJU9ifARLRh73epmSKZK/rjoA7cpCoZqXs=; b=cRDxeBKlfSJD83DR9LfgLtOiQO fwF6lDSEFW2gBx2/g2Jv64u24XwCusGAI8eA7Q1HXK2ix11NLtr2mBnjOfbYsxF5sJEluQbXV7O/s aZPbfQ4Um/ieGhYQPeSRg3Fji2hsHkKm8zu/V69M+n5erCZ8wRg7JXnjyhh/xwuqZ0Rg=; 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=HGHBRapu/kJU9ifARLRh73epmSKZK/rjoA7cpCoZqXs=; b=R JN9tQHlcDu6GmqnOHidTWNZ+fHhISWmdSM4EaLV9pfYnxEdz5EHXsUTQRULVMPoqHA8YAv1XBkVl0 dgkV9cFCtf++r9SVNgHSwjC+m4dNMf3pDtu/jmtt44Ay34NV1S40FJqaDcst2pKsWv/iWgCGm0w1u kW9L/yCWejEVAJe0=; Received: from dhcp-174.greenie.muc.de ([193.149.48.174] helo=blue.greenie.muc.de) by sfi-mx-1.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.94.2) id 1npSYE-00AkkP-UY for openvpn-devel@lists.sourceforge.net; Fri, 13 May 2022 10:29:44 +0000 Received: from blue.greenie.muc.de (localhost [127.0.0.1]) by blue.greenie.muc.de (8.17.1/8.17.1) with ESMTP id 24DAFSfW011499 for ; Fri, 13 May 2022 12:15:28 +0200 Received: (from gert@localhost) by blue.greenie.muc.de (8.17.1/8.17.1/Submit) id 24DAFRIi011498 for openvpn-devel@lists.sourceforge.net; Fri, 13 May 2022 12:15:27 +0200 From: Gert Doering To: openvpn-devel@lists.sourceforge.net Date: Fri, 13 May 2022 12:15:26 +0200 Message-Id: <20220513101526.11486-1-gert@greenie.muc.de> X-Mailer: git-send-email 2.35.1 MIME-Version: 1.0 X-Spam-Report: Spam detection software, running on the system "util-spamd-2.v13.lw.sourceforge.com", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: commit 043c67f363429 enhances format_extended_socket_error() by recognizing IPv6 extended socket errors, but neglected to change the "sockaddr_in" buffer passed to recvmsg() to "sockaddr_storage". According to documentation, recvmsg() should not have overrun that structure (we pass the size of the struct), but according to ASAN it does... so, pass the correct structure. Content analysis details: (-0.0 points, 6.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.0 T_SCC_BODY_TEXT_LINE No description available. X-Headers-End: 1npSYE-00AkkP-UY Subject: [Openvpn-devel] [PATCH] Pass proper sockaddr_* structure for IPv6 socket errors. 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 043c67f363429 enhances format_extended_socket_error() by recognizing IPv6 extended socket errors, but neglected to change the "sockaddr_in" buffer passed to recvmsg() to "sockaddr_storage". According to documentation, recvmsg() should not have overrun that structure (we pass the size of the struct), but according to ASAN it does... so, pass the correct structure. Signed-off-by: Gert Doering Acked-By: Arne Schwabe --- src/openvpn/mtu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/openvpn/mtu.c b/src/openvpn/mtu.c index 93feaff1..84310349 100644 --- a/src/openvpn/mtu.c +++ b/src/openvpn/mtu.c @@ -312,7 +312,7 @@ format_extended_socket_error(int fd, int *mtu, struct gc_arena *gc) struct msghdr msg; struct cmsghdr *cmsg; struct sock_extended_err *e; - struct sockaddr_in addr; + struct sockaddr_storage addr; struct buffer out = alloc_buf_gc(256, gc); char *cbuf = (char *) gc_malloc(256, false, gc);