Fixes BZ#379094.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16311
377930 fcntl syscall wrapper is missing flock structure check
378535 Valgrind reports INTERNAL ERROR in execve syscall wrapper
378673 Update libiberty demangler
+379094 Valgrind reports INTERNAL ERROR in rt_sigsuspend syscall wrapper
Release 3.12.0 (20 October 2016)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
PRE_REG_READ2(int, "rt_sigsuspend", vki_sigset_t *, mask, vki_size_t, size)
if (ARG1 != (Addr)NULL) {
PRE_MEM_READ( "rt_sigsuspend(mask)", ARG1, sizeof(vki_sigset_t) );
- VG_(sigdelset)((vki_sigset_t*)ARG1, VG_SIGVGKILL);
- /* We cannot mask VG_SIGVGKILL, as otherwise this thread would not
- be killable by VG_(nuke_all_threads_except).
- We thus silently ignore the user request to mask this signal.
- Note that this is similar to what is done for e.g.
- sigprocmask (see m_signals.c calculate_SKSS_from_SCSS). */
+ if (ML_(safe_to_deref)((vki_sigset_t *) ARG1, sizeof(vki_sigset_t))) {
+ VG_(sigdelset)((vki_sigset_t *) ARG1, VG_SIGVGKILL);
+ /* We cannot mask VG_SIGVGKILL, as otherwise this thread would not
+ be killable by VG_(nuke_all_threads_except).
+ We thus silently ignore the user request to mask this signal.
+ Note that this is similar to what is done for e.g.
+ sigprocmask (see m_signals.c calculate_SKSS_from_SCSS). */
+ } else {
+ SET_STATUS_Failure(VKI_EFAULT);
+ }
}
}
SY(__NR_rt_sigqueueinfo, x0, x0+1, x0); FAIL;
// __NR_rt_sigsuspend 179
- GO(__NR_rt_sigsuspend, "ignore");
- // (I don't know how to test this...)
+ GO(__NR_rt_sigsuspend, "2s 1m");
+ SY(__NR_rt_sigsuspend, x0 + 1, x0 + sizeof(sigset_t)); FAILx(EFAULT);
// __NR_pread64 180
GO(__NR_pread64, "5s 1m");
Address 0x........ is not stack'd, malloc'd or (recently) free'd
-----------------------------------------------------
-179: __NR_rt_sigsuspend ignore
+179: __NR_rt_sigsuspend 2s 1m
-----------------------------------------------------
+Syscall param rt_sigsuspend(mask) contains uninitialised byte(s)
+ ...
+ by 0x........: main (scalar.c:804)
+
+Syscall param rt_sigsuspend(size) contains uninitialised byte(s)
+ ...
+ by 0x........: main (scalar.c:804)
+
+Syscall param rt_sigsuspend(mask) points to unaddressable byte(s)
+ ...
+ by 0x........: main (scalar.c:804)
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
-----------------------------------------------------
180: __NR_pread64 5s 1m
-----------------------------------------------------