From patchwork Wed Mar 29 12:46:44 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arne Schwabe X-Patchwork-Id: 3175 Return-Path: Delivered-To: patchwork@openvpn.net Received: by 2002:a05:7301:5492:b0:b2:b40d:92f9 with SMTP id ab18csp418081dyc; Wed, 29 Mar 2023 05:47:31 -0700 (PDT) X-Google-Smtp-Source: AKy350Y+HlxUBrqyYsHozweYgdFYKajHks62riKC3Nhm4gjKpVFd1CKrkNvFevW2KddBB709a7pD X-Received: by 2002:a17:902:e3c5:b0:19a:98c9:8cea with SMTP id r5-20020a170902e3c500b0019a98c98ceamr13811994ple.39.1680094051261; Wed, 29 Mar 2023 05:47:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680094051; cv=none; d=google.com; s=arc-20160816; b=o55DG2Bpiy4hR//yG6UY4hfuSeZldbNyuIknhYJtCVKnGS8NJyaIKP5TexmRsz/rWU snDRyPGgth7BR/PNTbXSA4Re8jL7vkxNMxEyfLTA+TNlCo0UpU7zy0c+DP0iqy15YICw EFheqGDa4QRLguwcp9NtXvI/XPzexJQnsHI8i/hQnoYVMKzAt5mAwfwn7b4ijROIJFz9 yxdZjKQYJju001uG0JKQoXsutdn7t8CxuZ21amLoj5XlcqQ6HB4W3Vn4ZrRX7DBXT356 k7cjBrRUOfA0MexnaTtAUJiRcgTLXTM4y9JV976NKMSXFJ5yJd+G12nMC9cbp4Nov2gv Zr6g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:content-transfer-encoding:list-subscribe:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence:subject :mime-version:references:in-reply-to:message-id:date:to:from :dkim-signature:dkim-signature; bh=RALEmC6i4Zs7duSIinZAg1xmhnsu4LtxMn51fiKCB4E=; b=SeAOmMuG2StBNMyHnJeSi92d0DHxXd6vfCcIgyoOtZOOKjxZPVmsHjHIsYQuuJ5vqU BfMOf/QnRsbqFzXaVYS+9cay/6X4IyQxR9FYbmBAVa5d71hDdev12ftFYKnK7JXfFgfp M0gO7geVRo0P/U/H9dEmwUgKxOXwXb35cAJMpmSkfPcA4o1uqG59c+atfYx3tmSG1zYj PfjYJS5a6OwhJxVJsvqXVlL2ZQ/1wzOQnX+HP+wzb35taee4mh1RR/0Hydx4MweST5+f naP5AKNeZFBDRnTA+d16dpCpl7531bQtvqHvNzXSG/PWWcI5EHccQBa2NDII+CNAyxgb Tr8A== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=i3vnjjEw; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=W1rtpVVJ; 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 Received: from lists.sourceforge.net (lists.sourceforge.net. [216.105.38.7]) by mx.google.com with ESMTPS id q7-20020a170902dac700b001a217b21186si12392904plx.579.2023.03.29.05.47.30 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 29 Mar 2023 05:47:31 -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=i3vnjjEw; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=W1rtpVVJ; 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 Received: from [127.0.0.1] (helo=sfs-ml-2.v29.lw.sourceforge.com) by sfs-ml-2.v29.lw.sourceforge.com with esmtp (Exim 4.95) (envelope-from ) id 1phVCk-0003Fc-Bu; Wed, 29 Mar 2023 12:47:06 +0000 Received: from [172.30.20.202] (helo=mx.sourceforge.net) by sfs-ml-2.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1phVCi-0003FW-FZ for openvpn-devel@lists.sourceforge.net; Wed, 29 Mar 2023 12:47:04 +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:References: In-Reply-To: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:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=GWDpAsf/w7K/nCtXPRnfbDEl0BDeoLIp5c+Hes0LMGs=; b=i3vnjjEwPQC33trVLjt8uquYm9 ZQE+GOWbO+2H8UyHRGp05FK3wyutITFKvpLYx74F3eO8bYrsVOmf2pbzqgInav0lL9KsBPSKcuoqh dnBpUTPhpQTxoOuvBDczyGkWHOEBUc8o9XP64alOGGgb9HOArTwdundSrcBE/yIbaDfY=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To: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:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=GWDpAsf/w7K/nCtXPRnfbDEl0BDeoLIp5c+Hes0LMGs=; b=W1rtpVVJUivu95EhuwsTgD1AOO /5qby+JULPNs4iQG5M0PX1JQQLTjwyKLoC2TCkGUny3BN5boBPWY9Qn6urY4v23fgmmOhTJSkd7LN XaTnuZEdL329cR3c901M8ZCYi7pYVfLYoxGg0+66en7bmHzpuIq96fGNjnw66TJvHkv4=; Received: from mail.blinkt.de ([192.26.174.232]) by sfi-mx-1.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.95) id 1phVCa-008MUi-6G for openvpn-devel@lists.sourceforge.net; Wed, 29 Mar 2023 12:47:04 +0000 Received: from kamera.blinkt.de ([2001:638:502:390:20c:29ff:fec8:535c]) by mail.blinkt.de with smtp (Exim 4.95 (FreeBSD)) (envelope-from ) id 1phVCO-0006kP-BM for openvpn-devel@lists.sourceforge.net; Wed, 29 Mar 2023 14:46:44 +0200 Received: (nullmailer pid 1956578 invoked by uid 10006); Wed, 29 Mar 2023 12:46:44 -0000 From: Arne Schwabe To: openvpn-devel@lists.sourceforge.net Date: Wed, 29 Mar 2023 14:46:44 +0200 Message-Id: <20230329124644.1956530-1-arne@rfc2549.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230214135658.1034787-1-arne@rfc2549.org> References: <20230214135658.1034787-1-arne@rfc2549.org> MIME-Version: 1.0 X-Spam-Score: 0.3 (/) X-Spam-Report: Spam detection software, running on the system "util-spamd-1.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: This can happen if the memory alloc fails. Patch V2: add goto error Change-Id: Iee66caa794d267ac5f8bee584633352893047171 Signed-off-by: Arne Schwabe --- src/openvpn/dco_linux.c | 7 +++++++ 1 file changed, 7 insertions(+) Content analysis details: (0.3 points, 6.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 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 0.2 HEADER_FROM_DIFFERENT_DOMAINS From and EnvelopeFrom 2nd level mail domains are different X-Headers-End: 1phVCa-008MUi-6G Subject: [Openvpn-devel] [PATCH v2] Add missing check for nl_socket_alloc failure 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 X-GMAIL-THRID: =?utf-8?q?1757815061060043541?= X-GMAIL-MSGID: =?utf-8?q?1761706299887012887?= This can happen if the memory alloc fails. Patch V2: add goto error Change-Id: Iee66caa794d267ac5f8bee584633352893047171 Signed-off-by: Arne Schwabe --- src/openvpn/dco_linux.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/openvpn/dco_linux.c b/src/openvpn/dco_linux.c index 41540c0f8..95fe94848 100644 --- a/src/openvpn/dco_linux.c +++ b/src/openvpn/dco_linux.c @@ -83,6 +83,13 @@ resolve_ovpn_netlink_id(int msglevel) int ret; struct nl_sock *nl_sock = nl_socket_alloc(); + if (!nl_sock) + { + msg(msglevel, "Allocating net link socket failed"); + ret = -1; + goto err_sock; + } + ret = genl_connect(nl_sock); if (ret) {