CVE-2023-52843

Source
https://cve.org/CVERecord?id=CVE-2023-52843
Import Source
https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2023-52843.json
JSON Data
https://api.osv.dev/v1/vulns/CVE-2023-52843
Downstream
Related
Published
2024-05-21T15:31:41.872Z
Modified
2026-03-14T12:23:15.052073Z
Summary
llc: verify mac len before reading mac header
Details

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

llc: verify mac len before reading mac header

LLC reads the mac header with eth_hdr without verifying that the skb has an Ethernet header.

Syzbot was able to enter llcrcv on a tun device. Tun can insert packets without mac len and with user configurable skb->protocol (passing a tunpi header when not configuring IFFNOPI).

BUG: KMSAN: uninit-value in llc_station_ac_send_test_r net/llc/llc_station.c:81 [inline]
BUG: KMSAN: uninit-value in llc_station_rcv+0x6fb/0x1290 net/llc/llc_station.c:111
llc_station_ac_send_test_r net/llc/llc_station.c:81 [inline]
llc_station_rcv+0x6fb/0x1290 net/llc/llc_station.c:111
llc_rcv+0xc5d/0x14a0 net/llc/llc_input.c:218
__netif_receive_skb_one_core net/core/dev.c:5523 [inline]
__netif_receive_skb+0x1a6/0x5a0 net/core/dev.c:5637
netif_receive_skb_internal net/core/dev.c:5723 [inline]
netif_receive_skb+0x58/0x660 net/core/dev.c:5782
tun_rx_batched+0x3ee/0x980 drivers/net/tun.c:1555
tun_get_user+0x54c5/0x69c0 drivers/net/tun.c:2002

Add a maclen test before all three ethhdr(skb) calls under net/llc.

There are further uses in include/net/llcpdu.h. All these are protected by a test skb->protocol == ETHP8022. Which does not protect against this tun scenario.

But the maclen test added in this patch in llcfixupskb will indirectly protect those too. That is called from llcrcv before any other LLC code.

It is tempting to just add a blanket maclen check in llcrcv, but not sure whether that could break valid LLC paths that do not assume an Ethernet header. 802.2 LLC may be used on top of non-802.3 protocols in principle. The below referenced commit shows that used to, on top of Token Ring.

At least one of the three eth_hdr uses goes back to before the start of git history. But the one that syzbot exercises is introduced in this commit. That commit is old enough (2008), that effectively all stable kernels should receive this.

Database specific
{
    "cna_assigner": "Linux",
    "osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2023/52xxx/CVE-2023-52843.json"
}
References

Affected packages

Git / git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git

Affected ranges

Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
f83f1768f833cb45bc93429fdc552252a4f55ac3
Fixed
900a4418e3f66a32db6baaf23f92b99c20ae6535
Fixed
9a3f9054a5227d7567cba1fb821df48ccecad10c
Fixed
cbdcdf42d15dac74c7287679fb2a9d955f8feb1f
Fixed
3a2653828ffc6101aef80bf58d5b77484239f779
Fixed
352887b3edd007cf9b0abc30fe9d98622acd859b
Fixed
f980e9a57dfb9530f1f4ee41a2420f2a256d7b29
Fixed
0a720d0259ad3521ec6c9e4199f9f6fc75bac77a
Fixed
ff5cb6a4f0c6d7fbdc84858323fb4b7af32cfd79
Fixed
7b3ba18703a63f6fd487183b9262b08e5632da1b

Database specific

source
"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2023-52843.json"