Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 82BE83033CB for ; Sun, 19 Jul 2026 14:59:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784473158; cv=none; b=Ov9Su0cyZojtNepgAf5EC4tYQ7OePImbDp1+OCdKXv9pz/Fd+zj1EKSAYBZEMBl0X+74JeAMKHJsvQ8MYlti+Kh46piLs+tKPDYgHolO40hprFgo9g/BCSxrUYqCZdaGszCGd4rfcnufd5lVCQKnUJb1iR34Jnr516lrNrPzXsM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784473158; c=relaxed/simple; bh=wU7mOXsrAIhtH1JCmUc/07I1SyqRjtHABGsWNTN9XCM=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=oGERIJtAEdT551cHhjIoYUaVVCrZu2vkrlVE5Zigs/hYx4HtwUbXz5apsAW4sYGic7aYg579lIesOTbIm+SrmKmvTWfHJiqHIHNYAwoeQXNrmuINNAJIOPfVBMfSEM4UzsLY8S9ztUMVw52qpGwjAK2SNCuW3CZ44UwXgJfzDcY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=Gs6rBVid; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="Gs6rBVid" Received: by smtp.kernel.org (Postfix) with ESMTPSA id DD9321F000E9; Sun, 19 Jul 2026 14:59:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1784473157; bh=ipOUboDs7RMgBCxzq+3mghC4hlZZ9RJp/k+ZZSBqjlk=; h=From:To:Cc:Subject:Date:Reply-To; b=Gs6rBVid4oM8pUO34YfGcmcQypA7Ui9bycglfCGaDmYUHPRyDUKsaBu1mgdA9GkR2 1tZS12iuCBUxBDl1qV3VdZZLS4OIBlzwIE1LVBqBAqJe5dVJnudQdmzM71t+BAXHuk 2XutakcFE6uZdSQJn+AaGDkm2SyNTQcB64Ej+uIY= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2026-63918: l2tp: use refcount_inc_not_zero in l2tp_session_get_by_ifname Date: Sun, 19 Jul 2026 16:56:18 +0200 Message-ID: <2026071947-CVE-2026-63918-2288@gregkh> X-Mailer: git-send-email 2.55.0 Reply-To: , Precedence: bulk X-Mailing-List: linux-cve-announce@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=4033; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=Tr/y4Q4/G9CG71EgDeAjjfZWS8slYosdUBzt3yq33OA=; b=owGbwMvMwCRo6H6F97bub03G02pJDFkxT4sfOP/0y5o/b+s9qf9txzsTn77pdj42fbPuxso1z Yt2ZKXbdsSyMAgyMciKKbJ82cZzdH/FIUUvQ9vTMHNYmUCGMHBxCsBErHoZFuyKVZwzM1n5yQzX KamLOJjviksFn2WYXzgr2zOE3/4bs6RYyIayJT53zk5TBQA= X-Developer-Key: i=gregkh@linuxfoundation.org; a=openpgp; fpr=F4B60CC5BF78C2214A313DCB3147D40DDB2DFB29 Content-Transfer-Encoding: 8bit From: Greg Kroah-Hartman Description =========== In the Linux kernel, the following vulnerability has been resolved: l2tp: use refcount_inc_not_zero in l2tp_session_get_by_ifname A reader in l2tp_session_get_by_ifname() can return a pointer to a session whose refcount has reached zero. The getter takes its reference with plain refcount_inc(), but every other session getter in the same file (l2tp_v2_session_get, l2tp_v3_session_get, and the corresponding _get_next variants) uses refcount_inc_not_zero() because the IDR/RCU lookup can race with refcount_dec_and_test() -> l2tp_session_free() -> kfree_rcu(). The ifname getter is the only outlier; the inconsistency was raised on-list after 979c017803c4 ("l2tp: use list_del_rcu in l2tp_session_unhash"). A reader inside rcu_read_lock_bh() that matches session->ifname can be preempted between the strcmp() and the refcount_inc(). If the last reference drops on another CPU in that window, the reader's refcount_inc() runs on a counter that has reached zero. refcount_t catches the addition-on-zero, prints "refcount_t: addition on 0; use-after-free", saturates the counter, and returns the saturated pointer to the caller. Session memory is held live by the in-flight RCU read section, but the kfree_rcu() callback queued from l2tp_session_free() will free it once the grace period closes; a caller that dereferences the returned session past that point hits a slab-use-after-free. On PREEMPT_RT local_bh_disable() is a per-CPU sleeping lock and the preemption window is real; on stock PREEMPT kernels local_bh_disable() is a preempt_count increment that closes the cross-CPU race in practice (see below). Use refcount_inc_not_zero() and continue the list walk on failure, matching the other session getters in the file. The ifname getter is the only session getter in net/l2tp/ that still uses the bare refcount_inc() pattern; this change restores file-internal consistency. The success path is unchanged. The Linux kernel CVE team has assigned CVE-2026-63918 to this issue. Affected and fixed versions =========================== Issue introduced in 6.12 with commit abe7a1a7d0b69e63b1bca5f9531023a52336784f and fixed in 6.12.93 with commit ee80455feffb9cb62b5b58715cabeff495e666b2 Issue introduced in 6.12 with commit abe7a1a7d0b69e63b1bca5f9531023a52336784f and fixed in 6.18.35 with commit 947013fd7c8c35dd5856557b215840098a3f67f8 Issue introduced in 6.12 with commit abe7a1a7d0b69e63b1bca5f9531023a52336784f and fixed in 7.0.12 with commit 782d60a6596aee9b29c2eecfa70033899278bf65 Issue introduced in 6.12 with commit abe7a1a7d0b69e63b1bca5f9531023a52336784f and fixed in 7.1 with commit 05f95729ca844704d15e49ce14868af4b403b32b Please see https://www.kernel.org for a full list of currently supported kernel versions by the kernel community. Unaffected versions might change over time as fixes are backported to older supported kernel versions. The official CVE entry at https://cve.org/CVERecord/?id=CVE-2026-63918 will be updated if fixes are backported, please check that for the most up to date information about this issue. Affected files ============== The file(s) affected by this issue are: net/l2tp/l2tp_core.c Mitigation ========== The Linux kernel CVE team recommends that you update to the latest stable kernel version for this, and many other bugfixes. Individual changes are never tested alone, but rather are part of a larger kernel release. Cherry-picking individual commits is not recommended or supported by the Linux kernel community at all. If however, updating to the latest release is impossible, the individual changes to resolve this issue can be found at these commits: https://git.kernel.org/stable/c/ee80455feffb9cb62b5b58715cabeff495e666b2 https://git.kernel.org/stable/c/947013fd7c8c35dd5856557b215840098a3f67f8 https://git.kernel.org/stable/c/782d60a6596aee9b29c2eecfa70033899278bf65 https://git.kernel.org/stable/c/05f95729ca844704d15e49ce14868af4b403b32b