netlink: prevent potential spectre v1 gadgets
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
| No fix yet |
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
netlink: prevent potential spectre v1 gadgets
Most netlink attributes are parsed and validated from __nla_validate_parse() or validate_nla()
u16 type = nla_type(nla);
if (type == 0 || type > maxtype) { /* error or continue */ }
@type is then used as an array index and can be used as a Spectre v1 gadget.
array_index_nospec() can be used to prevent leaking content of kernel memory to malicious users.
This should take care of vast majority of netlink uses, but an audit is needed to take care of others where validation is not yet centralized in core netlink functions.
From the CVE record · Linux
Netlink attribute validation in the Linux kernel can leave an attribute type usable as a Spectre v1 array-index gadget. A malicious local user could potentially use this to leak kernel memory when affected netlink attributes are processed; the input does not specify an authentication requirement or additional user interaction.
Anyone running the Linux kernel should check their version against the vendor advisory; affected versions are not specified.