diff options
author | Douglas Gilbert <dgilbert@interlog.com> | 2020-10-15 20:57:35 +0200 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2020-10-16 17:31:09 +0200 |
commit | b2a182a40278bc5849730e66bca01a762188ed86 (patch) | |
tree | 7c7973081881b7ccd96703ec83c51e2aa026a5c2 /lib/fdt_rw.c | |
parent | lightnvm: fix out-of-bounds write to array devices->info[] (diff) | |
download | linux-b2a182a40278bc5849730e66bca01a762188ed86.tar.xz linux-b2a182a40278bc5849730e66bca01a762188ed86.zip |
sgl_alloc_order: fix memory leak
sgl_alloc_order() can fail when 'length' is large on a memory
constrained system. When order > 0 it will potentially be
making several multi-page allocations with the later ones more
likely to fail than the earlier one. So it is important that
sgl_alloc_order() frees up any pages it has obtained before
returning NULL. In the case when order > 0 it calls the wrong
free page function and leaks. In testing the leak was
sufficient to bring down my 8 GiB laptop with OOM.
Reviewed-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Douglas Gilbert <dgilbert@interlog.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'lib/fdt_rw.c')
0 files changed, 0 insertions, 0 deletions