CVE-2023-52842

Source
https://nvd.nist.gov/vuln/detail/CVE-2023-52842
Import Source
https://storage.googleapis.com/osv-test-cve-osv-conversion/osv-output/CVE-2023-52842.json
JSON Data
https://api.osv.dev/v1/vulns/CVE-2023-52842
Related
Published
2024-05-21T16:15:21Z
Modified
2024-09-11T05:02:14.555839Z
Summary
[none]
Details

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

virtio/vsock: Fix uninit-value in virtiotransportrecv_pkt()

KMSAN reported the following uninit-value access issue:

===================================================== BUG: KMSAN: uninit-value in virtiotransportrecvpkt+0x1dfb/0x26a0 net/vmwvsock/virtiotransportcommon.c:1421 virtiotransportrecvpkt+0x1dfb/0x26a0 net/vmwvsock/virtiotransportcommon.c:1421 vsockloopbackwork+0x3bb/0x5a0 net/vmwvsock/vsockloopback.c:120 processonework kernel/workqueue.c:2630 [inline] processscheduledworks+0xff6/0x1e60 kernel/workqueue.c:2703 workerthread+0xeca/0x14d0 kernel/workqueue.c:2784 kthread+0x3cc/0x520 kernel/kthread.c:388 retfromfork+0x66/0x80 arch/x86/kernel/process.c:147 retfromforkasm+0x11/0x20 arch/x86/entry/entry_64.S:304

Uninit was stored to memory at: virtiotransportspaceupdate net/vmwvsock/virtiotransportcommon.c:1274 [inline] virtiotransportrecvpkt+0x1ee8/0x26a0 net/vmwvsock/virtiotransportcommon.c:1415 vsockloopbackwork+0x3bb/0x5a0 net/vmwvsock/vsockloopback.c:120 processonework kernel/workqueue.c:2630 [inline] processscheduledworks+0xff6/0x1e60 kernel/workqueue.c:2703 workerthread+0xeca/0x14d0 kernel/workqueue.c:2784 kthread+0x3cc/0x520 kernel/kthread.c:388 retfromfork+0x66/0x80 arch/x86/kernel/process.c:147 retfromforkasm+0x11/0x20 arch/x86/entry/entry_64.S:304

Uninit was created at: slabpostallochook+0x105/0xad0 mm/slab.h:767 slaballocnode mm/slub.c:3478 [inline] kmemcacheallocnode+0x5a2/0xaf0 mm/slub.c:3523 kmallocreserve+0x13c/0x4a0 net/core/skbuff.c:559 _allocskb+0x2fd/0x770 net/core/skbuff.c:650 allocskb include/linux/skbuff.h:1286 [inline] virtiovsockallocskb include/linux/virtiovsock.h:66 [inline] virtiotransportallocskb+0x90/0x11e0 net/vmwvsock/virtiotransportcommon.c:58 virtiotransportresetnosock net/vmwvsock/virtiotransportcommon.c:957 [inline] virtiotransportrecvpkt+0x1279/0x26a0 net/vmwvsock/virtiotransportcommon.c:1387 vsockloopbackwork+0x3bb/0x5a0 net/vmwvsock/vsockloopback.c:120 processonework kernel/workqueue.c:2630 [inline] processscheduledworks+0xff6/0x1e60 kernel/workqueue.c:2703 workerthread+0xeca/0x14d0 kernel/workqueue.c:2784 kthread+0x3cc/0x520 kernel/kthread.c:388 retfromfork+0x66/0x80 arch/x86/kernel/process.c:147 retfromforkasm+0x11/0x20 arch/x86/entry/entry64.S:304

CPU: 1 PID: 10664 Comm: kworker/1:5 Not tainted 6.6.0-rc3-00146-g9f3ebbef746f #3 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.16.2-1.fc38 04/01/2014

Workqueue: vsock-loopback vsockloopbackwork

The following simple reproducer can cause the issue described above:

int main(void) { int sock; struct sockaddrvm addr = { .svmfamily = AFVSOCK, .svmcid = VMADDRCIDANY, .svm_port = 1234, };

sock = socket(AFVSOCK, SOCKSTREAM, 0); connect(sock, (struct sockaddr *)&addr, sizeof(addr)); return 0; }

This issue occurs because the buf_alloc and fwd_cnt fields of the struct virtio_vsock_hdr are not initialized when a new skb is allocated in virtio_transport_init_hdr(). This patch resolves the issue by initializing these fields during allocation.

References

Affected packages

Debian:12 / linux

Package

Name
linux
Purl
pkg:deb/debian/linux?arch=source

Affected ranges

Type
ECOSYSTEM
Events
Introduced
0Unknown introduced version / All previous versions are affected
Fixed
6.1.64-1

Affected versions

6.*

6.1.27-1
6.1.37-1
6.1.38-1
6.1.38-2~bpo11+1
6.1.38-2
6.1.38-3
6.1.38-4~bpo11+1
6.1.38-4
6.1.52-1
6.1.55-1~bpo11+1
6.1.55-1

Ecosystem specific

{
    "urgency": "not yet assigned"
}

Debian:13 / linux

Package

Name
linux
Purl
pkg:deb/debian/linux?arch=source

Affected ranges

Type
ECOSYSTEM
Events
Introduced
0Unknown introduced version / All previous versions are affected
Fixed
6.6.8-1

Affected versions

6.*

6.1.27-1
6.1.37-1
6.1.38-1
6.1.38-2~bpo11+1
6.1.38-2
6.1.38-3
6.1.38-4~bpo11+1
6.1.38-4
6.1.52-1
6.1.55-1~bpo11+1
6.1.55-1
6.1.64-1
6.1.66-1
6.1.67-1
6.1.69-1~bpo11+1
6.1.69-1
6.1.76-1~bpo11+1
6.1.76-1
6.1.82-1
6.1.85-1
6.1.90-1~bpo11+1
6.1.90-1
6.1.94-1~bpo11+1
6.1.94-1
6.1.98-1
6.1.99-1
6.1.106-1
6.1.106-2
6.1.106-3
6.3.1-1~exp1
6.3.2-1~exp1
6.3.4-1~exp1
6.3.5-1~exp1
6.3.7-1~bpo12+1
6.3.7-1
6.3.11-1
6.4~rc6-1~exp1
6.4~rc7-1~exp1
6.4.1-1~exp1
6.4.4-1~bpo12+1
6.4.4-1
6.4.4-2
6.4.4-3~bpo12+1
6.4.4-3
6.4.11-1
6.4.13-1
6.5~rc4-1~exp1
6.5~rc6-1~exp1
6.5~rc7-1~exp1
6.5.1-1~exp1
6.5.3-1~bpo12+1
6.5.3-1
6.5.6-1
6.5.8-1
6.5.10-1~bpo12+1
6.5.10-1
6.5.13-1
6.6.3-1~exp1
6.6.4-1~exp1
6.6.7-1~exp1

Ecosystem specific

{
    "urgency": "not yet assigned"
}