]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Bug 397012 - glibc ld.so uses arch_prctl on i386.
authorMark Wielaard <mark@klomp.org>
Tue, 31 Jul 2018 13:32:43 +0000 (15:32 +0200)
committerMark Wielaard <mark@klomp.org>
Mon, 6 Aug 2018 12:58:01 +0000 (14:58 +0200)
arch_prctl used to be amd64 only. But since linux 4.12 it is also
implemented for i386. And since glibc 2.28 ld.so will use it to see
if the cpu/kernel provides CET support.

To prevent seeing:

WARNING: unhandled x86-linux syscall: 384
You may be able to write your own handler.
Read the file README_MISSING_SYSCALL_OR_IOCTL.
Nevertheless we consider this a bug.  Please report
it at http://valgrind.org/support/bug_reports.html.

on every program run under valgrind just make it explicitly
not implemented (ENOSYS). This is fine for the glibc usage.
It just indicates there is no CET support.

NEWS
coregrind/m_syswrap/syswrap-x86-linux.c

diff --git a/NEWS b/NEWS
index 0d33876d6971e8deb910934dbd2ba79a2c21cac3..260ee9a7541abea30011f845b4c26b593801db4d 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -137,6 +137,7 @@ where XXXXXX is the bug number as listed below.
 395682  Accept read-only PT_LOAD segments and .rodata by ld -z separate-code
         == 384727
 396887  arch_prctl should return EINVAL on unknown option
+397012  glibc ld.so uses arch_prctl on i386
 
 n-i-bz  Fix missing workq_ops operations (macOS)
 n-i-bz  fix bug in strspn replacement
index bec145acacc81868770b2f17667a699cef2bd935..11bb13d89468003dc73e2abe023ffd063c58dda1 100644 (file)
@@ -1604,7 +1604,10 @@ static SyscallTableEntry syscall_table[] = {
    LINX_(__NR_sendmsg,           sys_sendmsg),          // 370
    LINXY(__NR_recvfrom,          sys_recvfrom),         // 371
    LINXY(__NR_recvmsg,           sys_recvmsg),          // 372
-   LINX_(__NR_shutdown,          sys_shutdown)          // 373
+   LINX_(__NR_shutdown,          sys_shutdown),         // 373
+
+   /* Explicitly not supported on i386 yet. */
+   GENX_(__NR_arch_prctl,        sys_ni_syscall)        // 384
 };
 
 SyscallTableEntry* ML_(get_linux_syscall_entry) ( UInt sysno )