PRE_REG_READ2(int, "sigwait",
const vki_sigset_t *, set, int *, sig);
PRE_MEM_READ( "sigwait(set)", ARG1, sizeof(vki_sigset_t));
- vki_sigset_t* set = (vki_sigset_t*)ARG1;
- if (ML_(safe_to_deref)(set, sizeof(vki_sigset_t))) {
- *flags |= SfMayBlock;
- }
PRE_MEM_WRITE( "sigwait(sig)", ARG2, sizeof(int));
+ *flags |= SfMayBlock;
}
// sigwait doesn't follow the norm of returning -1 on error
scalar_thr_exit_CFLAGS = ${AM_CFLAGS} @FLAG_W_NO_UNINITIALIZED@
scalar_vfork_CFLAGS = ${AM_CFLAGS} @FLAG_W_NO_UNUSED_VARIABLE@
sctp2_CFLAGS = ${AM_CFLAGS} @FLAG_W_NO_UNINITIALIZED@
-sigwait_CFLAGS = ${AM_CFLAGS} @FLAG_W_NO_USE_AFTER_FREE@
+sigwait_CFLAGS = ${AM_CFLAGS} @FLAG_W_NO_USE_AFTER_FREE@ @FLAG_W_NO_NONNULL@
stat_CFLAGS = ${AM_CFLAGS} @FLAG_W_NO_MAYBE_UNINITIALIZED@ @FLAG_W_NO_UNINITIALIZED@ @FLAG_W_NO_USE_AFTER_FREE@
statfs_CFLAGS = ${AM_CFLAGS} @FLAG_W_NO_UNINITIALIZED@ @FLAG_W_NO_USE_AFTER_FREE@ @FLAG_W_NO_ALLOC_SIZE@
timing_safe_CFLAGS = ${AM_CFLAGS} @FLAG_W_NO_USE_AFTER_FREE@
#include <stdio.h>
#include <stdlib.h>
#include <assert.h>
+#include <errno.h>
// from stack overflow
// https://stackoverflow.com/questions/6326290/about-the-ambiguous-description-of-sigwait
result = sigwait(psigset, &sig);
+ result = sigwait(NULL, &sig);
+ assert(result == EFAULT);
+
+ raise(SIGUSR1);
+
+ result = sigwait(psigset, NULL);
+ assert(result == EFAULT);
+
return 0;
}
Syscall param sigwait(sig) points to unaddressable byte(s)
at 0x........: _sigwait (in /...libc...)
by 0x........: __sigwait (in /...libc...)
- by 0x........: main (sigwait.c:58)
+ by 0x........: main (sigwait.c:59)
Address 0x........ is 0 bytes inside a block of size 4 free'd
at 0x........: free (vg_replace_malloc.c:...)
+ by 0x........: main (sigwait.c:58)
+ Block was alloc'd at
+ at 0x........: malloc (vg_replace_malloc.c:...)
by 0x........: main (sigwait.c:57)
+
+Syscall param sigwait(set) points to unaddressable byte(s)
+ at 0x........: _sigwait (in /...libc...)
+ by 0x........: __sigwait (in /...libc...)
+ by 0x........: main (sigwait.c:65)
+ Address 0x........ is 0 bytes inside a block of size 16 free'd
+ at 0x........: free (vg_replace_malloc.c:...)
+ by 0x........: main (sigwait.c:61)
Block was alloc'd at
at 0x........: malloc (vg_replace_malloc.c:...)
- by 0x........: main (sigwait.c:56)
+ by 0x........: main (sigwait.c:28)
+
+Syscall param sigwait(set) points to unaddressable byte(s)
+ at 0x........: _sigwait (in /...libc...)
+ by 0x........: __sigwait (in /...libc...)
+ by 0x........: main (sigwait.c:67)
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
Syscall param sigwait(set) points to unaddressable byte(s)
at 0x........: _sigwait (in /...libc...)
by 0x........: __sigwait (in /...libc...)
- by 0x........: main (sigwait.c:64)
+ by 0x........: main (sigwait.c:72)
Address 0x........ is 0 bytes inside a block of size 16 free'd
at 0x........: free (vg_replace_malloc.c:...)
- by 0x........: main (sigwait.c:60)
+ by 0x........: main (sigwait.c:61)
Block was alloc'd at
at 0x........: malloc (vg_replace_malloc.c:...)
- by 0x........: main (sigwait.c:27)
+ by 0x........: main (sigwait.c:28)
+
+Syscall param sigwait(sig) points to unaddressable byte(s)
+ at 0x........: _sigwait (in /...libc...)
+ by 0x........: __sigwait (in /...libc...)
+ by 0x........: main (sigwait.c:72)
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
at 0x........: _sigwait (in /...libc...)
by 0x........: __sigwait (in /...libc...)
by 0x........: __sigwait (in /...libc...)
- by 0x........: main (sigwait.c:58)
+ by 0x........: main (sigwait.c:59)
Address 0x........ is 0 bytes inside a block of size 4 free'd
at 0x........: free (vg_replace_malloc.c:...)
+ by 0x........: main (sigwait.c:58)
+ Block was alloc'd at
+ at 0x........: malloc (vg_replace_malloc.c:...)
by 0x........: main (sigwait.c:57)
+
+Syscall param sigwait(set) points to unaddressable byte(s)
+ at 0x........: _sigwait (in /...libc...)
+ by 0x........: __sigwait (in /...libc...)
+ by 0x........: __sigwait (in /...libc...)
+ by 0x........: main (sigwait.c:65)
+ Address 0x........ is 0 bytes inside a block of size 16 free'd
+ at 0x........: free (vg_replace_malloc.c:...)
+ by 0x........: main (sigwait.c:61)
Block was alloc'd at
at 0x........: malloc (vg_replace_malloc.c:...)
- by 0x........: main (sigwait.c:56)
+ by 0x........: main (sigwait.c:28)
Syscall param sigwait(set) points to unaddressable byte(s)
at 0x........: _sigwait (in /...libc...)
by 0x........: __sigwait (in /...libc...)
by 0x........: __sigwait (in /...libc...)
- by 0x........: main (sigwait.c:64)
+ by 0x........: main (sigwait.c:67)
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+Syscall param sigwait(set) points to unaddressable byte(s)
+ at 0x........: _sigwait (in /...libc...)
+ by 0x........: __sigwait (in /...libc...)
+ by 0x........: __sigwait (in /...libc...)
+ by 0x........: main (sigwait.c:72)
Address 0x........ is 0 bytes inside a block of size 16 free'd
at 0x........: free (vg_replace_malloc.c:...)
- by 0x........: main (sigwait.c:60)
+ by 0x........: main (sigwait.c:61)
Block was alloc'd at
at 0x........: malloc (vg_replace_malloc.c:...)
- by 0x........: main (sigwait.c:27)
+ by 0x........: main (sigwait.c:28)
+
+Syscall param sigwait(sig) points to unaddressable byte(s)
+ at 0x........: _sigwait (in /...libc...)
+ by 0x........: __sigwait (in /...libc...)
+ by 0x........: __sigwait (in /...libc...)
+ by 0x........: main (sigwait.c:72)
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd