]> sourceware.org Git - valgrind.git/commit
Bug-456171 [PATCH] FreeBSD: Don't record address errors when accessing the 'kern...
authorPaul Floyd <pjfloyd@wanadoo.fr>
Sun, 3 Jul 2022 11:05:54 +0000 (13:05 +0200)
committerPaul Floyd <pjfloyd@wanadoo.fr>
Sun, 3 Jul 2022 11:05:54 +0000 (13:05 +0200)
commit9f27d8fbc733165d7b1afbc86f1b3cdcd3837cd1
treea0e7a0d1305bc4b5e0e2d67621858c2a2f87ab65
parent0ed32f4b21b51edb3fe370c372fceb6bdb6e079d
Bug-456171 [PATCH] FreeBSD: Don't record address errors when accessing the 'kern.ps_strings' sysctl struct

There is quite a lot of stuff here.

The problem is that setproctitle and kern.ps_strings were using the Valgrind host auxv
rather than the guest. The proposed patch would have just ignored those memory ranges.

I've gone a fair bit further than that
1. refactored the initimg code for building the client auxv. Previously we were
   simply ignoring any non-scalar entries. Now we copy most of thse as well.
   That means that 'strtab' built on the client stack no longet only contains
   strings, at can also now contain binary structures. Note I was a bit
   concerned that there may be some alignment issues, but I haven't seen any
   problems so far.
2. Added intercepts to sysctl and sysctlbyname for kern.ps_strings, then find
   AT_PS_STRINGS from the client auxv that is now usable from step 1.
3. Some refactoring of sysctl and sysctlbyname syscall wrappers. More to do
   there!
4. Added a setproctitle testcase (that also tests the sysctls).
5. Updated the auxv testcase now that more AT_* entries are handled.
20 files changed:
.gitignore
NEWS
coregrind/m_initimg/initimg-freebsd.c
coregrind/m_syswrap/priv_syswrap-freebsd.h
coregrind/m_syswrap/syswrap-freebsd.c
coregrind/m_ume/elf.c
coregrind/pub_core_libcproc.h
include/vki/vki-amd64-freebsd.h
include/vki/vki-freebsd.h
include/vki/vki-x86-freebsd.h
memcheck/tests/freebsd/Makefile.am
memcheck/tests/freebsd/scalar.stderr.exp
memcheck/tests/freebsd/scalar.stderr.exp-x86
memcheck/tests/freebsd/setproctitle.c [new file with mode: 0644]
memcheck/tests/freebsd/setproctitle.stderr.exp [new file with mode: 0644]
memcheck/tests/freebsd/setproctitle.stdout.exp [new file with mode: 0644]
memcheck/tests/freebsd/setproctitle.vgtest [new file with mode: 0644]
none/tests/freebsd/auxv.stderr.exp
none/tests/freebsd/auxv.stderr.exp-freebsd13
none/tests/freebsd/auxv.stderr.exp-freebsd131
This page took 2.092858 seconds and 5 git commands to generate.