crypto: ccp - Fix a crash due to incorrect cleanup usage of kfree
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.18.146.19.47.0In the Linux kernel, the following vulnerability has been resolved:
crypto: ccp - Fix a crash due to incorrect cleanup usage of kfree
Annotating a local pointer variable, which will be assigned with the kmalloc-family functions, with the `__cleanup(kfree)` attribute will make the address of the local variable, rather than the address returned by kmalloc, passed to kfree directly and lead to a crash due to invalid deallocation of stack address. According to other places in the repo, the correct usage should be `__free(kfree)`. The code coincidentally compiled because the parameter type `void *` of kfree is compatible with the desired type `struct { ... } **`.
From the CVE record · Linux
The Linux kernel’s crypto ccp code incorrectly uses `__cleanup(kfree)` on a local pointer, causing it to pass a stack address to `kfree`. This can crash the kernel when that cleanup runs. The input does not specify how an attacker could trigger it or whether authentication or user interaction is required.
Engineers running the Linux kernel should check their versions against the vendor advisory; affected versions are not specified.