From patchwork Tue Dec 15 06:16:00 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Domagoj Pensa X-Patchwork-Id: 1552 Return-Path: Delivered-To: patchwork@openvpn.net Delivered-To: patchwork@openvpn.net Received: from director12.mail.ord1d.rsapps.net ([172.30.191.6]) by backend30.mail.ord1d.rsapps.net with LMTP id IPu0NFDz2F+qLQAAIUCqbw (envelope-from ) for ; Tue, 15 Dec 2020 12:33:04 -0500 Received: from proxy7.mail.ord1d.rsapps.net ([172.30.191.6]) by director12.mail.ord1d.rsapps.net with LMTP id WFVfNFDz2F/iHwAAIasKDg (envelope-from ) for ; Tue, 15 Dec 2020 12:33:04 -0500 Received: from smtp23.gate.ord1d ([172.30.191.6]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) by proxy7.mail.ord1d.rsapps.net with LMTPS id yCiINlDz2F+bZAAAMe1Fpw (envelope-from ) for ; Tue, 15 Dec 2020 12:33:04 -0500 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: smtp23.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=pensa.hr X-Suspicious-Flag: YES X-Classification-ID: 95ee4a0a-3efb-11eb-90a5-525400bfb165-1-1 Received: from [216.105.38.7] ([216.105.38.7:34014] helo=lists.sourceforge.net) by smtp23.gate.ord1d.rsapps.net (envelope-from ) (ecelerity 4.2.38.62370 r(:)) with ESMTPS (cipher=DHE-RSA-AES256-GCM-SHA384) id EA/08-28983-053F8DF5; Tue, 15 Dec 2020 12:33:04 -0500 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.90_1) (envelope-from ) id 1kpEBT-000386-FL; Tue, 15 Dec 2020 17:32:23 +0000 Received: from [172.30.20.202] (helo=mx.sourceforge.net) by sfs-ml-2.v29.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kpEBS-00036d-Gh for openvpn-devel@lists.sourceforge.net; Tue, 15 Dec 2020 17:32:22 +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 :Date:Subject:Message-ID:Cc:To:From:Sender:Reply-To: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=4e5wvsMjiDaqGMsIhPDRuO97NCp51bpMrlSq+zo0Gpg=; b=AO/LH3tmshOzlmeHqOHoBr5dc2 oK7L+SrqA5CHju5JtHjSdJE0uWl8uu26+HQDqJZZPCRoxjFbVYLL3BK7Qe+627VEXDEqx1C0MjWfk SbuleX0BUyXYVM5AbbaD4CuowAKCGAgMfULnUPJ6SyCeI2EP5VLpwkRTXRB6MsRDKiho=; 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:Date:Subject: Message-ID:Cc:To:From:Sender:Reply-To: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=4e5wvsMjiDaqGMsIhPDRuO97NCp51bpMrlSq+zo0Gpg=; b=gkWVCDmg/DgWcmQDKCmmppn5/Z 7btTJmj9A84N7GREkOAer9XVJJERxlvAwI5dQcm1Zy2QfPErRajIYHPtCh5uTYgTuG3QD2xXqmKKg VCXbT3roA1Yrqs90Ovw1P2jcqoelAM0t37ZUl6wR4ev/RJ5bG0nvbzL253lByb54KpTw=; Received: from sender4-of-o50.zoho.com ([136.143.188.50]) by sfi-mx-1.v28.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92.2) id 1kpEAq-00EYeV-EI for openvpn-devel@lists.sourceforge.net; Tue, 15 Dec 2020 17:31:48 +0000 ARC-Seal: i=1; a=rsa-sha256; t=1608052567; cv=none; d=zohomail.com; s=zohoarc; b=AqyWyxgHlhg0SU+BjeMsWlG+TMoueI38vN6/TSNZNPryrnaGiXW9HK0AqsmS2/4El2Swyenk1Q8FnfEavHiDwXWZ2Ov+F5U+uGbDOzFsNX3Nu187a0foK/zssiL5Gkq3AuQQ3e95LsEd8gKHlXSJJZZYzA0Skj5XxTGga8eQV2A= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1608052567; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:MIME-Version:Message-ID:Subject:To; bh=4e5wvsMjiDaqGMsIhPDRuO97NCp51bpMrlSq+zo0Gpg=; b=AcE+2bybeUuqTNIij54WFHmx0of4Sodv+FlXSFMpZRLoz7+NJqCZkH/cDaT2ZoqdWZVneldZk3eGgleHqYjQTQJAEbuVuMJFT7nZk1sJtaYrc8ute3CEKAewNEaoFZ0v4ZibHzuNXYsZQyG6DxVzD4Q4cLHCgJ8O/z8uDQ5Morg= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass smtp.mailfrom=domagoj@pensa.hr; dmarc=pass header.from= header.from= Received: from localhost (21-233.dsl.iskon.hr [89.164.21.233]) by mx.zohomail.com with SMTPS id 1608052563090877.9381997072572; Tue, 15 Dec 2020 09:16:03 -0800 (PST) From: Domagoj Pensa To: openvpn-devel@lists.sourceforge.net Message-ID: <20201215171600.25534-1-domagoj@pensa.hr> Date: Tue, 15 Dec 2020 18:16:00 +0100 X-Mailer: git-send-email 2.29.2 MIME-Version: 1.0 X-ZohoMailClient: External X-Spam-Report: Spam Filtering performed by mx.sourceforge.net. See http://spamassassin.org/tag/ for more details. -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [136.143.188.50 listed in list.dnswl.org] 0.0 RCVD_IN_MSPIKE_H4 RBL: Very Good reputation (+4) [136.143.188.50 listed in wl.mailspike.net] 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: pensa.hr] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 RCVD_IN_MSPIKE_WL Mailspike good senders X-Headers-End: 1kpEAq-00EYeV-EI Subject: [Openvpn-devel] [PATCH] Fix too early argv freeing when registering DNS 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: , Cc: Domagoj Pensa Errors-To: openvpn-devel-bounces@lists.sourceforge.net X-getmail-retrieved-from-mailbox: Inbox When registering DNS on Windows, argv is freed after being used in first ipconfig command (/flushdns). Then same argv is used uninitialized in next ipconfig command (/registerdns) causing heap exception and subprocess crash. As a consequence second command is never executed and locked netcmd semaphore is not cleanly released. Removing argv freeing between ipconfig calls solves the problem. This issue was introduced in commit 870e240 (argv: do fewer memory re-allocations). After a quick glance at commit no similar problem was spotted in rest of the argv related changes. Signed-off-by: Domagoj Pensa Acked-by: gert@greenie.muc.de --- src/openvpn/tun.c | 1 - 1 file changed, 1 deletion(-) diff --git a/src/openvpn/tun.c b/src/openvpn/tun.c index 400a50ca..2b227bb6 100644 --- a/src/openvpn/tun.c +++ b/src/openvpn/tun.c @@ -5235,7 +5235,6 @@ ipconfig_register_dns(const struct env_set *es) WIN_IPCONFIG_PATH_SUFFIX); argv_msg(D_TUNTAP_INFO, &argv); openvpn_execve_check(&argv, es, 0, err); - argv_free(&argv); argv_printf(&argv, "%s%s /registerdns", get_win_sys_path(),