CVE-2026-68341: ovpn: fix use after free in unlock_ovpn()

Greg Kroah-Hartman <[email protected]>
Newsgroups org.kernel.vger.linux-cve-announce
Message-ID <2026081037-CVE-2026-68341-38d5@gregkh>
From: Greg Kroah-Hartman <[email protected]>

Description
===========

In the Linux kernel, the following vulnerability has been resolved:

ovpn: fix use after free in unlock_ovpn()

unlock_ovpn() iterates over the release_list using llist_for_each_entry()
and drops the peer reference inside the loop body via ovpn_peer_put().

If this drops the last reference, the peer is eventually freed. However,
llist_for_each_entry() reads peer->release_entry.next in the loop advance
expression, which runs after the body. By that time the peer may have
already been freed, resulting in a use after free when advancing to the
next list entry.

Fix this by using llist_for_each_entry_safe(), which caches the next
pointer before executing the loop body.

The Linux kernel CVE team has assigned CVE-2026-68341 to this issue.


Affected and fixed versions
===========================

	Issue introduced in 6.16 with commit 80747caef33d77f5c1b3d24644e6d7dae69066b5 and fixed in 6.18.42 with commit 5b96227c0e8b212b74838424c929fc889aedb555
	Issue introduced in 6.16 with commit 80747caef33d77f5c1b3d24644e6d7dae69066b5 and fixed in 7.1.6 with commit 4cdb209f12a89c5faf9be0c45edb90ccdf65db0c
	Issue introduced in 6.16 with commit 80747caef33d77f5c1b3d24644e6d7dae69066b5 and fixed in 7.2-rc5 with commit e1ad6fe5db719874efa45b2caf9934552e09fc43

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-68341
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:
	drivers/net/ovpn/peer.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/5b96227c0e8b212b74838424c929fc889aedb555
	https://git.kernel.org/stable/c/4cdb209f12a89c5faf9be0c45edb90ccdf65db0c
	https://git.kernel.org/stable/c/e1ad6fe5db719874efa45b2caf9934552e09fc43
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.