From patchwork Tue Dec 27 14:02:48 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arne Schwabe X-Patchwork-Id: 2953 Return-Path: Delivered-To: patchwork@openvpn.net Received: by 2002:a05:7300:c95:b0:82:e4b3:40a0 with SMTP id p21csp2650589dyk; Tue, 27 Dec 2022 06:03:53 -0800 (PST) X-Google-Smtp-Source: AMrXdXvStcj6WJqv3fnlpOplEdnYPRO2LpYkwqVgQKesUJUHOTtj9sn7AobpwPbspHFEqL+VE+cV X-Received: by 2002:a9d:6d90:0:b0:670:5549:9b63 with SMTP id x16-20020a9d6d90000000b0067055499b63mr14643221otp.6.1672149833589; Tue, 27 Dec 2022 06:03:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672149833; cv=none; d=google.com; s=arc-20160816; b=abuxmIF9Vid+MwK4QTDtXhLopn7oBhNQUUEU9sG82fZfxL45FqeUAC6FW7q6noeuX9 Ds5CTsV0eq7ku4kn3Ro8IlbRFWWd0N8zk4VdskrtB4RmCOH0VysncPT0sq4lTNwYPDga chcGSqcUvvJP0C91vptrNuRB0eSHogu4Ms/0+XVn3rAKBsz+emi9yb8M6vBzH29aJRSA 5j1PFLC+UhURrlS4SNR6+uc2XGavLYoBA5SZ0On3nZlMcTSzbnt+zapKaGEviPt5iVVh CJMDvxhf2jL+Jh72TR72oxAlZLSn1m3NGEyxopDDGELNQx+ME36lZjVCJQepVGMpRPHt tgaQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; 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; bh=ywxBa0UAKwO0khpgOjEq9Liy6C7G9cjMzY2uH3a/wJs=; b=YChwhZyFW2Q7g3behBmCrj1BRpHSdDp8bB/aTtQ2WfeTLBeRFtc0+Uo8M+DR3bH70e s4vypJwvcK9bNHbizWKlu03ReQkUQSSX5USWWlHmHALRx0tXGFsdi9uvDUcmT7d4s0PS IdmKUe/YQXeotXT9H4trpBkhqsxypyOq/4zTIkHWHGuHwRiq6NpIDIEg9oj+w5btDD6P gSbbQmBfzK2cSjr5m7YCAMxQqVTBMrGfQT89RT+RthOP07OsdM7xTCiano78A+P2Q/E5 yBxst+QHpDoSib8LZ8aKj9uWDsQRbbbw58g+0UI2lAQlaLp2XVfJHxol+XKPS67/QXMq hXrw== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=PDrevI88; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=k3sdtpUF; 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 Received: from lists.sourceforge.net (lists.sourceforge.net. [216.105.38.7]) by mx.google.com with ESMTPS id a21-20020a9d74d5000000b0066c52d18d45si9166403otl.128.2022.12.27.06.03.53 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 27 Dec 2022 06:03:53 -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=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=PDrevI88; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=k3sdtpUF; 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 Received: from [127.0.0.1] (helo=sfs-ml-1.v29.lw.sourceforge.com) by sfs-ml-1.v29.lw.sourceforge.com with esmtp (Exim 4.95) (envelope-from ) id 1pAAXm-0003Pa-Ss; Tue, 27 Dec 2022 14:03:02 +0000 Received: from [172.30.20.202] (helo=mx.sourceforge.net) by sfs-ml-1.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1pAAXi-00032c-2K for openvpn-devel@lists.sourceforge.net; Tue, 27 Dec 2022 14:02:58 +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=7Xv2s85sDzdkU/BT8j25i77TwfMabf0zBEsyomcdXGU=; b=PDrevI889y8jbLKAoKHWWpRnmE tA/uF3f+w1/WvBgsLMA/p/Zo52MqfDm2YCg8kLfVJPUjVT8i8VcOySQwygP9fA6QNioDC95swN4k8 rT3fS94s97KwaamCpkkqc9XPx7QwYW//14muRKE4fLnrzAO7KTJhy8m/Sqzg7JIE+KSY=; 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=7Xv2s85sDzdkU/BT8j25i77TwfMabf0zBEsyomcdXGU=; b=k3sdtpUFWOYmW4GWNQh4kVB2eU kMukcvulIJhCvo7DYnZuyQcNEeen3y+bb5xP5XPjsCrcwHAq1U7wcQKWsNgDcV704XgSe1GzkB4ex 7JJWrEK1fVKkzDfkwG4dcurEQfox94HwdyW5Gc6pKxAezlLdO9cH8SZ104+76uLHjLQ4=; Received: from mail.blinkt.de ([192.26.174.232]) by sfi-mx-1.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.95) id 1pAAXg-00E5SD-Lr for openvpn-devel@lists.sourceforge.net; Tue, 27 Dec 2022 14:02:58 +0000 Received: from kamera.blinkt.de ([2001:638:502:390:20c:29ff:fec8:535c]) by mail.blinkt.de with smtp (Exim 4.95 (FreeBSD)) (envelope-from ) id 1pAAXZ-0004uP-8t for openvpn-devel@lists.sourceforge.net; Tue, 27 Dec 2022 15:02:49 +0100 Received: (nullmailer pid 3525000 invoked by uid 10006); Tue, 27 Dec 2022 14:02:49 -0000 From: Arne Schwabe To: openvpn-devel@lists.sourceforge.net Date: Tue, 27 Dec 2022 15:02:48 +0100 Message-Id: <20221227140249.3524943-5-arne@rfc2549.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221227140249.3524943-1-arne@rfc2549.org> References: <20221227140249.3524943-1-arne@rfc2549.org> MIME-Version: 1.0 X-Spam-Score: 0.3 (/) X-Spam-Report: Spam detection software, running on the system "util-spamd-1.v13.lw.sourceforge.com", 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: Signed-off-by: Arne Schwabe --- src/openvpn/multi.c | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/src/openvpn/multi.c b/src/openvpn/multi.c index 6c6385c6e..50d88f19a 100644 --- a/src/openvpn/multi.c +++ b/src/openvpn/multi.c @@ -3243, 10 +3243, 19 @@ process_incoming_del_peer(struct mu [...] Content analysis details: (0.3 points, 6.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.2 HEADER_FROM_DIFFERENT_DOMAINS From and EnvelopeFrom 2nd level mail domains are different 0.0 SPF_NONE SPF: sender does not publish an SPF Record X-Headers-End: 1pAAXg-00E5SD-Lr Subject: [Openvpn-devel] [PATCH v2 3/4] Ignore OVPN_DEL_PEER_REASON_USERSPACE to avoid race conditions 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?1753376183521439481?= X-GMAIL-MSGID: =?utf-8?q?1753376183521439481?= Signed-off-by: Arne Schwabe --- src/openvpn/multi.c | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/src/openvpn/multi.c b/src/openvpn/multi.c index 6c6385c6e..50d88f19a 100644 --- a/src/openvpn/multi.c +++ b/src/openvpn/multi.c @@ -3243,10 +3243,19 @@ process_incoming_del_peer(struct multi_context *m, struct multi_instance *mi, break; case OVPN_DEL_PEER_REASON_USERSPACE: - /* This very likely ourselves but might be another process, so - * still process it */ - reason = "ovpn-dco: userspace request"; - break; + /* We assume that is ourselves. UUnfortunately, sometimes these + * events happen with enough delay that they can have an order of + * + * dco_del_peer x + * [new client connecting] + * dco_new_peer x + * event from dco_del_peer arrives. + * + * if we do not ignore this we get desynced with the kernel + * since we assume the peer-id is free again. The other way would + * be to send a dco_del_peer again + */ + return; } /* When kernel already deleted the peer, the socket is no longer