summaryrefslogtreecommitdiffstats
path: root/arch/sh/boot/compressed
diff options
context:
space:
mode:
authorGeert Uytterhoeven <geert@linux-m68k.org>2021-03-12 16:46:34 +0100
committerPalmer Dabbelt <palmerdabbelt@google.com>2021-03-16 21:55:11 -0700
commitce989f1472ae350e844b10c880b22543168fbc92 (patch)
tree2fefbfccbc44de36c49b97887dfba8fa3a6d102e /arch/sh/boot/compressed
parentfa59030bf8555a4eb83342fd23c32e30d4f2fe7a (diff)
downloadlinux-stable-ce989f1472ae350e844b10c880b22543168fbc92.tar.gz
linux-stable-ce989f1472ae350e844b10c880b22543168fbc92.tar.bz2
linux-stable-ce989f1472ae350e844b10c880b22543168fbc92.zip
RISC-V: Fix out-of-bounds accesses in init_resources()
init_resources() allocates an array of resources, based on the current total number of memory regions and reserved memory regions. However, allocating this array using memblock_alloc() might increase the number of reserved memory regions. If that happens, populating the array later based on the new number of regions will cause out-of-bounds writes beyond the end of the allocated array. Fix this by allocating one more entry, which may or may not be used. Fixes: 797f0375dd2ef5cd ("RISC-V: Do not allocate memblock while iterating reserved memblocks") Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org> Reviewed-by: Atish Patra <atish.patra@wdc.com> Cc: stable@vger.kernel.org Signed-off-by: Palmer Dabbelt <palmerdabbelt@google.com>
Diffstat (limited to 'arch/sh/boot/compressed')
0 files changed, 0 insertions, 0 deletions