From patchwork Mon Oct 27 21:33:02 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gert Doering X-Patchwork-Id: 4530 Return-Path: Delivered-To: patchwork@openvpn.net Received: by 2002:a05:7000:2995:b0:72f:f16c:e055 with SMTP id f21csp1667999max; Mon, 27 Oct 2025 14:33:21 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVE5gXZYHT5MMwDaXoT5pXXqYSqULiud39u7b+8UVb5XdH+JUmlSIKuRSCRm6zhn7oFW578htYrjt8=@openvpn.net X-Google-Smtp-Source: AGHT+IF/J1MykpPi24UGIGU7EhwQMo/WaE2CKwRx9CHRgyduaJ7qblgDkMCCrbHvefdlQv2z0ox2 X-Received: by 2002:a05:6602:6b07:b0:93e:7d6d:e0d0 with SMTP id ca18e2360f4ac-945b819ed4emr233336739f.6.1761600800900; Mon, 27 Oct 2025 14:33:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1761600800; cv=none; d=google.com; s=arc-20240605; b=iDeEq0+kAtAb67fq4WBC1RIC8jKKaibJvOET3vy+6/QAZTdPRp8iwyD1f/CcVOz1zT sT4jk92iTmdNRO+hmy/PBgfar3y6QcIdabWe6TyNO6TCjjWDzbuI6WcEAT0jlaFpm4JU Y6J8v9+7I/W7o5pHviLjLDwlk3xuhNGgruELTBWPvFGoc6sMVwkxJLdYjpUGhXoCCTiV tWu1EKv0lVsliIfN7P0JhAApEWumvL9SRRVKFsm7VKQcPchpDdt4Oz+ugv9TTkI4jlC+ lxummadUibA3UWfTOubzt8o7pn4i4fNkdPJv7NmV+lkgJ23oQkWCwyrpYv2F0QViU5yy uRjw== 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=KpCeQFXtjDHD/AnQ/4/h1Kz+dxwJVluhfRe152D4TV0=; fh=4NbAC/LsuMLI0S0hprUlLSLCiHwg6SCAifhH718Jh0Q=; b=Zl5jjA/+FEW2V9yooH8tOoGvInMOfOjsuvk63mLXz1MUwbo8m0iFxW4WBz98Jjruki ozXLqPBAJ1C1RPMaBi/sMxami62kE/8Hs5YcRUMMUgB6sd5BQITWV3gDxWzJ1haYfRmL xwttkkmtNYMEKhtxYTTJFAZamyNqSvH8sGhoXG+t+yWtbm0wjBwN+RivhX0ONWxY63KI ZLx860VoQQGJnMNDpz1DqFLRI+nywI3KBJZ1vQpfQmnMsI0lKvLWIgLQHkOAx84zWB3a gjKsRGfz1CsFggfLKsP3aJK3BpGfzF4mpjHs8Q5lz/fRzxwp8uD8sp4g58KMC0wpVTP2 XfBQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lists.sourceforge.net header.s=beta header.b=JhrLosIq; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=dLrhk7SF; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=MZJuaAdX; 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 ca18e2360f4ac-9435c7ee9edsi541383539f.301.2025.10.27.14.33.20 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 27 Oct 2025 14:33:20 -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=JhrLosIq; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=dLrhk7SF; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=MZJuaAdX; 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=KpCeQFXtjDHD/AnQ/4/h1Kz+dxwJVluhfRe152D4TV0=; b=JhrLosIqfCf+NAw5mcwZmyPyD0 1g4ZeO39HPwFkly0oJO3t1lOErqx4+be9xKIb2KTG69oDP9eEsgyEawzuo99dkkwgoQwa58ZgX4h7 gdspj7yBRSdgp+dZ/QxvgCu+VsleRsy7RZvlzzAVcyB/kMVF/dG0XnWCfH0x6ZMxEyns=; 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 1vDUq6-00031J-AD; Mon, 27 Oct 2025 21:33:18 +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 1vDUq4-00031C-Go for openvpn-devel@lists.sourceforge.net; Mon, 27 Oct 2025 21:33:16 +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=NurD0gA0F5ZJFrZbCF4rJoMq3Y3mk9AR7sHpSfIYpvs=; b=dLrhk7SF5rviqry/OMiyVpp+/T jpxRg1P7p8xnGvb2qfW+6tBIpoFgNnIiQdQD5DsHlVPmgwXWif+P6kAYuKEtSwd5uhsZps7YDVsnZ WCeVDYhrjadD1Xm51SfBd6/zPa5dvlNIOsVxaLpj+KMvtPP42DCmRbqUNNAdZPp1/7lM=; 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=NurD0gA0F5ZJFrZbCF4rJoMq3Y3mk9AR7sHpSfIYpvs=; b=MZJuaAdXhjHk8Z7tnuoXj9dpRi YfHVG4gzAFc/unijV7E2pFM4fLXeES4zrc7lLfGte3SKOsTo17YRE/ywaMoqq5C5ZUS9PUS+etL+Z L6XmRrKZ7TtcJaSmtJNY1inUbIjPZfzIZggOeaG4DeagHYCNCTeUgzvFiGBEmhpplt/A=; 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 1vDUq3-0005tV-JQ for openvpn-devel@lists.sourceforge.net; Mon, 27 Oct 2025 21:33:16 +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 59RLX9d3005610 for ; Mon, 27 Oct 2025 22:33:09 +0100 Received: (from gert@localhost) by blue.greenie.muc.de (8.18.1/8.18.1/Submit) id 59RLX9Zs005609 for openvpn-devel@lists.sourceforge.net; Mon, 27 Oct 2025 22:33:09 +0100 From: Gert Doering To: openvpn-devel@lists.sourceforge.net Date: Mon, 27 Oct 2025 22:33:02 +0100 Message-ID: <20251027213308.5588-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-1.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 If for whatever reason the child pid is zero, we would kill ourselves since killing 0 means killing the own process group. Reported-By: contact@joshua.hu Found-By: Zeropath Change-Id: I7b94de92723f9528b01cb932bb079eedf0f1f272 Signed-off-by: Arne Schwabe Acked-by: Gert Doering 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?1847172321454085411?= X-GMAIL-MSGID: =?utf-8?q?1847172321454085411?= From: Arne Schwabe If for whatever reason the child pid is zero, we would kill ourselves since killing 0 means killing the own process group. Reported-By: contact@joshua.hu Found-By: Zeropath Change-Id: I7b94de92723f9528b01cb932bb079eedf0f1f272 Signed-off-by: Arne Schwabe Acked-by: Gert Doering Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1319 --- 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/+/1319 This mail reflects revision 1 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..124db6d 100644 --- a/src/openvpn/tun_afunix.c +++ b/src/openvpn/tun_afunix.c @@ -128,7 +128,12 @@ close(tt->fd); tt->fd = 0; } - kill(tt->afunix.childprocess, SIGINT); + /* only kill the child process if the PID is not 0 to avoid killing + * ourselves by accident */ + if (tt->afunix.childprocess) + { + kill(tt->afunix.childprocess, SIGINT); + } free(tt->actual_name); free(tt);