CVE-2023-52999 Information
Description
In the Linux kernel the following vulnerability has been resolved:
net: fix UaF in netns ops registration error path
If net_assign_generic() fails the current error path in ops_init() tries to clear the gen pointer slot. Anyway in such error path the gen pointer itself has not been modified yet and the existing and accessed one is smaller than the accessed index causing an out-of-bounds error:
BUG: KASAN: slab-out-of-bounds in ops_init+0x2de/0x320 Write of size 8 at addr ffff888109124978 by task modprobe/1018
CPU: 2 PID: 1018 Comm: modprobe Not tainted 6.2.0-rc2.mptcp_ae5ac65fbed5+ 1641
Hardware name: QEMU Standard PC (Q35 + ICH9 2009) BIOS 1.16.1-2.fc37 04/01/2014
Call Trace:
This change addresses the issue by skipping the gen pointer de-reference in the mentioned error-path.
Found by code inspection and verified with explicit error injection on a kasan-enabled kernel.
Reference
https://git.kernel.org/stable/c/12075708f2e77ee6a9f8bb2cf512c38be3099794 https://git.kernel.org/stable/c/66689a72ba73575e76d4f6a8748d3fa2690ec1c4 https://git.kernel.org/stable/c/71ab9c3e2253619136c31c89dbb2c69305cc89b1 https://git.kernel.org/stable/c/ad0dfe9bcf0d78e699c7efb64c90ed062dc48bea https://git.kernel.org/stable/c/d4c008f3b7f7d4ffd311eb2dae5e75b3cbddacd0 https://git.kernel.org/stable/c/ddd49cbbd4c1ceb38032018b589b44208e54f55e
Share on: