drm/panthor: reject firmware sections with oversized data
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
| No fix yet |
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
drm/panthor: reject firmware sections with oversized data
In panthor_fw_load_section_entry(), the data size to copy is calculated without validating it against the allocated section_size:
section->data.size = hdr.data.end - hdr.data.start;
If a crafted firmware sets data.size larger than the allocated memory, this could cause a heap buffer overflow in panthor_fw_init_section_mem()
memcpy(section->mem->kmap, section->data.buf, section->data.size);
Additionally, if the section->data.size exceeds the BO size, could this memset underflow the size calculation, leading to a massive out-of-bounds zeroing of kernel memory?
memset(section->mem->kmap + section->data.size, 0, panthor_kernel_bo_size(section->mem) - section->data.size);
From the CVE record · Linux
The Linux kernel’s drm/panthor driver does not check whether a firmware section’s initial data fits in its allocated memory. Loading crafted firmware could cause a heap buffer overflow or out-of-bounds zeroing of kernel memory. The input does not specify how an attacker could supply the firmware or whether authentication or user interaction is required.
Engineers running Linux kernels with the drm/panthor driver should check their kernel version against the vendor advisory; affected versions are not specified.