RDMA/core: Prefer NLA_NUL_STRING
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ 30dc5e63d6a5ad24894b5512d10b228d73645a44 · < f2c7b39dde2e61df8157066969cc2a408cd3dcd9| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
RDMA/core: Prefer NLA_NUL_STRING
These attributes are evaluated as c-string (passed to strcmp), but NLA_STRING doesn't check for the presence of a \0 terminator.
Either this needs to switch to nla_strcmp() and needs to adjust printf fmt specifier to not use plain %s, or this needs to use NLA_NUL_STRING.
As the code has been this way for long time, it seems to me that userspace does include the terminating nul, even tough its not enforced so far, and thus NLA_NUL_STRING use is the simpler solution.
From the CVE record · Linux
The Linux kernel's RDMA/core code evaluates certain netlink attributes as C strings, but NLA_STRING does not require a null terminator. A crafted attribute could therefore be processed without a guaranteed terminator; the input does not specify the resulting impact, required access, or whether user interaction is needed.
Engineers running the Linux kernel should check whether their kernel includes the RDMA/core fix; affected versions are not specified.