crypto: starfive - Fix memory leak in starfive_aes_aead_do_one_req()
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:
crypto: starfive - Fix memory leak in starfive_aes_aead_do_one_req()
The starfive_aes_aead_do_one_req() function allocates rctx->adata with kzalloc() but fails to free it if sg_copy_to_buffer() or starfive_aes_hw_init() fails, which lead to memory leaks.
Since rctx->adata is unconditionally freed after the write_adata operations, ensure consistent cleanup by freeing the allocation in these earlier error paths as well.
Compile tested only. Issue found using a prototype static analysis tool and code review.
From the CVE record · Linux
The StarFive crypto driver can leak memory when sg_copy_to_buffer() or starfive_aes_hw_init() fails during an AEAD request. The input does not establish whether an attacker can trigger these failures or whether network access, authentication, or user interaction is required.
Engineers running Linux kernels with the StarFive crypto driver should check their kernel version; affected versions were not provided.