staging: greybus: lights: avoid NULL deref
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ 2870b52bae4c81823ffcb3ed2b0626fb39d64f48 · < 06162d85f830582da6e9e5fcf9c9504d6da9ae0b| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
staging: greybus: lights: avoid NULL deref
gb_lights_light_config() stores channel_count before allocating the channels array. If kcalloc() fails, gb_lights_release() iterates the non-zero count and dereferences light->channels, which is NULL.
Allocate channels first and only then publish channels_count so the cleanup path can't walk a NULL pointer.
From the CVE record · Linux
The Linux kernel’s staging greybus lights code can dereference a NULL pointer during cleanup if allocation of the channels array fails. This can cause a kernel crash; the input does not specify how an attacker could trigger the failure or whether access or user interaction is required.
Anyone running a Linux kernel with the staging greybus lights code should check whether their version is affected; affected versions are not specified.