Executive brief
A HiSilicon HPRE cryptographic accelerator driver in the Linux kernel fails to release allocated resources when SR-IOV disable fails during device removal. An attacker with the ability to trigger device removal while causing SR-IOV disable to fail could cause a resource leak, potentially leading to kernel memory exhaustion and system instability.
Technical details
The vulnerability is a resource leak (CWE-404) in the hpre_remove() function of the HiSilicon HPRE crypto driver (drivers/crypto/hisilicon/hpre/hpre_main.c). When hisi_qm_sriov_disable() returns an error, the original code immediately returns without executing subsequent cleanup code that deallocates debugfs entries and stops the queue manager. This leaves kernel memory and I/O resources allocated. The fix removes the early error return, allowing cleanup to proceed regardless of SR-IOV disable failure. Attack vector requires local access to trigger device removal conditions or manipulation of SR-IOV operations. The vulnerability affects Linux kernel versions prior to the fix (commit 45e6319bd5f2154d8b8c9f1eaa4ac030ba0d330c, backported as 2b3e3ecdb402ff1053ee25b598ff21b9ddf4384f).
Affected products
- Linux Linux kernel before fix (commit 45e6319bd5f2154d8b8c9f1eaa4ac030ba0d330c)
Timeline
- 2022-09-24: other: Patch authored by Zhiqi Song
- 2022-10-21: disclosed: Upstream commit 45e6319bd5f2154d8b8c9f1eaa4ac030ba0d330c
- 2022-12-31: patched: Stable kernel backport 2b3e3ecdb402ff1053ee25b598ff21b9ddf4384f
- 2025-10-01: advisory