arm_mpam: Check whether the config array is allocated before destroying it
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:
arm_mpam: Check whether the config array is allocated before destroying it
__destroy_component_cfg() is called to free the configuration array. It uses the embedded 'garbage' structure, which means the array has to be allocated.
If __destroy_component_cfg() is called from mpam_disable() before the configuration was ever allocated, then a NULL pointer is dereferenced.
Check for this case and return early if the configuration is not allocated.
__destroy_component_cfg() also frees the mbwu_state as this is allocated by __allocate_component_cfg(). As the mbwu_state is allocated after comp->cfg is set, and is also under mpam_list_lock, only the first pointer needs checking.
From the CVE record · Linux
The Linux kernel's arm_mpam component can dereference a NULL pointer if mpam_disable() destroys a configuration array that was never allocated. The input does not specify how an attacker could trigger this condition, whether authentication or user interaction is required, or the resulting impact beyond the NULL pointer dereference.
Engineers running Linux kernels with arm_mpam should check their versions; affected versions are not specified.