linux/tools/include/nolibc
Brennan Xavier McManus 5996b2b2da tools/nolibc/stdlib: fix memory error in realloc()
commit 791f464114 upstream.

Pass user_p_len to memcpy() instead of heap->len to prevent realloc()
from copying an extra sizeof(heap) bytes from beyond the allocated
region.

Signed-off-by: Brennan Xavier McManus <bxmcmanus@gmail.com>
Cc: stable@vger.kernel.org
Reviewed-by: Ammar Faizi <ammarfaizi2@gnuweeb.org>
Fixes: 0e0ff63840 ("tools/nolibc/stdlib: Implement `malloc()`, `calloc()`, `realloc()` and `free()`")
Signed-off-by: Willy Tarreau <w@1wt.eu>
Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
History 2024-06-12 11:02:56 +02:00
..
arch-aarch64.h tools/nolibc: Remove .global _start from the entry point code 2022-04-20 17:05:46 -07:00
arch-arm.h tools/nolibc: Remove .global _start from the entry point code 2022-04-20 17:05:46 -07:00
arch-i386.h tools/nolibc: i386: Implement syscall with 6 arguments 2022-04-20 17:05:46 -07:00
arch-mips.h tools/nolibc: restore mips branch ordering in the _start block 2023-01-18 11:58:27 +01:00
arch-riscv.h tools/nolibc: fix the O_* fcntl/open macro definitions for riscv 2023-01-18 11:58:27 +01:00
arch-x86_64.h tools/nolibc: Remove .global _start from the entry point code 2022-04-20 17:05:46 -07:00
arch.h tools/nolibc/arch: split arch-specific code into individual files 2022-04-20 17:05:43 -07:00
ctype.h tools/nolibc: fix missing includes causing build issues at -O0 2023-02-01 08:34:31 +01:00
errno.h tools/nolibc: fix missing includes causing build issues at -O0 2023-02-01 08:34:31 +01:00
Makefile tools/nolibc: add a help target to list supported targets 2022-06-20 09:43:19 -07:00
nolibc.h tools/nolibc: also mention how to build by just setting the include path 2022-04-20 17:05:45 -07:00
signal.h tools/nolibc: fix missing includes causing build issues at -O0 2023-02-01 08:34:31 +01:00
std.h tools/nolibc/std: move the standard type definitions to std.h 2022-04-20 17:05:33 -07:00
stdio.h tools/nolibc: fix missing includes causing build issues at -O0 2023-02-01 08:34:31 +01:00
stdlib.h tools/nolibc/stdlib: fix memory error in realloc() 2024-06-12 11:02:56 +02:00
string.h tools/nolibc: prevent gcc from making memset() loop over itself 2023-02-01 08:34:31 +01:00
sys.h tools/nolibc: fix missing includes causing build issues at -O0 2023-02-01 08:34:31 +01:00
time.h tools/nolibc: fix missing includes causing build issues at -O0 2023-02-01 08:34:31 +01:00
types.h tools/nolibc: fix missing includes causing build issues at -O0 2023-02-01 08:34:31 +01:00
unistd.h tools/nolibc: fix missing includes causing build issues at -O0 2023-02-01 08:34:31 +01:00