CVE-2021-47365
JSON

5.5medium

afs: Fix page leak

Severity
5.5medium CVSS:3.1 by NVD
Exploit likelihood
0.21% (higher than 11% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
Linux

Description

In the Linux kernel, the following vulnerability has been resolved: afs: Fix page leak There's a loop in afs_extend_writeback() that adds extra pages to a write we want to make to improve the efficiency of the writeback by making it larger. This loop stops, however, if we hit a page we can't write back from immediately, but it doesn't get rid of the page ref we speculatively acquired. This was caused by the removal of the cleanup loop when the code switched from using find_get_pages_contig() to xarray scanning as the latter only gets a single page at a time, not a batch. Fix this by putting the page on a ref on an early break from the loop. Unfortunately, we can't just add that page to the pagevec we're employing as we'll go through that and add those pages to the RPC call. This was found by the generic/074 test. It leaks ~4GiB of RAM each time it is run - which can be observed with "top".

Affected

Product or packageVersionsReported by
Linux Linuxfrom e87b03f5830ecd8ca21836d3ee48c74f8d58fa31 before d130b5fdd42254d92948d06347940276140c927e, from e87b03f5830ecd8ca21836d3ee48c74f8d58fa31 before 581b2027af0018944ba301d68e7af45c6d1128b5, 5.13
Not affected: before 5.13, from 5.14.9 up to 5.14.*, from 5.15 up to *
CVE List
linux linux_kernelfrom 5.13 before 5.14.9, 5.14.9, 5.15NVD

Classification

CWE-459

SSVC (CISA-ADP): exploitation none, automatable no, technical impact partial.

What each source says

CVE List

In the Linux kernel, the following vulnerability has been resolved: afs: Fix page leak There's a loop in afs_extend_writeback() that adds extra pages to a write we want to make to improve the efficiency of the writeback by making it larger. This loop stops, however, if we hit a page we can't write back from immediately, but it doesn't get rid of the page ref we speculatively acquired. This was caused by the removal of the cleanup loop when the code switched from using find_get_pages_contig() to xarray scanning as the latter only gets a single page at a time, not a batch. Fix this by putting the page on a ref on an early break from the loop. Unfortunately, we can't just add that page to the pagevec we're employing as we'll go through that and add those pages to the RPC call. This was found by the generic/074 test. It leaks ~4GiB of RAM each time it is run - which can be observed with "top".

NVD (es)

En el kernel de Linux, se resolvió la siguiente vulnerabilidad: afs: Reparar pérdida de página. Hay un bucle en afs_extend_writeback() que agrega páginas adicionales a una escritura que queremos realizar para mejorar la eficiencia de la escritura diferida haciéndola más grande. Sin embargo, este bucle se detiene si llegamos a una página desde la que no podemos escribir de inmediato, pero no elimina la referencia de página que adquirimos especulativamente. Esto se debió a la eliminación del bucle de limpieza cuando el código pasó de usar find_get_pages_contig() a escanear xarray, ya que este último solo obtiene una página a la vez, no un lote. Solucione este problema poniendo la página en un árbitro en un descanso temprano del bucle. Desafortunadamente, no podemos simplemente agregar esa página al pagevec que estamos empleando, ya que revisaremos eso y agregaremos esas páginas a la llamada RPC. Esto se encontró mediante la prueba genérica/074. Pierde ~4GiB de RAM cada vez que se ejecuta, lo que se puede observar con "TOP".

References

Sources

SourceRecordLicence
CVE ListCVE-2021-47365 changed 2026-05-11CVE Terms of Use
NVDCVE-2021-47365 changed 2026-06-17Public domain