Not scored
ftrace: Do not over-allocate ftrace memory
- Severity
- Not scored
- Exploit likelihood
- 0.26% (higher than 11% of CVEs)
- Published
- Last changed
- Assigned by
- Linux
Description
In the Linux kernel, the following vulnerability has been resolved: ftrace: Do not over-allocate ftrace memory The pg_remaining calculation in ftrace_process_locs() assumes that ENTRIES_PER_PAGE multiplied by 2^order equals the actual capacity of the allocated page group. However, ENTRIES_PER_PAGE is PAGE_SIZE / ENTRY_SIZE (integer division). When PAGE_SIZE is not a multiple of ENTRY_SIZE (e.g. 4096 / 24 = 170 with remainder 16), high-order allocations (like 256 pages) have significantly more capacity than 256 * 170. This leads to pg_remaining being underestimated, which in turn makes skip (derived from skipped - pg_remaining) larger than expected, causing the WARN(skip != remaining) to trigger. Extra allocated pages for ftrace: 2 with 654 skipped WARNING: CPU: 0 PID: 0 at kernel/trace/ftrace.c:7295 ftrace_process_locs+0x5bf/0x5e0 A similar problem in ftrace_allocate_records() can result in allocating too many pages. This can trigger the second warning in ftrace_process_locs(). Extra allocated pages for ftrace WARNING: CPU: 0 PID: 0 at kernel/trace/ftrace.c:7276 ftrace_process_locs+0x548/0x580 Use the actual capacity of a page group to determine the number of pages to allocate. Have ftrace_allocate_pages() return the number of allocated pages to avoid having to calculate it. Use the actual page group capacity when validating the number of unused pages due to skipped entries. Drop the definition of ENTRIES_PER_PAGE since it is no longer used.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| Linux Linux | from dc06779d338de4e5a46166a93ec124222e09f40a before bf802b936a7b269917e4dc233e49f6a928db8286, from 2a6ce8bddd8aafa61aaa705e76eae810f22429be before 23936d19e4383c8dfb03931f032473d4baf92533, from 4a3efc6baff931da9a85c6d2e42c87bd9a827399 before 9aef476717994e96dadfb359641c4b82b521aa36, from 4a3efc6baff931da9a85c6d2e42c87bd9a827399 before be55257fab181b93af38f8c4b1b3cb453a78d742, 6.15 Not affected: before 6.15, from 6.18.7 up to 6.18.*, from 6.19 up to * | CVE List |
What each source says
CVE List
In the Linux kernel, the following vulnerability has been resolved: ftrace: Do not over-allocate ftrace memory The pg_remaining calculation in ftrace_process_locs() assumes that ENTRIES_PER_PAGE multiplied by 2^order equals the actual capacity of the allocated page group. However, ENTRIES_PER_PAGE is PAGE_SIZE / ENTRY_SIZE (integer division). When PAGE_SIZE is not a multiple of ENTRY_SIZE (e.g. 4096 / 24 = 170 with remainder 16), high-order allocations (like 256 pages) have significantly more capacity than 256 * 170. This leads to pg_remaining being underestimated, which in turn makes skip (derived from skipped - pg_remaining) larger than expected, causing the WARN(skip != remaining) to trigger. Extra allocated pages for ftrace: 2 with 654 skipped WARNING: CPU: 0 PID: 0 at kernel/trace/ftrace.c:7295 ftrace_process_locs+0x5bf/0x5e0 A similar problem in ftrace_allocate_records() can result in allocating too many pages. This can trigger the second warning in ftrace_process_locs(). Extra allocated pages for ftrace WARNING: CPU: 0 PID: 0 at kernel/trace/ftrace.c:7276 ftrace_process_locs+0x548/0x580 Use the actual capacity of a page group to determine the number of pages to allocate. Have ftrace_allocate_pages() return the number of allocated pages to avoid having to calculate it. Use the actual page group capacity when validating the number of unused pages due to skipped entries. Drop the definition of ENTRIES_PER_PAGE since it is no longer used.
NVD (es)
En el kernel de Linux, la siguiente vulnerabilidad ha sido resuelta: ftrace: No sobreasignar memoria de ftrace El cálculo de pg_remaining en ftrace_process_locs() asume que ENTRIES_PER_PAGE multiplicado por 2^order es igual a la capacidad real del grupo de páginas asignado. Sin embargo, ENTRIES_PER_PAGE es PAGE_SIZE / ENTRY_SIZE (división entera). Cuando PAGE_SIZE no es un múltiplo de ENTRY_SIZE (por ejemplo, 4096 / 24 = 170 con resto 16), las asignaciones de orden superior (como 256 páginas) tienen significativamente más capacidad que 256 * 170. Esto lleva a que pg_remaining sea subestimado, lo que a su vez hace que skip (derivado de skipped - pg_remaining) sea mayor de lo esperado, lo que provoca que se active el WARN(skip != remaining). Páginas extra asignadas para ftrace: 2 con 654 omitidas ADVERTENCIA: CPU: 0 PID: 0 en kernel/trace/ftrace.c:7295 ftrace_process_locs+0x5bf/0x5e0 Un problema similar en ftrace_allocate_records() puede resultar en la asignación de demasiadas páginas. Esto puede activar la segunda advertencia en ftrace_process_locs(). Páginas extra asignadas para ftrace ADVERTENCIA: CPU: 0 PID: 0 en kernel/trace/ftrace.c:7276 ftrace_process_locs+0x548/0x580 Utilice la capacidad real de un grupo de páginas para determinar el número de páginas a asignar. Haga que ftrace_allocate_pages() devuelva el número de páginas asignadas para evitar tener que calcularlo. Utilice la capacidad real del grupo de páginas al validar el número de páginas no utilizadas debido a entradas omitidas. Elimine la definición de ENTRIES_PER_PAGE ya que ya no se utiliza.
References
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2026-23052 changed 2026-07-04 | CVE Terms of Use |
| NVD | CVE-2026-23052 changed 2026-07-04 | Public domain |