crypto: ccp - Check for page allocation failure correctly in TIO
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:
crypto: ccp - Check for page allocation failure correctly in TIO
Sashiko notes:
> if __snp_alloc_firmware_pages() returns NULL under memory pressure, is it > safe to pass it directly to page_address()? > > On architectures without HASHED_PAGE_VIRTUAL, page_address(NULL) might > compute a deterministic but invalid, non-zero virtual address. The > subsequent if (tio_status) check would then evaluate to true, and > sev_tsm_init_locked() would dereference the invalid pointer.
Indeed, page_address(NULL) will return non-NULL garbage here. Fix this by checking the page allocation itself for NULL, not the resulting virtual address.
From the CVE record · Linux
The Linux kernel’s crypto ccp TIO code incorrectly checks the virtual address produced after a page allocation fails. Under memory pressure, on architectures without HASHED_PAGE_VIRTUAL, this can lead to an invalid pointer dereference; the input does not specify an attack path, authentication requirements, or user interaction.
Engineers running Linux kernels with the affected crypto ccp TIO code should check their vendor’s advisory for affected versions.