CVE-2022-50107: cifs: Fix memory leak when using fscache
In the Linux kernel, the following vulnerability has been resolved:
cifs: Fix memory leak when using fscache
If we hit the 'index == nextcached' case, we leak a refcount on the struct page. Fix this by using readaheadfolio() which takes care of the refcount for you.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 5.18.18 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 5.19.2 - Upgrade
Upgrade
debian/linuxto a version that resolves this vulnerability.Fixed in 6.0.2-1 - Compensating control
In the Linux kernel CIFS fscache code, replace the affected handling with readahead_folio(), which takes care of the struct page refcount and prevents the leak in the 'index == next_cached' case.