From patchwork Wed Jan 28 11:04:37 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gert Doering X-Patchwork-Id: 4739 Return-Path: Delivered-To: patchwork@openvpn.net Received: by 2002:a05:7000:8468:b0:80a:3855:ce6a with SMTP id u8csp2651502max; Wed, 28 Jan 2026 03:05:30 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCWVNuh4SH1PmbynzwhDwOiqLfn++aZAaoCQkRhPUXOJ0j1m3mnAzvyPx74ToHqyh4ScOBnKJ+cwgww=@openvpn.net X-Received: by 2002:a4a:e54f:0:b0:662:f440:371 with SMTP id 006d021491bc7-662f44004ecmr2149350eaf.42.1769598330733; Wed, 28 Jan 2026 03:05:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1769598330; cv=none; d=google.com; s=arc-20240605; b=V7R7XetMpc9SRl2fT+Ggce43Jwq+AxO5I51zKvKUoIWrJWGpSKfPRwf/1zsk3hANae g0LDRVV4mw7XU6euGMv7WGoOk8fw3RkO82apDypn0mH6sFxCMmA7NYwsih860o7BlSDQ p958V8wjchheG/FpLvOrZ0vEVhmtTOpsV+/KGcbWdvlUWcSc2IACqHEpFaBYNO99e0bY 4Trx/qYF6/8+HpgFGC2TD48srvsvNw2R6JBqEJVyFxK3y8fzeu7/FATAhSsN387ACMWu kSB6kRkiR6TsTSN4YeS4hD+HwvcZdqyHX01pox4z39a8Moyv9qH7fYVNUZw4JyMsRT7o 9EQw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; 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:dkim-signature; bh=fzPf9FJNZxQ5bEFxSpr/TzK+UiQkyu3aeigUvV5GVzg=; fh=4NbAC/LsuMLI0S0hprUlLSLCiHwg6SCAifhH718Jh0Q=; b=H5ba38xP2gnAPQizmB19ucD7UUreMT080lsLGYZvyXT9f1AqZAWJ5d2BproOsIe5QH VQXvav4ZrlMqxLkn5NmBYjgbAG1+H7jBcd/ZPHOvErT51uNlCNpn4UrHS+KkpP7hFumC 1eT/1GCy0QRmjYIcyJ5CpzexpqYu8wUDdq5ny7/+t1tUHfnC/bNsyrjpX8v3kztJ5KTE EzZB8fD7F1SCB0QeAJJsy9QnPEUEC3rSHZi19HEbbJtKsJ84/AdC+QzAmrRjvz+rd6Ty aJWgM+Jd7Bhf/6dpwlLTTV0X/Cnrsj+MdKRreFP/IDruuPj9tgVddJwd7a8bkYaFmrJy Xdpw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lists.sourceforge.net header.s=beta header.b=gZABdu8b; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=HKBtuzfE; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=iz1vnOpI; 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=muc.de Received: from lists.sourceforge.net (lists.sourceforge.net. [216.105.38.7]) by mx.google.com with ESMTPS id 586e51a60fabf-409577e09d2si1850696fac.358.2026.01.28.03.05.30 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 28 Jan 2026 03:05:30 -0800 (PST) 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=pass header.i=@lists.sourceforge.net header.s=beta header.b=gZABdu8b; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=HKBtuzfE; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=iz1vnOpI; 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=muc.de DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.sourceforge.net; s=beta; h=Content-Transfer-Encoding:Content-Type: List-Subscribe:List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: Subject:MIME-Version:References:In-Reply-To:Message-ID:Date:To:From:Sender: Reply-To:Cc:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=fzPf9FJNZxQ5bEFxSpr/TzK+UiQkyu3aeigUvV5GVzg=; b=gZABdu8bpCvIpmY9ScOfXTU9ag SGdXZOmQuA51gpeMu7oBcc2o55xbmVzip9IzpSY4s6FYuSUgvXoGkFgU+y0KAwj9bnpIqpTUf0y6E V9NY68pDsNEdDZuPW+kuaKc3CcSjOIixdRO88aijgrEuLCxKJyy3UhYk3FCAfWjswWVo=; 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 1vl3MV-0000na-KU; Wed, 28 Jan 2026 11:05:28 +0000 Received: from [172.30.29.66] (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 1vl3Lz-0000lA-Hp for openvpn-devel@lists.sourceforge.net; Wed, 28 Jan 2026 11:04:56 +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=WFypeoK9S7ttdBQQo7eGUs5HPrhWxG7rl/sXxfE9/4I=; b=HKBtuzfEFG/8SLgSLFEmeCEAVf q8Bi34nMjMWeqwxLnVKb9zM9xgTO3sRlaWRBtBZMWx4y5FDv0wxAYaMIeJ7KmMTVdvvHOojsoKnFB rrPjSKEwOkgVBw92djfEWdNcmyHEQOWni4i2Sft9x9+jRjRR6zHcJFkxqX1hoAEC9juw=; 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=WFypeoK9S7ttdBQQo7eGUs5HPrhWxG7rl/sXxfE9/4I=; b=iz1vnOpIi8X24EXCapyen50olW /MFsTA70WWecjOHko1hn1/oA9gmI1SJR3tHaIBjnZA2pze0SRKI2zVn5bBP088npAVjlw54Nj8Mzh wkofxK+Xv3W9J+iF9/UCuocInWO2h5UruMBf1N6MoWl5TAo/CtGTUWN6S+mKmtfwEmUE=; Received: from [193.149.48.134] (helo=blue.greenie.muc.de) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.95) id 1vl3Lz-0000Rk-Bf for openvpn-devel@lists.sourceforge.net; Wed, 28 Jan 2026 11:04:56 +0000 Received: from blue.greenie.muc.de (localhost [127.0.0.1]) by blue.greenie.muc.de (8.18.1/8.18.1) with ESMTP id 60SB4hV5024439 for ; Wed, 28 Jan 2026 12:04:43 +0100 Received: (from gert@localhost) by blue.greenie.muc.de (8.18.1/8.18.1/Submit) id 60SB4hnf024438 for openvpn-devel@lists.sourceforge.net; Wed, 28 Jan 2026 12:04:43 +0100 From: Gert Doering To: openvpn-devel@lists.sourceforge.net Date: Wed, 28 Jan 2026 12:04:37 +0100 Message-ID: <20260128110443.24410-1-gert@greenie.muc.de> X-Mailer: git-send-email 2.51.2 In-Reply-To: References: MIME-Version: 1.0 X-Spam-Score: 1.3 (+) X-Spam-Report: Spam detection software, running on the system "sfi-spamd-2.hosts.colo.sdot.me", 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: From: Heiko Hund If the dns-updown option appears in the config twice, there is a chance of a NULL pointer dereference when comparing the script path to the default script path. This happens when a custom script is se [...] Content analysis details: (1.3 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 1.3 RDNS_NONE Delivered to internal network by a host with no rDNS X-Headers-End: 1vl3Lz-0000Rk-Bf Subject: [Openvpn-devel] [PATCH v1] Prevent NULL pointer dereference with --dns-updown 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?1855558338939203449?= X-GMAIL-MSGID: =?utf-8?q?1855558338939203449?= From: Heiko Hund If the dns-updown option appears in the config twice, there is a chance of a NULL pointer dereference when comparing the script path to the default script path. This happens when a custom script is set, after the dns-updown script was disabled first. In that case the script path is NULL, which leads to the deref during a strcmp(3). Reported-by: Change-Id: Id530d890ba01cffb74d3dc04ad10b153f7bea1d4 Signed-off-by: Heiko Hund Acked-by: Arne Schwabe Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1498 --- This change was reviewed on Gerrit and approved by at least one developer. I request to merge it to master. Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1498 This mail reflects revision 1 of this Change. Acked-by according to Gerrit (reflected above): Arne Schwabe diff --git a/src/openvpn/options.c b/src/openvpn/options.c index 85669e0..2bca647 100644 --- a/src/openvpn/options.c +++ b/src/openvpn/options.c @@ -7890,7 +7890,7 @@ } else { - if (streq(dns->updown, DEFAULT_DNS_UPDOWN)) + if (dns->updown && streq(dns->updown, DEFAULT_DNS_UPDOWN)) { /* Unset the default command to prevent warnings */ dns->updown = NULL;