CVE-2024-35944

Source
https://cve.org/CVERecord?id=CVE-2024-35944
Import Source
https://storage.googleapis.com/osv-test-cve-osv-conversion/osv-output/CVE-2024-35944.json
JSON Data
https://api.test.osv.dev/v1/vulns/CVE-2024-35944
Downstream
Related
Published
2024-05-19T10:10:48.183Z
Modified
2026-03-20T12:36:45.200310Z
Summary
VMCI: Fix memcpy() run-time warning in dg_dispatch_as_host()
Details

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

VMCI: Fix memcpy() run-time warning in dgdispatchas_host()

Syzkaller hit 'WARNING in dgdispatchas_host' bug.

memcpy: detected field-spanning write (size 56) of single field "&dginfo->msg" at drivers/misc/vmwvmci/vmci_datagram.c:237 (size 24)

WARNING: CPU: 0 PID: 1555 at drivers/misc/vmwvmci/vmcidatagram.c:237 dgdispatchashost+0x88e/0xa60 drivers/misc/vmwvmci/vmci_datagram.c:237

Some code commentry, based on my understanding:

544 #define VMCIDGSIZE(dg) (VMCIDGHEADERSIZE + (sizet)(dg)->payloadsize) /// This is 24 + payload_size

memcpy(&dginfo->msg, dg, dgsize); Destination = dginfo->msg ---> this is a 24 byte structure(struct vmcidatagram) Source = dg --> this is a 24 byte structure (struct vmcidatagram) Size = dgsize = 24 + payload_size

{payloadsize = 56-24 =32} -- Syzkaller managed to set payloadsize to 32.

35 struct delayeddatagraminfo { 36 struct datagramentry *entry; 37 struct workstruct work; 38 bool indghostqueue; 39 /* msg and msgpayload must be together. */ 40 struct vmcidatagram msg; 41 u8 msgpayload[]; 42 };

So those extra bytes of payload are copied into msg_payload[], a run time warning is seen while fuzzing with Syzkaller.

One possible way to fix the warning is to split the memcpy() into two parts -- one -- direct assignment of msg and second taking care of payload.

Gustavo quoted: "Under FORTIFY_SOURCE we should not copy data across multiple members in a structure."

Database specific
{
    "osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2024/35xxx/CVE-2024-35944.json",
    "cna_assigner": "Linux"
}
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
a110b7ebb9c674a2b591af2780dd512ad0198d50
Fixed
e87bb99d2df6512d8ee37a5d63d2ca9a39a8c051
Fixed
f15eca95138b3d4ec17b63c3c1937b0aa0d3624b
Fixed
ad78c5047dc4076d0b3c4fad4f42ffe9c86e8100
Fixed
130b0cd064874e0d0f58e18fb00e6f3993e90c74
Fixed
feacd430b42bbfa9ab3ed9e4f38b86c43e348c75
Fixed
dae70a57565686f16089737adb8ac64471570f73
Fixed
491a1eb07c2bd8841d63cb5263455e185be5866f
Fixed
19b070fefd0d024af3daa7329cbc0d00de5302ec

Database specific

source
"https://storage.googleapis.com/osv-test-cve-osv-conversion/osv-output/CVE-2024-35944.json"