/none/tests/linux/brk-overflow1
/none/tests/linux/brk-overflow2
/none/tests/linux/bug498317
+/none/tests/linux/bug506910
/none/tests/linux/clonev
/none/tests/linux/Makefile
/none/tests/linux/Makefile.in
506499 Unhandled syscall 592 (exterrctl - FreeBSD
506795 Better report which clone flags are problematic
506928 Wrap (deprecated) linux specific ustat syscall
+506910 openat2 with RESOLVE_NO_MAGICLINKS succeeds on /proc/self/exe
506930 valgrind allows SIGKILL being reset to SIG_DFL
506970 mmap needs an EBADF fd_allowed check
if (proc_self_exe) {
// do the syscall with VG_(resolved_exename)
SET_STATUS_from_SysRes(VG_(do_syscall3)(SYSNO, (Word)VG_(resolved_exename), ARG2, ARG3));
+ return;
}
#endif // defined(VGO_linux)
// do the syscall with VG_(resolved_exename)
SET_STATUS_from_SysRes(VG_(do_syscall4)(SYSNO, ARG1, (Word)VG_(resolved_exename), ARG3, ARG4));
+ return;
}
/* Otherwise handle normally */
}
if (proc_self_exe) {
-
// do the syscall with VG_(resolved_exename)
SET_STATUS_from_SysRes(VG_(do_syscall4)(SYSNO, ARG1, (Word)VG_(resolved_exename), ARG3, ARG4));
+ return;
}
/* Otherwise handle normally */
brk-overflow1.stderr.exp brk-overflow1.vgtest \
brk-overflow2.stderr.exp brk-overflow2.vgtest \
bug498317.stderr.exp bug498317.supp bug498317.vgtest \
+ bug506910.stderr.exp bug506910.vgtest \
clonev.stdout.exp clonev.stderr.exp clonev.vgtest \
membarrier.stderr.exp membarrier.vgtest \
mremap.stderr.exp mremap.stderr.exp-glibc27 mremap.stdout.exp \
brk-overflow1 \
brk-overflow2 \
bug498317 \
+ bug506910 \
clonev \
mremap \
mremap2 \
AM_CXXFLAGS += $(AM_FLAG_M3264_PRI)
# Special needs
+bug506910_SOURCES = bug506910.cpp
clonev_LDADD = -lpthread
open_client_SOURCES = open_client.cpp
pthread_stack_LDADD = -lpthread
--- /dev/null
+// For Bug 5056910
+// openat2 with RESOLVE_NO_MAGICLINKS succeeds on /proc/self/exe
+#include <fcntl.h>
+#include <cerrno>
+#include <stdexcept>
+#include <string>
+#include <unistd.h>
+#include <sys/syscall.h>
+#include <unistd.h>
+#include <linux/openat2.h>
+
+int main(int argc, char** argv)
+{
+ auto pid = getpid();
+ auto ppe = std::string("/proc/") + std::to_string(pid) + "/exe";
+#if defined(SYS_openat2)
+ struct open_how oh = { .flags=O_RDONLY, .mode=0UL, .resolve=RESOLVE_NO_MAGICLINKS };
+ int res = syscall(SYS_openat2, AT_FDCWD, "/proc/self/exe", &oh, sizeof(oh));
+ if (-1 != res)
+ {
+ throw std::runtime_error("openat2 should have failed");
+ }
+ else
+ {
+ if (errno != ELOOP)
+ {
+ throw std::runtime_error("errno should be ELOOP");
+ }
+ }
+
+ res = syscall(SYS_openat2, AT_FDCWD, ppe.c_str(), &oh, sizeof(oh));
+ if (-1 != res)
+ {
+ throw std::runtime_error("openat2 should have failed");
+ }
+ else
+ {
+ if (errno != ELOOP)
+ {
+ throw std::runtime_error("errno should be ELOOP");
+ }
+ }
+#endif
+}
--- /dev/null
+prog: bug506910