From patchwork Tue Oct 28 11:59:47 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gert Doering X-Patchwork-Id: 4533 Return-Path: Delivered-To: patchwork@openvpn.net Received: by 2002:a05:7000:2995:b0:72f:f16c:e055 with SMTP id f21csp1985491max; Tue, 28 Oct 2025 05:00:12 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCV+cLmYWFihJptdzeOxJIVu95XFY/gUUgI3Ne7cCzhXYyHXatkbqimRlvZDK9DUlRgjQDR+XjKw4kM=@openvpn.net X-Google-Smtp-Source: AGHT+IF7ZzYQfD22oxIci12qXS3q5JAMdDugbhW2myZQIysL7XGjOZ0MvMK4WlTeDYbvNiy+CkqZ X-Received: by 2002:a05:6830:6b0e:b0:7b0:39ff:8df7 with SMTP id 46e09a7af769-7c6781889a3mr1870920a34.24.1761652812757; Tue, 28 Oct 2025 05:00:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1761652812; cv=none; d=google.com; s=arc-20240605; b=UvsdE9FywYaYYxAQXMxMiZFfedIyaylKrMmoV3QeBLof5Cl9AdV3p3w0Hrkee+YFZe 7susDb1j79fIlNy+33qKQF4yjO9BRSVIUWoZaYHvaG0CLBa7qov1OxP3PDLqe920Gfzi OzESWHcGwf1kcdLv6eMNPu1lxPE3CJQmjVG+ug6dA0fYco7Fi9DJXoygM4jxtjqRPY9p fMbXFS/VYbbdW6XzQc3JIOWiegQ7jERqD2URpZw7LMGWFKMm04o107q8cPkeTd8nogeC vdAHTdmhWRVvDQQfNZVRre4l+Q6wZ0bP5yZdyHMf2LIaEDSvn/Afk+1Us58uo5PoLfVu 6wAw== 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=n9MMsvuKeM18jm+urrdAJoKb5k5U9GyuZBTy6XJazVc=; fh=4NbAC/LsuMLI0S0hprUlLSLCiHwg6SCAifhH718Jh0Q=; b=AwguPVefnrp629qLnC/95KrjDOwd6nflByN+43tvD80Vv5kkcVhxAdV1XeoCnJJVgL ulgHxn3LV6B/aRC1MTOJUHzOl4d7QTbJB5gkfHoF1ALqYqKHSol58Qu9uZkNs1a9JSSX JTuMWXlxu7H6esMaRmHHzfT8PncisZsSuABMctj6kS1BsBMk+X66zg7rzCKK6+fKY3/I 4CvOAM5TaSfVfjyLnrMCMDEV/qV7xMwlnxcqOY3Z4QzsuDKjKPEQjoaCAtAdF2BJznEj 2m30q39mfZnXtDYXPPliJ956EUvy7Ld/+KQsetkhMp7+n1df8v1PoSUtNp7Ov8w3pmOz 8pVQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lists.sourceforge.net header.s=beta header.b=DV7jWkL7; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=TRT8lF+Z; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b="e+eus/0T"; 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 46e09a7af769-7c530ca6839si2562479a34.463.2025.10.28.05.00.12 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 28 Oct 2025 05:00:12 -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=pass header.i=@lists.sourceforge.net header.s=beta header.b=DV7jWkL7; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=TRT8lF+Z; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b="e+eus/0T"; 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=n9MMsvuKeM18jm+urrdAJoKb5k5U9GyuZBTy6XJazVc=; b=DV7jWkL7EsYcjOgYnT+Gtetx2o 0aEkOcWMJrfhTTJQpMh7hwR6F5aIUwiupy7mdlyN6LQ3Io78vcqEeMSuPZsUjjUEWqqO2IUJxkh7Y CepCINg/QWe8CCATJsjwELcFYRqLk3yDRVr+NYveZIN12pfnh/c+wWGb255p0wuQ44vI=; 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 1vDiMz-00045b-57; Tue, 28 Oct 2025 12:00:09 +0000 Received: from [172.30.29.66] (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 1vDiMw-00045M-MM for openvpn-devel@lists.sourceforge.net; Tue, 28 Oct 2025 12:00:07 +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=+2vMpoFG+emd6UwdOJUqTDQggxQhH6OZc5J0RxFYrqs=; b=TRT8lF+ZS3EgWMe7DyN5K5urpI w6vZ4LLzpjkCz11d+cm+lfr27HP/3eCBc/rrYl2XHScL36nkoyghht4zmXNA2W5lN1w6DgCTiDq7r 7bZT5GtkB0ZZC0VZ2DUtP3Zg7ILtx8hGEsdoKkC+3oHPQyW6wrRgpmqd2DcnnYrKnGNc=; 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=+2vMpoFG+emd6UwdOJUqTDQggxQhH6OZc5J0RxFYrqs=; b=e+eus/0Tc7LoC8xB7htT+4QWNj 7mJEgNaNJJeYfI8QYKIaEHOulnz7lucxwnHEHrQaVeOPJsqyZ6hqBKoeQHbGW+J6lvbi18YUMVrQ+ sO3hAaFs0yXWb63z+u09SKzqPv6qOgDo/P2+XNvxDeuGxkND/5t4fh3PzjjpzK9CAM+Y=; 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 1vDiMv-0001Kg-J1 for openvpn-devel@lists.sourceforge.net; Tue, 28 Oct 2025 12:00:06 +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 59SBxssH022505 for ; Tue, 28 Oct 2025 12:59:54 +0100 Received: (from gert@localhost) by blue.greenie.muc.de (8.18.1/8.18.1/Submit) id 59SBxrNb022504 for openvpn-devel@lists.sourceforge.net; Tue, 28 Oct 2025 12:59:53 +0100 From: Gert Doering To: openvpn-devel@lists.sourceforge.net Date: Tue, 28 Oct 2025 12:59:47 +0100 Message-ID: <20251028115953.22487-1-gert@greenie.muc.de> X-Mailer: git-send-email 2.49.1 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: Arne Schwabe The calling code only calls tun_afunix_exec_child if is_tun_afunix is true, which checks that the path is having unix: as prefix. But since adding an ASSERT here to ensure that it is really the case does not cost us anything, just add the ASSERT. 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: 1vDiMv-0001Kg-J1 Subject: [Openvpn-devel] [PATCH v2] Add ASSERT to afunix code that dev_node is always set up the way we expect 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?1847226859426881230?= X-GMAIL-MSGID: =?utf-8?q?1847226859426881230?= From: Arne Schwabe The calling code only calls tun_afunix_exec_child if is_tun_afunix is true, which checks that the path is having unix: as prefix. But since adding an ASSERT here to ensure that it is really the case does not cost us anything, just add the ASSERT. Reported-By: Joshua Rogers Found-By: Zeropath Change-Id: Idbb7bf279eb467fc1d56ab75a50b5eb2c8d0a57e Signed-off-by: Arne Schwabe Acked-by: Gert Doering Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1320 --- 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/+/1320 This mail reflects revision 2 of this Change. Signed-off-by line for the author was added as per our policy. Acked-by according to Gerrit (reflected above): Gert Doering diff --git a/src/openvpn/tun_afunix.c b/src/openvpn/tun_afunix.c index 4d48a31..e6f2be1 100644 --- a/src/openvpn/tun_afunix.c +++ b/src/openvpn/tun_afunix.c @@ -53,6 +53,8 @@ const char *msgprefix = "ERROR: failure executing process for tun:"; struct argv argv = argv_new(); + /* we should always called with a proper unix: dev node string */ + ASSERT(dev_node && strncmp(dev_node, "unix:", strlen("unix:")) == 0); /* since we know that dev-node starts with unix: we can just skip that * to get the program name */ const char *program = dev_node + strlen("unix:");