diff options
| author | Pratyush Yadav <[email protected]> | 2025-11-03 11:01:57 +0000 |
|---|---|---|
| committer | Andrew Morton <[email protected]> | 2025-11-10 05:19:47 +0000 |
| commit | 0b07092d09e54e49b85379a9c60f82d54a881514 (patch) | |
| tree | aeddb3ce6b525bbef845eac7da9cf90abb19b4a5 /lib/mpi/mpi-mpow.c | |
| parent | MAINTAINERS: add Chris and Kairui as the swap maintainer (diff) | |
| download | kernel-0b07092d09e54e49b85379a9c60f82d54a881514.tar.gz kernel-0b07092d09e54e49b85379a9c60f82d54a881514.zip | |
kho: fix out-of-bounds access of vmalloc chunk
The list of pages in a vmalloc chunk is NULL-terminated. So when looping
through the pages in a vmalloc chunk, both kho_restore_vmalloc() and
kho_vmalloc_unpreserve_chunk() rightly make sure to stop when encountering
a NULL page. But when the chunk is full, the loops do not stop and go
past the bounds of chunk->phys, resulting in out-of-bounds memory access,
and possibly the restoration or unpreservation of an invalid page.
Fix this by making sure the processing of chunk stops at the end of the
array.
Link: https://lkml.kernel.org/r/[email protected]
Fixes: a667300bd53f ("kho: add support for preserving vmalloc allocations")
Signed-off-by: Pratyush Yadav <[email protected]>
Reviewed-by: Mike Rapoport (Microsoft) <[email protected]>
Cc: Alexander Graf <[email protected]>
Cc: Baoquan He <[email protected]>
Cc: Pasha Tatashin <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Diffstat (limited to 'lib/mpi/mpi-mpow.c')
0 files changed, 0 insertions, 0 deletions
