KEYS: encrypted: fix integer overflow of datablob_len
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:
KEYS: encrypted: fix integer overflow of datablob_len
encrypted_key_alloc() stores datablob_len in a u16. It is computed from multiple string and payload lengths. If the result exceeds U16_MAX, the assignment truncates the allocation size. KASAN reports a 32760-byte slab-out-of-bounds write when __ekey_init() copies the master key description into the undersized buffer.
The total payload length stored in key->datalen is also a u16. Use check_add_overflow() to reject values that do not fit either destination, and use kzalloc_flex() for the flexible-array allocation.
From the CVE record · Linux
The Linux kernel’s encrypted-key allocation can truncate a calculated length to 16 bits, leaving an undersized buffer. An oversized master key description can then cause an out-of-bounds write during key initialization. The input does not specify whether exploitation requires local access, authentication, or user interaction.
Engineers running Linux kernels with the affected encrypted-key code should check their kernel versions against the vendor advisory; affected versions are not specified.