From patchwork Mon Dec 15 15:56: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: 4686 Return-Path: Delivered-To: patchwork@openvpn.net Received: by 2002:a05:7001:1490:b0:7b1:439f:bdf with SMTP id bf16csp1911912mac; Mon, 15 Dec 2025 07:57:11 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCVVoRH4HpB33SjzaJhwow40M4XtkmHSMm8rXl/+iEbTRDfWq9Anl8jlH3sF1lS4nuS6u9mH64JFQgE=@openvpn.net X-Google-Smtp-Source: AGHT+IGgMxj9LhQSzPFIU3Pitn+NkIDHPDbFiM12C4QlryPI4725d9smSmgJO1I8uGb/6g/3NuKi X-Received: by 2002:a05:6820:16a3:b0:659:9a49:8ef4 with SMTP id 006d021491bc7-65b4528952cmr4747663eaf.40.1765814230954; Mon, 15 Dec 2025 07:57:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1765814230; cv=none; d=google.com; s=arc-20240605; b=UJpMcWFFU8ecGZn8KQcGwERBuPxk8+v0llSYJjNtH6HmsQj2gOheYVleYmm1SOph5d 2QpLSRocAEtlD6H1xAsN1ev4SlL3ukzgEhKtJzQJ42wY8HffhI0RbbOaqYsJXfFrKlnw qVJR1YZ2HajI00tWJ4ndKexWuRMKsfncJ6ErYJFi7UFTGU1i/i32AIVt1VCysSvzqPW5 1dDl9FElbdEeZJZ90STUoYmCI3OhZ23FhsYBauaS+axXtaE3S3Nk+rycRLj8mcsudF1N sE7b3dNEnw+OXymnvWCUcp5XCj4HSOP88lPMuXqqaPBKG1vx1WCV6RlR4DONhthjIOYm H3Sg== 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=pDKm2TFW/Tt4euUnOTTRropLCNATFKmqJwj3p8hU9eo=; fh=4NbAC/LsuMLI0S0hprUlLSLCiHwg6SCAifhH718Jh0Q=; b=hncWKh3Q+neNcUPvg/si1yjgR6phknu55wSAlFaMvm1yomxGuksXlo72RT9lEon7iN GJZchQ8+OniuetcJ/l9eayR48IIrSOwuSKnj23XggMVBUjGaZvB+YU6DJytURbCMJqDE kC5rCbgbUNTa8uxYg30cBelkPwon8qzGmnfzBo3GQ9sZHAznScLSWZ20yHYvNwC9Owk8 OPhYuAbNMR2d7pegCjvJKoZH6dx3l1XjpavLGzOYR/bfLfjCOZVPop9N9Oe77BQs9QvM 34KInVL2GoQHkDh6SacSRw7roK+NGvgDTKitQu+NSktvsExTxJKaCgO0FlE4bLQUrNln Uv7Q==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lists.sourceforge.net header.s=beta header.b=Pfs10wAo; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=OzmMS1iC; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=HNW1jf6w; 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-3f614b9984esi5718505fac.47.2025.12.15.07.57.10 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 15 Dec 2025 07:57:10 -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=Pfs10wAo; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=OzmMS1iC; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=HNW1jf6w; 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=pDKm2TFW/Tt4euUnOTTRropLCNATFKmqJwj3p8hU9eo=; b=Pfs10wAo6QPSTwgrO5j6XxgDgr 54K13oHbDkL/d8NEfRbYI0UQCBweBJcDOo6gjBqHl3mmOcWw2JC1NKD6z/XFLwf3DBwsJGn6umma6 zBXkF//El4ZzEJy7sSY3d40nARL6/0de4TAwDUcYXyTKb0itA02l85+ANKlNp3LCKe0w=; Received: from [127.0.0.1] (helo=sfs-ml-3.v29.lw.sourceforge.com) by sfs-ml-3.v29.lw.sourceforge.com with esmtp (Exim 4.95) (envelope-from ) id 1vVAwe-0006K7-UT; Mon, 15 Dec 2025 15:57:08 +0000 Received: from [172.30.29.66] (helo=mx.sourceforge.net) by sfs-ml-3.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1vVAwd-0006Jz-Tm for openvpn-devel@lists.sourceforge.net; Mon, 15 Dec 2025 15:57: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=oUAmU+1NShOgf+2Qc69eeamVYAELF6AHlzJTf7m0Lfc=; b=OzmMS1iCLaCLe+9CvGnoKg7BVb Fq94X3j+jOVd1il3NJKn9IKa/BASg6Na1YFUqRwjieeLgPXI8VRzI/VfsmYCMBI2lrRBe5A30ACQQ mvrSLTtQkm94PvaXMhF8sUqk1U3bDYruo0eSWeW7FrzvRiUXc3U04yEhAkPKcJPNzeQc=; 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=oUAmU+1NShOgf+2Qc69eeamVYAELF6AHlzJTf7m0Lfc=; b=HNW1jf6w5sO0ycLdzoPRvL19L+ f8VBJqZOb0wjauwoboZIaeVrTuH+xR32+8DQSKJ5GXqlo5KeVQmaQjsj/Cv1+6WRzoW1HkouUz5pN Mww2fJcCpQlaFIkfzGtW1geEUN1jkswOqzHGzRceFaqoXZUCAtNIW3gy6WQCf1WPBXoQ=; 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 1vVAwd-0005qv-4Q for openvpn-devel@lists.sourceforge.net; Mon, 15 Dec 2025 15:57:07 +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 5BFFut1i023386 for ; Mon, 15 Dec 2025 16:56:55 +0100 Received: (from gert@localhost) by blue.greenie.muc.de (8.18.1/8.18.1/Submit) id 5BFFut4o023385 for openvpn-devel@lists.sourceforge.net; Mon, 15 Dec 2025 16:56:55 +0100 From: Gert Doering To: openvpn-devel@lists.sourceforge.net Date: Mon, 15 Dec 2025 16:56:47 +0100 Message-ID: <20251215155652.23362-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-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: Frank Lichtenheld Handle failure explicitly instead of the implicit handling by "while (buffer_i < r)". That error checking was previously broken but was fixed by commit 5e5ead5ba019fc2a8266f77a7d840b30fd545198. 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: 1vVAwd-0005qv-4Q Subject: [Openvpn-devel] [PATCH v1] multi: Warn about failing read in multi_process_file_closed() 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?1851590422597410057?= X-GMAIL-MSGID: =?utf-8?q?1851590422597410057?= From: Frank Lichtenheld Handle failure explicitly instead of the implicit handling by "while (buffer_i < r)". That error checking was previously broken but was fixed by commit 5e5ead5ba019fc2a8266f77a7d840b30fd545198. Reported-by: Marc Heuse Github: openvpn-private-issues#101 Change-Id: Ie982f620a8af80564a70d993e6e84ec4e525236a Signed-off-by: Frank Lichtenheld Acked-by: Gert Doering Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1443 --- 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/+/1443 This mail reflects revision 1 of this Change. Acked-by according to Gerrit (reflected above): Gert Doering diff --git a/src/openvpn/multi.c b/src/openvpn/multi.c index 92eac6f..329d0a3 100644 --- a/src/openvpn/multi.c +++ b/src/openvpn/multi.c @@ -2806,6 +2806,11 @@ char buffer[INOTIFY_EVENT_BUFFER_SIZE]; ssize_t buffer_i = 0; ssize_t r = read(m->top.c2.inotify_fd, buffer, INOTIFY_EVENT_BUFFER_SIZE); + if (r < 0) + { + msg(M_WARN | M_ERRNO, "MULTI: multi_process_file_closed error"); + return; + } while (buffer_i < r) {