From patchwork Sat Dec 24 19:42:53 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arne Schwabe X-Patchwork-Id: 2935 Return-Path: Delivered-To: patchwork@openvpn.net Received: by 2002:a05:7300:c95:b0:82:e4b3:40a0 with SMTP id p21csp1133663dyk; Sat, 24 Dec 2022 11:43:29 -0800 (PST) X-Google-Smtp-Source: AMrXdXvIPBp0pHxpJ4UZIXMunZ/TXD5PTWQ8H+gayiDrkLha3N+Csf9wUFHQ3RHmShE+7EVJVmhX X-Received: by 2002:a17:903:230a:b0:189:d3d9:9308 with SMTP id d10-20020a170903230a00b00189d3d99308mr20055929plh.34.1671911008970; Sat, 24 Dec 2022 11:43:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671911008; cv=none; d=google.com; s=arc-20160816; b=b7sWcWw1fxMNVoDbR90mmwCnDVYcP/E/mmdSKNQtwIgFGXmpgB8OE6J7HuyhRnnRQD tPESL40W/6L30IQLUke8qHoLOA38s/VxsKKbQdpow1zQ8bgAaS23Ts3d/tWLJug2lx1G 7CV66eozlzEnSFbe3SqoaqFT7/Gcx7rYnqAiws8mGuURSuDTLNln57dWLkODM5jTF4oZ gAAMIsHqgglOvEG6EezQgkIXihKzIpHjgn9CtCBQLKzectMx4lYvJEamJeO+U8227Un3 4BvUiprke5YGnGKrPXcN8Ptm+nm2v5mRZvX2HXBPdSjMg/DWpxwpnFmaXQVZpwdMtA0p FThA== 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=GGLFa5xYp3s71Tuf9ImLCr/eL91rAEHq99RWyHMK6g4=; b=w6GDwpbMTsTVotyuxJ3tMsfvc9ELWAxGkk7S1JcePuPZZq/gT8nmwMpSOEhIfi4vP8 GkfjV6DhZPIl+wO2B30v5nHBKRGwZMB76ObdXGvHDhpM+VNyUEVPQa80b77ixOaEWIUW DO3+ZhFOVZEbJe95VRfYuiPTRWZ+INBgLLEXGzY8YfkiVm8MR8ElXePeC9Xa4psSVR7R UxO0xWq4Z2tf6p7shXJ54VWomv0PzOmF9BQlLHqAKRsEspy2ARQG1WEdtuJ9zUmpFKmD mFWkDsMveiAia5refZTqj1Rb/l02AfkYlKg8JPIlKD+92NvlThaYJJh8d+TrWCvPp/Se jRpA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=MGMoi2cW; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=lXTk3CDp; 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 u17-20020a17090341d100b00189c9f86942si7545984ple.379.2022.12.24.11.43.28 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sat, 24 Dec 2022 11:43:28 -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=MGMoi2cW; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=lXTk3CDp; 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-2.v29.lw.sourceforge.com) by sfs-ml-2.v29.lw.sourceforge.com with esmtp (Exim 4.95) (envelope-from ) id 1p9AQF-0000Bq-Q3; Sat, 24 Dec 2022 19:43:07 +0000 Received: from [172.30.20.202] (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 1p9AQC-0000BR-3H for openvpn-devel@lists.sourceforge.net; Sat, 24 Dec 2022 19:43:04 +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=y8GC3ytceYbrKlcpgckwJNE2hCyGRtNvPZyOS/sjcEg=; b=MGMoi2cW8qjmyepcFrDpFQCZua Ysi0TvTku4iLlYoGrYg8jeDcsD3QD6d5skaMu6TGqsmJMP3UfWzEa9fajwr3+3fitaxeeFRvTs9YB 3c2yfVFw81LCkoLK3d1v8wr+97y/7z2UI66BucT8t6Jq15fEc6Bo2/Qqvi8kA7qBUaq4=; 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=y8GC3ytceYbrKlcpgckwJNE2hCyGRtNvPZyOS/sjcEg=; b=lXTk3CDp3CtvqS1dcCx9ptjA5A oHlsX+t+UQ4ytrX1M1xMFN28Yctn5Pas8WpGDAZYD5EIlPM4GCaen8lfwVHo2GNYXSxfnmoRb7ufp 630MjP1trNRaaH6zC2yZAUftqFp4aVDJxhsTfWumUa/f9PvBlo+gbiGXcEdwKIUdbduU=; Received: from mail.blinkt.de ([192.26.174.232]) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.95) id 1p9AQA-0000xg-Mk for openvpn-devel@lists.sourceforge.net; Sat, 24 Dec 2022 19:43:03 +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 1p9AQ1-000H1j-PV for openvpn-devel@lists.sourceforge.net; Sat, 24 Dec 2022 20:42:53 +0100 Received: (nullmailer pid 3202302 invoked by uid 10006); Sat, 24 Dec 2022 19:42:53 -0000 From: Arne Schwabe To: openvpn-devel@lists.sourceforge.net Date: Sat, 24 Dec 2022 20:42:53 +0100 Message-Id: <20221224194253.3202231-10-arne@rfc2549.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221224194253.3202231-1-arne@rfc2549.org> References: <20221224194253.3202231-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-2.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 | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/src/openvpn/multi.c b/src/openvpn/multi.c index 6c6385c6e..858d602ca 100644 --- a/src/openvpn/multi.c +++ b/src/openvpn/multi.c @@ -473,6 +473,10 @@ multi_instance_string(const struct mul [...] 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: 1p9AQA-0000xg-Mk Subject: [Openvpn-devel] [PATCH 9/9] 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?1753125758194682808?= X-GMAIL-MSGID: =?utf-8?q?1753125758194682808?= Signed-off-by: Arne Schwabe --- src/openvpn/multi.c | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/src/openvpn/multi.c b/src/openvpn/multi.c index 6c6385c6e..858d602ca 100644 --- a/src/openvpn/multi.c +++ b/src/openvpn/multi.c @@ -473,6 +473,10 @@ multi_instance_string(const struct multi_instance *mi, bool null, struct gc_aren buf_printf(&out, "%s/", cn); } buf_printf(&out, "%s", mroute_addr_print(&mi->real, gc)); + if (mi->context.c2.tls_multi) + { + buf_printf(&out, " peer-id=%d", mi->context.c2.tls_multi->peer_id); + } return BSTR(&out); } else if (null) @@ -3243,10 +3247,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