diff options
| author | Pratyush Yadav <[email protected]> | 2025-11-03 18:02:31 +0000 |
|---|---|---|
| committer | Andrew Morton <[email protected]> | 2025-11-10 05:19:47 +0000 |
| commit | 7ecd2e439d1272ac02d798b0033a426e3b00dff5 (patch) | |
| tree | c24855ff3896e5a5a89e96b66962ec8f89e740b2 /drivers/scsi/mpt2sas/mpi/mpi2_raid.h | |
| parent | kho: fix out-of-bounds access of vmalloc chunk (diff) | |
| download | kernel-7ecd2e439d1272ac02d798b0033a426e3b00dff5.tar.gz kernel-7ecd2e439d1272ac02d798b0033a426e3b00dff5.zip | |
kho: fix unpreservation of higher-order vmalloc preservations
kho_vmalloc_unpreserve_chunk() calls __kho_unpreserve() with end_pfn as
pfn + 1. This happens to work for 0-order pages, but leaks higher order
pages.
For example, say order 2 pages back the allocation. During preservation,
they get preserved in the order 2 bitmaps, but
kho_vmalloc_unpreserve_chunk() would try to unpreserve them from the order
0 bitmaps, which should not have these bits set anyway, leaving the order
2 bitmaps untouched. This results in the pages being carried over to the
next kernel. Nothing will free those pages in the next boot, leaking
them.
Fix this by taking the order into account when calculating the end PFN for
__kho_unpreserve().
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 'drivers/scsi/mpt2sas/mpi/mpi2_raid.h')
0 files changed, 0 insertions, 0 deletions
