X86/FreeBSD, AMD64/FreeBSD and ARM64/FreeBSD. There is preliminary support
for nanoMIPS/Linux. macOS is supported up to version 12 Monterey (amd64 only).
- ==================== CORE CHANGES ===================
+* ==================== CORE CHANGES ===================
+
+* linux madvise MADV_GUARD_INSTALL unsupported
+
+ glibc 2.42+ (with linux 6.13+) uses MADV_GUARD_INSTALL to setup
+ stack guard pages. valgrind currently isn't able to track this and
+ such guard pages also don't show up in /proc maps (only in /proc
+ pagemap since linux 6.14). For now valgrind fails a madvise
+ MADV_GUARD_INSTALL syscall with EINVAL. This causes glibc to fall
+ back to mprotect PROT_NONE which valgrind is able to track.
+ See also https://bugs.kde.org/show_bug.cgi?id=514297
* ================== PLATFORM CHANGES =================
511329 Darwin and FreeBSD: Move setting of carry flag out of
ML_(do_syscall_for_client_WRK)
511713 Refactor syscall argument handling
+511717 gdbserver (valgrind_read_memory) the 'impossible' happened:
+ Killed by fatal signal (SIGSEGV)
511972 valgrind-3.26.0 tests fail to build on upcomig gcc-16:
unrecognized command-line option
'-Wno-alloc-size-larger-than=18446744073709551615'
ARG1, ARG2, SARG3);
PRE_REG_READ3(long, "madvise",
unsigned long, start, vki_size_t, length, int, advice);
+ /* Ugly hack to try to bypass the problem of guard pages not being
+ understood by valgrind aspace manager.
+ By making the syscall fail, we expect glibc to fallback
+ on implementing guard pages with mprotect PROT_NONE to ensure
+ the valgrind address space manager is not confused wrongly
+ believing the guard page is rw. */
+#ifdef VKI_MADV_GUARD_INSTALL
+ if (ARG3 == VKI_MADV_GUARD_INSTALL)
+ SET_STATUS_Failure( VKI_EINVAL );
+#endif
}
#if HAVE_MREMAP
#define VKI_MREMAP_MAYMOVE 1
#define VKI_MREMAP_FIXED 2
+//----------------------------------------------------------------------
+// Common madvise flags mman-common.h
+//----------------------------------------------------------------------
+
+#define VKI_MADV_GUARD_INSTALL 102
+#define VKI_MADV_GUARD_REMOVE 103
+
//----------------------------------------------------------------------
// From linux-2.6.31-rc4/include/linux/futex.h
//----------------------------------------------------------------------