Message ID | 20250430123250.8627-1-a@unstable.cc |
---|---|
State | New |
Headers | show
Return-Path: <openvpn-devel-bounces@lists.sourceforge.net> Delivered-To: patchwork@openvpn.net Received: by 2002:a05:7000:31a6:b0:656:592e:a137 with SMTP id u6csp868713mac; Wed, 30 Apr 2025 05:51:36 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCULEsIlsREPzxynpbhwj20ZUlCH4HRagRHcf3HEg1wX8Jv1x4cPX2rvblIh4EfuPKLo5NyyKgNyd3s=@openvpn.net X-Google-Smtp-Source: AGHT+IHpSLBXj4rnv4Nsl7jPtk8V60UDbeE9kg8akzUJ5P1FDzjY4dpArf7yaN1RmaCRJysakQqy X-Received: by 2002:a05:6e02:3712:b0:3d8:8900:9a30 with SMTP id e9e14a558f8ab-3d9677220camr32846935ab.20.1746017495920; Wed, 30 Apr 2025 05:51:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1746017495; cv=none; d=google.com; s=arc-20240605; b=IvzLCuSaEDyorhFsgLm63n/8YdhDEs1zgsc5RTJvpCHOiEF6rRNVkW2SCocMfYq+M5 SksC0FG2t/qYJpFnLTSKwe89JUeFhOGWhlWSlNDhf2Ys96PaaR7duz6VfmnDz/mUhAoO 6LtLWnXZr7foS4G6rjGjL0pZlCjXk6GM3yPR/sPqouVZb8w4/85ZD1xdJcXEYnJuwK3t k8LRM/4PcsDgOlqPDoG3ry7Fu7BgMJvJ2UcOIEKhWRVw8NQg06ahsD9DF8buX3JMmKER oX0rSU1R+vZLAMGCDApH5g1r8wzHnQeb6SIw4IXZJUYLakUhuz49wnr6mwu8PP5ukA8V UW5Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=errors-to:content-transfer-encoding:cc:list-subscribe:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence:subject :mime-version:message-id:date:to:from:dkim-signature:dkim-signature :dkim-signature:dkim-signature; bh=V90tuVMbfQeDw8EJ73n6qy/VTB95qodZIzMBKMoH7dI=; fh=BEXsVF2vhWxaMgs2qFKAWZUkW8vXXdGeO1y9DIa+eNM=; b=jCyjOEpr5JQ5ma0ap1zIcsBBMfA5FCP4oc1nLqTyByV4d+CtACyIM2iuDlxBoEd8a/ qWKgd7ihs1dqSMu3FafwQpKxdKma3lOwYtHcmjVfdJ7K35z6ToLaijUgMfrHzZbnXxmi U0Irv1886Z5crIDGRDKlMlhacWYotKmvKUaH4nDO4Q+ddRGN06ehphsxFZE1fYEiy78f 91mMMsQjZrFQrrhZfXOBsVXHbOeGZG624G4cMfXIs8MSeWlcnOH0Yx+ZH6iC6aECwXEM 5IaUFoAPiqL49KSLpivpvPMqdOYkI94Vxct35ziHU5FZhfGc3ZmYlZ7q4sgvNwATVYG0 qyng==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lists.sourceforge.net header.s=beta header.b=H6U86CkM; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b="eRSlr/hv"; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=c2f621bo; dkim=neutral (body hash did not verify) header.i=@unstable.cc header.s=20220809-q8oc header.b=XalFFFR3; 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 e9e14a558f8ab-3d96a650aeasi9552735ab.165.2025.04.30.05.51.35 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 30 Apr 2025 05:51:35 -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=H6U86CkM; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b="eRSlr/hv"; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=c2f621bo; dkim=neutral (body hash did not verify) header.i=@unstable.cc header.s=20220809-q8oc header.b=XalFFFR3; 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 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:Cc: List-Subscribe:List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: Subject:MIME-Version:Message-ID:Date:To:From:Sender:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Owner; bh=V90tuVMbfQeDw8EJ73n6qy/VTB95qodZIzMBKMoH7dI=; b=H6U86CkMuO58GvZUwn1p4Xf7HD DcAiwpYSLmy2yeDo6y24HIslIVoJ2Lf54qBVGaovXwQ/9kEroOSg5P4rtcUttP1CBdlxAHb6guBJB /XOXCSf/yxGcczW5vRQ44wgE9WterCVRaK92w/zrskEolLMBEEnVd1Hvqg5bA+V++io0=; 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 <openvpn-devel-bounces@lists.sourceforge.net>) id 1uA6uP-0002fH-6F; Wed, 30 Apr 2025 12:51:29 +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 <a@unstable.cc>) id 1uA6uA-0002ex-Tn for openvpn-devel@lists.sourceforge.net; Wed, 30 Apr 2025 12:51:14 +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:Message-ID: Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=vHDHoFUEFLqB+9/Qy5Ex3wRayJB1sMflKxzsQziLgh0=; b=eRSlr/hvn8nLywcJKMPTOqHLGB osLpv/W38gfkPteIHnUsP8qkhZKhYe9J1fu+TJ8x5b14D4UVvgRxhfq1apzzh+nSyhtGOykenyui7 F3rRvlgs4XJt0HXTnwgM00cOTTpvwtiB3JjA0ijuFyviOz5wNa5v0vrcUVWW2JMgZwgY=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=Content-Transfer-Encoding:MIME-Version:Message-ID:Date:Subject:Cc:To:From :Sender:Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Id:List-Help:List-Unsubscribe:List-Subscribe:List-Post: List-Owner:List-Archive; bh=vHDHoFUEFLqB+9/Qy5Ex3wRayJB1sMflKxzsQziLgh0=; b=c 2f621bomoKPAE2vrWraxZMucsJbIqXuhiIhR5t2wlGfzzuubJp9iC40Xq4dq/heg7CUASPXyrGPzz aqUyGG3VVgCKjSCz0rylotKItsDkinTDteaiI3lls7tEXjxLWtsRHFvlWQFIg/gvjfmjAQ12VsRkL 1Nhpg1ME9v71+6JE=; Received: from wilbur.contactoffice.com ([212.3.242.68]) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.95) id 1uA6to-0006zR-BF for openvpn-devel@lists.sourceforge.net; Wed, 30 Apr 2025 12:51:08 +0000 Received: from smtpauth2.co-bxl (smtpauth2.co-bxl [10.2.0.24]) by wilbur.contactoffice.com (Postfix) with ESMTP id 2E7BE1A03; Wed, 30 Apr 2025 14:33:47 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1746016427; s=20220809-q8oc; d=unstable.cc; i=a@unstable.cc; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Transfer-Encoding; bh=vHDHoFUEFLqB+9/Qy5Ex3wRayJB1sMflKxzsQziLgh0=; b=XalFFFR3dMO7UJ9zimiHJbt6lBptIqrQLwZSZaderJqtRP5YlOWZipSrTpXUAmkL +DpLH/xvnC1JxFaeiI3AhrL/H8y6hJIJ09e+PUBEq5qi+Y4MCjQSWEXjdqz/fdsiTbi Xf8djFOB4IMwWHYu1lh+iTSfo1bfp46qnS1owc0CA8KS7GeNdcOKCZ5ZS1QPzst648w QzvgP3kjkYw7CN7/jBa/oxQDOvZZRsB+kahiBWUSZyH9JpzRz23L5ZFth288F9BosL+ Q+RxPr59d975dJe3Vg2hOST96i3rnVWoEtmakVy4/1dSQrGcKf/lWevCwRKY8wfZel7 s36RBYZVZw== Received: by smtp.mailfence.com with ESMTPSA ; Wed, 30 Apr 2025 14:33:44 +0200 (CEST) From: Antonio Quartulli <a@unstable.cc> To: openvpn-devel@lists.sourceforge.net Date: Wed, 30 Apr 2025 14:32:49 +0200 Message-ID: <20250430123250.8627-1-a@unstable.cc> X-Mailer: git-send-email 2.49.0 MIME-Version: 1.0 X-ContactOffice-Account: com:375058688 X-Spam-Score: -0.2 (/) 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: From: Antonio Quartulli <antonio@openvpn.net> In case of UDP peer timeout, an openvpn client (userspace) performs the following actions: 1. receives the peer deletion notification (reason=timeout) 2. closes the socket 3. deletes the ovpn interfac [...] Content analysis details: (-0.2 points, 6.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 RCVD_IN_VALIDITY_RPBL_BLOCKED RBL: ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. [212.3.242.68 listed in bl.score.senderscore.com] 0.0 RCVD_IN_VALIDITY_CERTIFIED_BLOCKED RBL: ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. [212.3.242.68 listed in sa-accredit.habeas.com] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain X-Headers-End: 1uA6to-0006zR-BF Subject: [Openvpn-devel] [PATCH ovpn-net-next 1/2] ovpn: don't access sk after release X-BeenThere: openvpn-devel@lists.sourceforge.net X-Mailman-Version: 2.1.21 Precedence: list List-Id: <openvpn-devel.lists.sourceforge.net> List-Unsubscribe: <https://lists.sourceforge.net/lists/options/openvpn-devel>, <mailto:openvpn-devel-request@lists.sourceforge.net?subject=unsubscribe> List-Archive: <http://sourceforge.net/mailarchive/forum.php?forum_name=openvpn-devel> List-Post: <mailto:openvpn-devel@lists.sourceforge.net> List-Help: <mailto:openvpn-devel-request@lists.sourceforge.net?subject=help> List-Subscribe: <https://lists.sourceforge.net/lists/listinfo/openvpn-devel>, <mailto:openvpn-devel-request@lists.sourceforge.net?subject=subscribe> Cc: Antonio Quartulli <antonio@openvpn.net>, sd@queasysnail.net Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: openvpn-devel-bounces@lists.sourceforge.net X-getmail-retrieved-from-mailbox: Inbox X-GMAIL-THRID: =?utf-8?q?1830832041705772458?= X-GMAIL-MSGID: =?utf-8?q?1830832041705772458?= |
Series |
[Openvpn-devel,ovpn-net-next,1/2] ovpn: don't access sk after release
|
expand
|
diff --git a/drivers/net/ovpn/socket.c b/drivers/net/ovpn/socket.c index a83cbab72591..ff499f0fc771 100644 --- a/drivers/net/ovpn/socket.c +++ b/drivers/net/ovpn/socket.c @@ -66,6 +66,7 @@ static bool ovpn_socket_put(struct ovpn_peer *peer, struct ovpn_socket *sock) void ovpn_socket_release(struct ovpn_peer *peer) { struct ovpn_socket *sock; + u16 sk_protocol; bool released; might_sleep(); @@ -92,6 +93,7 @@ void ovpn_socket_release(struct ovpn_peer *peer) */ lock_sock(sock->sock->sk); released = ovpn_socket_put(peer, sock); + sk_protocol = sock->sock->sk->sk_protocol; release_sock(sock->sock->sk); /* align all readers with sk_user_data being NULL */ @@ -99,9 +101,9 @@ void ovpn_socket_release(struct ovpn_peer *peer) /* following cleanup should happen with lock released */ if (released) { - if (sock->sock->sk->sk_protocol == IPPROTO_UDP) { + if (sk_protocol == IPPROTO_UDP) { netdev_put(sock->ovpn->dev, &sock->dev_tracker); - } else if (sock->sock->sk->sk_protocol == IPPROTO_TCP) { + } else if (sk_protocol == IPPROTO_TCP) { /* wait for TCP jobs to terminate */ ovpn_tcp_socket_wait_finish(sock); ovpn_peer_put(sock->peer);