From patchwork Tue Aug 15 23:20:08 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "plaisthos (Code Review)" X-Patchwork-Id: 3326 Return-Path: Delivered-To: patchwork@openvpn.net Received: by 2002:a05:7300:c39e:b0:d7:3b0f:3938 with SMTP id fx30csp873261dyb; Tue, 15 Aug 2023 16:20:42 -0700 (PDT) X-Google-Smtp-Source: AGHT+IE2WjsNGA2pgAcp5WkaxvnjeSOZftRUuSDb4MaLM+9k/hrQpcx+hj8U95JqndVXoA3QOe9X X-Received: by 2002:a05:6a21:4985:b0:13e:e053:1050 with SMTP id ax5-20020a056a21498500b0013ee0531050mr385769pzc.56.1692141642502; Tue, 15 Aug 2023 16:20:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1692141642; cv=none; d=google.com; s=arc-20160816; b=rmcjvqLvroYyuuKbkJLWufk4WztR781YtcZYG0RaEuIwTEhnnu0hL5TX0UB6c/vhy6 w+jqy/9B8EqYHlVM7b3cOrezVV/ir5GQWAUSqcX+DyXTlMwJaqanCFbzll8fjs6Y++fH sU6hQFg1VOax1Rlf/qYHq79deSr0dFQoadPZoevVKJwrE8o/7B29n4VpK3UuvrIGYdVq 86PO8KFoZvj+OiByrNpKbum3ZaVeIvY6LGhYDf8VjYatEyrjAFK1sEPW3WI0s94pes3K fIg8giBuPaChUpvebxjxXuXd9cL479qFG1dmP6GtMOCTJTnv4kJMqxjrWNeiH5J7Q4b9 ilHQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:cc:reply-to:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence:subject:user-agent :mime-version:message-id:references:auto-submitted:to:date:from :dkim-signature:dkim-signature:dkim-signature; bh=aYt7zlaHrgjwwsHR0/LgBbrtbsn9Db7fLVwhjINRwI0=; fh=7evFI2C0oKj8U/2YqI7hkWbSv3Yt2FKnKx3JmZ+5wLk=; b=U/9DoXa1kIfRiuSA4S+jPaM9M2DQ6pdO6Tvh2sek+cdWm1T9pfa3hYgnLK4AgB3y3J bLZI+m5dtqiW5uMLdP2TDIuofGk6k4H/CEpETiMy8qSmv+oGsrBa+ZbJXKRZyA3JHeY2 OH7pa85nBdIMDdaY+VBOytKxJqbnIcggS8B0E/2jQYMdXhbOa+VkQNqUpCDoteOEEAWj KtCVvA7w201oSxwHUwwcIiBuTChwqIYWankJrjbY9OFb7ajqzdJ2L9o9yY3U+Zw3zgr2 o53gupdkc3Ti12bUa167GGKq+JW3R1P0U7S9FjNxMucN1co12UZ3iQCul3XcQE3BKlyW /FmQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=FFoYl8Ab; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=PbbR3Ayr; dkim=neutral (body hash did not verify) header.i=@openvpn.net header.s=google header.b=QNxAH00B; spf=pass (google.com: domain of openvpn-devel-bounces@lists.sourceforge.net designates 216.105.38.7 as permitted sender) smtp.mailfrom=openvpn-devel-bounces@lists.sourceforge.net; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=openvpn.net Received: from lists.sourceforge.net (lists.sourceforge.net. [216.105.38.7]) by mx.google.com with ESMTPS id bz9-20020a056a02060900b00563e080a7cdsi11473370pgb.242.2023.08.15.16.20.42 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 15 Aug 2023 16:20:42 -0700 (PDT) Received-SPF: pass (google.com: domain of openvpn-devel-bounces@lists.sourceforge.net designates 216.105.38.7 as permitted sender) client-ip=216.105.38.7; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=FFoYl8Ab; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=PbbR3Ayr; dkim=neutral (body hash did not verify) header.i=@openvpn.net header.s=google header.b=QNxAH00B; spf=pass (google.com: domain of openvpn-devel-bounces@lists.sourceforge.net designates 216.105.38.7 as permitted sender) smtp.mailfrom=openvpn-devel-bounces@lists.sourceforge.net; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=openvpn.net 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.95) (envelope-from ) id 1qW3Kn-0001HY-Jf; Tue, 15 Aug 2023 23:20:22 +0000 Received: from [172.30.20.202] (helo=mx.sourceforge.net) by sfs-ml-4.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1qW3Km-0001HS-V3 for openvpn-devel@lists.sourceforge.net; Tue, 15 Aug 2023 23:20:21 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=Content-Type:Content-Transfer-Encoding:MIME-Version :Message-ID:Reply-To:References:Subject:List-Unsubscribe:List-Id:Cc:To:Date: From:Sender:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:List-Help: List-Subscribe:List-Post:List-Owner:List-Archive; bh=56o7kp5zdCW5JAogWD0oo5CKcA+cImmDqQ8tJdvWal4=; b=FFoYl8AbccRslPPLySLiJxlu6z e2qUXOOBbk5NRVW/QQogaLvpV8pZCPLHSvrhBIKVOxSPLv2R4bdv6YNBxYAXPWQqpPKY8q+ppquSv af6KO4CSKMxe2j1JhxHrgisFTdiX61XbVv9S6fJkR1snZsvfBALR8YH3FKJ/tE3R/tKo=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=Content-Type:Content-Transfer-Encoding:MIME-Version:Message-ID:Reply-To: References:Subject:List-Unsubscribe:List-Id:Cc:To:Date:From:Sender:Content-ID :Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To: Resent-Cc:Resent-Message-ID:In-Reply-To:List-Help:List-Subscribe:List-Post: List-Owner:List-Archive; bh=56o7kp5zdCW5JAogWD0oo5CKcA+cImmDqQ8tJdvWal4=; b=P bbR3Ayr7zjrpWU39vee4mEpfVZfWawH4bMJjAGmO8QjbLN14USeViOjDygDNB4EUgeP06irt1zJQU q6JAXhsF4GXd9MYj38xAvb2lTRJkG3+UUmh+312L+TdycOFvDcwH4NZyrlqxJgVlXw16g3JZhBWfM EQPh5BkFvjCtUNLI=; Received: from mail-wr1-f49.google.com ([209.85.221.49]) by sfi-mx-1.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.95) id 1qW3Kl-006eKO-Hc for openvpn-devel@lists.sourceforge.net; Tue, 15 Aug 2023 23:20:21 +0000 Received: by mail-wr1-f49.google.com with SMTP id ffacd0b85a97d-3159d5e409dso4173188f8f.0 for ; Tue, 15 Aug 2023 16:20:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=openvpn.net; s=google; t=1692141609; x=1692746409; h=user-agent:content-disposition:content-transfer-encoding :mime-version:message-id:reply-to:references:subject :list-unsubscribe:list-id:auto-submitted:cc:to:date:from:from:to:cc :subject:date:message-id:reply-to; bh=56o7kp5zdCW5JAogWD0oo5CKcA+cImmDqQ8tJdvWal4=; b=QNxAH00BKApt5JM3jaRarcUxS2W3uSUMgUa4PUkkzaeU1K6GzXizC9fJp8eXEKk+2k RK+FkdotFW7SRUaj6+H5VSzbAaw0LWSXEJc44xRjtt0bWvGlkXUnFzhhcWt3rUJ1aphi ALLWrREYbgPzg5g7OgQumUWq0bJhdBssORYmb5c0S41rorpzwoy/qlyGsYPDQ0z4LkkP pWeObN33qITSZ6YZNdL75jX3EKwNv/xwcVZauG2w7LFRhdIw/ReC0djHZ947XmD+JQXH 6zXMaDYr7DQdceo3JR/QCak+A6b19+hJyt7tL8AdyiQwTPyWL0+u7Qioz2532yzUPnOa aV5A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692141609; x=1692746409; h=user-agent:content-disposition:content-transfer-encoding :mime-version:message-id:reply-to:references:subject :list-unsubscribe:list-id:auto-submitted:cc:to:date:from :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=56o7kp5zdCW5JAogWD0oo5CKcA+cImmDqQ8tJdvWal4=; b=Sdg49YED0+8zQ3lz2DG3fpIhOixjBBK/FXXRlTBkQXGvXF12B+2pmd8DDqMX+uMd/4 XZaxIF1yA5QkI6Ix+FmvluClTvJvBqvYK9HBjBfrIR02xl9zp/aPl6dqZJOnK2swPRSX vyb0YmruSGyutCQ6vDh6b+Qe1xbKHv3tbwHBiiBARO4Du/d88Lixd1Ke5DJ/As5MgVnB khb4xUBTw9VkV/V9pkDUpu6CE0f8AK57cn/VBHdE7/QzYEQzRf5I+CUtbkA+jEeetp7c us4sZuh3m3Y05nJ5vYwLLKgo5T487H2785/0yGM0ldCtHlGZGekevMSslC2NnNNqgkud LCfA== X-Gm-Message-State: AOJu0YzCOTaAOxY8hGSb9KxSz7MV10SBBfIrBomCKGTPyzstbB9M+vvD WqpjzdFBUZwzZJ6Gz1QICjDJ4ejmFtiiSU8iQ6M= X-Received: by 2002:a5d:63c8:0:b0:317:dd94:d38b with SMTP id c8-20020a5d63c8000000b00317dd94d38bmr2214077wrw.10.1692141609668; Tue, 15 Aug 2023 16:20:09 -0700 (PDT) Received: from gerrit.openvpn.in (ec2-18-159-0-78.eu-central-1.compute.amazonaws.com. [18.159.0.78]) by smtp.gmail.com with ESMTPSA id u11-20020a05600c00cb00b003fe29f6b61bsm19139986wmm.46.2023.08.15.16.20.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Aug 2023 16:20:09 -0700 (PDT) From: "ordex (Code Review)" X-Google-Original-From: "ordex (Code Review)" X-Gerrit-PatchSet: 1 Date: Tue, 15 Aug 2023 23:20:08 +0000 To: flichtenheld Auto-Submitted: auto-generated X-Gerrit-MessageType: newchange X-Gerrit-Change-Id: I61adc26ce2ff737e020c3d980902a46758cb23e5 X-Gerrit-Change-Number: 324 X-Gerrit-Project: openvpn X-Gerrit-ChangeURL: X-Gerrit-Commit: 511627fabe7628a96d17e436f56a8467baa4fd6d References: Message-ID: <020b4637527ee862752738889e4d19e91ae2b359-HTML@gerrit.openvpn.net> MIME-Version: 1.0 User-Agent: Gerrit/3.8.0 X-Spam-Score: -0.2 (/) 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: Attention is currently required from: flichtenheld. Hello flichtenheld, I'd like you to do a code review. Please visit Content analysis details: (-0.2 points, 6.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [209.85.221.49 listed in list.dnswl.org] -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [209.85.221.49 listed in wl.mailspike.net] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 WEIRD_PORT URI: Uses non-standard port number for HTTP 0.0 HTML_MESSAGE BODY: HTML included in message 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.0 T_KAM_HTML_FONT_INVALID Test for Invalidly Named or Formatted Colors in HTML X-Headers-End: 1qW3Kl-006eKO-Hc Subject: [Openvpn-devel] [XS] Change in openvpn[master]: dco: fix crash when --multihome is used with --proto tcp 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: , Reply-To: a@unstable.cc, openvpn-devel@lists.sourceforge.net, frank@lichtenheld.com Cc: openvpn-devel Errors-To: openvpn-devel-bounces@lists.sourceforge.net X-getmail-retrieved-from-mailbox: Inbox X-GMAIL-THRID: =?utf-8?q?1774339114730416169?= X-GMAIL-MSGID: =?utf-8?q?1774339114730416169?= Attention is currently required from: flichtenheld. Hello flichtenheld, I'd like you to do a code review. Please visit http://gerrit.openvpn.net/c/openvpn/+/324?usp=email to review the following change. Change subject: dco: fix crash when --multihome is used with --proto tcp ...................................................................... dco: fix crash when --multihome is used with --proto tcp Although it's a combination of options that is not really useful, when specifying --multihome along with --proto tcp and DCO is enabled, OpenVPN will crash while attempting to access c2.link_socket_actual (NULL for the TCP case) in order to retrieve the local address (in function dco_multi_get_localaddr()) Prevent crash by running this code only if proto is UDP. The same check is already performed in socket.c/h for the non-DCO case. Fixes: https://github.com/OpenVPN/openvpn/issues/390 Change-Id: I61adc26ce2ff737e020c3d980902a46758cb23e5 Signed-off-by: Antonio Quartulli --- M src/openvpn/dco.c 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/24/324/1 diff --git a/src/openvpn/dco.c b/src/openvpn/dco.c index 7c7eaac..cd3e0ad 100644 --- a/src/openvpn/dco.c +++ b/src/openvpn/dco.c @@ -509,7 +509,7 @@ #if ENABLE_IP_PKTINFO struct context *c = &mi->context; - if (!(c->options.sockflags & SF_USE_IP_PKTINFO)) + if (!proto_is_udp(c->c2.link_socket->info.proto) || !(c->options.sockflags & SF_USE_IP_PKTINFO)) { return false; }