devlink: fix xa_alloc_cyclic() error handling
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 |
|
|
6.12.216.13.96.14In the Linux kernel, the following vulnerability has been resolved:
devlink: fix xa_alloc_cyclic() error handling
In case of returning 1 from xa_alloc_cyclic() (wrapping) ERR_PTR(1) will be returned, which will cause IS_ERR() to be false. Which can lead to dereference not allocated pointer (rel).
Fix it by checking if err is lower than zero.
This wasn't found in real usecase, only noticed. Credit to Pierre.
From the CVE record · Linux
The Linux kernel's devlink component mishandles a wrapping return value from xa_alloc_cyclic(), which can lead to dereferencing an unallocated pointer. The input does not establish whether an attacker can trigger this condition or specify network access, authentication, or user-interaction requirements.
Engineers running the Linux kernel should check their versions; the affected versions were not provided.