strace's "make check-valgind-memcheck" produces false reports about out-of-bounds writes on ptrace(PTRACE_GETSIGINFO) invocations on x86_64. This turned out to be a bug in the definition of struct vki_siginfo: its size is 136 which exceeds VKI_SI_MAX_SIZE==128 by 8 bytes. As all 64-bit architectures have union _sifields aligned to wordsize boundary, there is a hole between the preamble and _sifields. Unfortunately, __VKI_ARCH_SI_PREAMBLE_SIZE doesn't take this into account, this results to off-by-one bug in VKI_SI_PAD_SIZE and the whole structure being 8 bytes larger on 64-bit architectures.
Do you have a patch to fix this?
(In reply to Julian Seward from comment #1) > Do you have a patch to fix this? https://sourceforge.net/p/valgrind/mailman/message/36606811/ Besides that, Eugene is working on a test for this bug.
Created attachment 122687 [details] include/vki: fix vki_siginfo_t definition on amd64, arm64, and ppc64 Patch from the mailinglist
Created attachment 122744 [details] include/vki: fix vki_siginfo_t definition on amd64, arm64, and ppc64 Thanks. I pushed the commit as attached. Checked that running make check-valgrind-memcheck doesn't show any issues anymore (at least no ptrace related). commit 3bac39a10abf292d332bb20ab58c6dd5c28f9108
Not that this patch caused bug #416760