CVE-2026-53227: net: openvswitch: fix possible kfree_skb of ERR_PTR
From: Greg Kroah-Hartman <[email protected]>
Description
===========
In the Linux kernel, the following vulnerability has been resolved:
net: openvswitch: fix possible kfree_skb of ERR_PTR
After the patch in the "Fixes" tag, the allocation of the "reply" skb can happen either before or after locking the ovs_mutex.
However, error cleanups still follow the classical reversed order, assuming "reply" is allocated before locking: it is freed after unlocking.
If "reply" allocation happens after locking the mutex and it fails, "reply" is left with an ERR_PTR, and execution jumps to the correspondent cleanup stage which will try to free an invalid pointer.
Fix this by setting the pointer to NULL after having saved its error value.
The Linux kernel CVE team has assigned CVE-2026-53227 to this issue.
Affected and fixed versions
===========================
Issue introduced in 3.16 with commit 893f139b9a6c00c097b9082a90f3041cfb3a0d20 and fixed in 5.10.259 with commit e248fb2e680deb2bd37bac551b72638fe4938a76 Issue introduced in 3.16 with commit 893f139b9a6c00c097b9082a90f3041cfb3a0d20 and fixed in 5.15.210 with commit 0bb5b2dc1b90aa7dd1473fc8c4d813a29255ff8d Issue introduced in 3.16 with commit 893f139b9a6c00c097b9082a90f3041cfb3a0d20 and fixed in 6.1.176 with commit 971b1b37774f13acc5add0a2843f8598446b8598 Issue introduced in 3.16 with commit 893f139b9a6c00c097b9082a90f3041cfb3a0d20 and fixed in 6.6.143 with commit 25fdf53698535fe8790237f5a8a9626791429785 Issue introduced in 3.16 with commit 893f139b9a6c00c097b9082a90f3041cfb3a0d20 and fixed in 6.12.94 with commit e3d509a1b71396e1452060dbf84a805fd1c3c549 Issue introduced in 3.16 with commit 893f139b9a6c00c097b9082a90f3041cfb3a0d20 and fixed in 6.18.36 with commit ecc55aad3390129a87106841f4b68bf3d70c9264 Issue introduced in 3.16 with commit 893f139b9a6c00c097b9082a90f3041cfb3a0d20 and fixed in 7.0.13 with commit 895d1dd9057cde1687fa0f4286d47ceed0b82997 Issue introduced in 3.16 with commit 893f139b9a6c00c097b9082a90f3041cfb3a0d20 and fixed in 7.1 with commit ee30dd2909d8b98619f4341c70ec8dc8e155ab02
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-53227
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/openvswitch/datapath.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/e248fb2e680deb2bd37bac551b72638fe4938a76 https://git.kernel.org/stable/c/0bb5b2dc1b90aa7dd1473fc8c4d813a29255ff8d https://git.kernel.org/stable/c/971b1b37774f13acc5add0a2843f8598446b8598 https://git.kernel.org/stable/c/25fdf53698535fe8790237f5a8a9626791429785 https://git.kernel.org/stable/c/e3d509a1b71396e1452060dbf84a805fd1c3c549 https://git.kernel.org/stable/c/ecc55aad3390129a87106841f4b68bf3d70c9264 https://git.kernel.org/stable/c/895d1dd9057cde1687fa0f4286d47ceed0b82997 https://git.kernel.org/stable/c/ee30dd2909d8b98619f4341c70ec8dc8e155ab02