evm: terminate and bound the evm_xattrs read buffer
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ fa516b66a1bfce1d72f1620c54bdfebc493000d1 · < 38b7d63b23aa9d2ddde7688040e9426d32be4065| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
evm: terminate and bound the evm_xattrs read buffer
evm_read_xattrs() allocates size + 1 bytes, fills them from the list of enabled xattrs, and then passes strlen(temp) to simple_read_from_buffer(). When no configured xattrs are enabled, the fill loop stores nothing and temp[0] remains uninitialized, so strlen() reads beyond initialized memory.
Explicitly terminate the buffer after allocation, use snprintf() for each formatted line, and pass the accumulated length, without risk of truncation, to simple_read_from_buffer().
From the CVE record · Linux
The Linux kernel's EVM xattrs read path can pass an uninitialized buffer to strlen() when no configured xattrs are enabled. Reading evm_xattrs under that condition can cause strlen() to read beyond initialized memory. The input does not specify access or authentication requirements.
Teams running Linux kernels should check whether their kernel includes the affected EVM code; affected versions are not specified.