|
From: Paul F. <pa...@so...> - 2025-12-06 09:56:21
|
https://sourceware.org/cgit/valgrind/commit/?id=c48791a0db7ee5e69fd061c696608c121bb5b190 commit c48791a0db7ee5e69fd061c696608c121bb5b190 Author: Paul Floyd <pj...@wa...> Date: Sat Dec 6 10:50:38 2025 +0100 FreeBSD client stack: add an assert to check the stringtable doesn't get overwritten There's already an assert that the stringsize calculated matches the stringsize writte. This adds a check that the pointer table area does not overwrite the stringtable (that is, that the NULL pointer after the last auxv entry pointer does not overwrite the first string [either the interpreter or argv[0]) Diff: --- coregrind/m_initimg/initimg-freebsd.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/coregrind/m_initimg/initimg-freebsd.c b/coregrind/m_initimg/initimg-freebsd.c index cd127736ce..40f74168c9 100644 --- a/coregrind/m_initimg/initimg-freebsd.c +++ b/coregrind/m_initimg/initimg-freebsd.c @@ -841,6 +841,8 @@ static Addr setup_client_stack(const void* init_sp, vg_assert((strtab-stringbase) == stringsize); + vg_assert((HChar*)auxv < stringbase); + /* client_SP is pointing at client's argc/argv */ if (0) { |