diff options
| author | Keith Busch <[email protected]> | 2022-12-19 18:59:06 +0000 |
|---|---|---|
| committer | Christoph Hellwig <[email protected]> | 2022-12-21 08:17:25 +0000 |
| commit | c89a529e823d51dd23c7ec0c047c7a454a428541 (patch) | |
| tree | fa60419843f42cb3f3b7be7089a05c5c33240ad9 /tools/perf/scripts/python/mem-phys-addr.py | |
| parent | nvme-pci: fix doorbell buffer value endianness (diff) | |
| download | kernel-c89a529e823d51dd23c7ec0c047c7a454a428541.tar.gz kernel-c89a529e823d51dd23c7ec0c047c7a454a428541.zip | |
nvme-pci: fix mempool alloc size
Convert the max size to bytes to match the units of the divisor that
calculates the worst-case number of PRP entries.
The result is used to determine how many PRP Lists are required. The
code was previously rounding this to 1 list, but we can require 2 in the
worst case. In that scenario, the driver would corrupt memory beyond the
size provided by the mempool.
While unlikely to occur (you'd need a 4MB in exactly 127 phys segments
on a queue that doesn't support SGLs), this memory corruption has been
observed by kfence.
Cc: Jens Axboe <[email protected]>
Fixes: 943e942e6266f ("nvme-pci: limit max IO size and segments to avoid high order allocations")
Signed-off-by: Keith Busch <[email protected]>
Reviewed-by: Jens Axboe <[email protected]>
Reviewed-by: Kanchan Joshi <[email protected]>
Reviewed-by: Chaitanya Kulkarni <[email protected]>
Signed-off-by: Christoph Hellwig <[email protected]>
Diffstat (limited to 'tools/perf/scripts/python/mem-phys-addr.py')
0 files changed, 0 insertions, 0 deletions
