PRINT("sys_getsockopt ( %" FMT_REGWORD "u, %" FMT_REGWORD "u, %" FMT_REGWORD "u, %#" FMT_REGWORD "x, %#" FMT_REGWORD "x )",ARG1,ARG2,ARG3,ARG4,ARG5);
PRE_REG_READ5(int, "getsockopt",
int, s, int, level, int, optname,
- void *, optval, int, *optlen);
+ void *, optval, vki_socklen_t, *optlen);
if (optval_p != (Addr)NULL) {
ML_(buf_and_len_pre_check) ( tid, optval_p, optlen_p,
"getsockopt(optval)",
SY(SYS_bind, x0, x0, x0); FAIL;
/* SYS_setsockopt 105 */
- GO(SYS_setsockopt, "5s 0m");
- SY(SYS_setsockopt, x0, x0, x0, x0, x0); FAIL;
+ GO(SYS_setsockopt, "5s 1m");
+ SY(SYS_setsockopt, x0, x0, x0, px+x0, sizeof(socklen_t)+x0); FAIL;
/* SYS_listen 106 */
GO(SYS_listen, "2s 0m");
GO(SYS_getrusage, "2s 1m");
SY(SYS_getrusage, x0, x0); FAIL;
+ socklen_t *len = malloc(sizeof(socklen_t));
+ *len = 2*sizeof(long)+x0;
+ free(len);
+ /*
+ * Should be 2m but it is hard to trigger an optval
+ * error in the scalar, len needs to be safe to deref
+ * and the syscall needs to succeed to trigger a write
+ * error to optval
+ */
/* SYS_getsockopt 118 */
- GO(SYS_setsockopt, "5s 1m");
- SY(SYS_setsockopt, x0, x0, x0, x0, x0); FAIL;
+ GO(SYS_getsockopt, "5s 1m");
+ SY(SYS_getsockopt, x0, x0, x0, px+x0, len+x0); FAIL;
/* unimpl resuba 119 */
...
---------------------------------------------------------
-105: SYS_setsockopt 5s 0m
+105: SYS_setsockopt 5s 1m
---------------------------------------------------------
Syscall param setsockopt(s) contains uninitialised byte(s)
...
Syscall param setsockopt(optlen) contains uninitialised byte(s)
...
+Syscall param socketcall.setsockopt(optval) points to uninitialised byte(s)
+ ...
+ Address 0x........ is 0 bytes inside a block of size 16 alloc'd
+ at 0x........: malloc (vg_replace_malloc.c:...)
+ ...
+
---------------------------------------------------------
106: SYS_listen 2s 0m
---------------------------------------------------------
Address 0x........ is not stack'd, malloc'd or (recently) free'd
---------------------------------------------------------
-105: SYS_setsockopt 5s 1m
+118: SYS_getsockopt 5s 1m
---------------------------------------------------------
-Syscall param setsockopt(s) contains uninitialised byte(s)
+Syscall param getsockopt(s) contains uninitialised byte(s)
...
-Syscall param setsockopt(level) contains uninitialised byte(s)
+Syscall param getsockopt(level) contains uninitialised byte(s)
...
-Syscall param setsockopt(optname) contains uninitialised byte(s)
+Syscall param getsockopt(optname) contains uninitialised byte(s)
...
-Syscall param setsockopt(optval) contains uninitialised byte(s)
+Syscall param getsockopt(optval) contains uninitialised byte(s)
...
-Syscall param setsockopt(optlen) contains uninitialised byte(s)
+Syscall param getsockopt(*optlen) contains uninitialised byte(s)
+ ...
+
+Syscall param getsockopt(optlen) points to unaddressable byte(s)
+ ...
+ Address 0x........ is 0 bytes inside a block of size 4 free'd
+ at 0x........: free (vg_replace_malloc.c:...)
+ ...
+ Block was alloc'd at
+ at 0x........: malloc (vg_replace_malloc.c:...)
...
---------------------------------------------------------
...
---------------------------------------------------------
-105: SYS_setsockopt 5s 0m
+105: SYS_setsockopt 5s 1m
---------------------------------------------------------
Syscall param setsockopt(s) contains uninitialised byte(s)
...
Syscall param setsockopt(optlen) contains uninitialised byte(s)
...
+Syscall param socketcall.setsockopt(optval) points to uninitialised byte(s)
+ ...
+ Address 0x........ is 0 bytes inside a block of size 16 alloc'd
+ at 0x........: malloc (vg_replace_malloc.c:...)
+ ...
+
---------------------------------------------------------
106: SYS_listen 2s 0m
---------------------------------------------------------
Address 0x........ is not stack'd, malloc'd or (recently) free'd
---------------------------------------------------------
-105: SYS_setsockopt 5s 1m
+118: SYS_getsockopt 5s 1m
---------------------------------------------------------
-Syscall param setsockopt(s) contains uninitialised byte(s)
+Syscall param getsockopt(s) contains uninitialised byte(s)
...
-Syscall param setsockopt(level) contains uninitialised byte(s)
+Syscall param getsockopt(level) contains uninitialised byte(s)
...
-Syscall param setsockopt(optname) contains uninitialised byte(s)
+Syscall param getsockopt(optname) contains uninitialised byte(s)
...
-Syscall param setsockopt(optval) contains uninitialised byte(s)
+Syscall param getsockopt(optval) contains uninitialised byte(s)
...
-Syscall param setsockopt(optlen) contains uninitialised byte(s)
+Syscall param getsockopt(*optlen) contains uninitialised byte(s)
+ ...
+
+Syscall param getsockopt(optlen) points to unaddressable byte(s)
+ ...
+ Address 0x........ is 0 bytes inside a block of size 4 free'd
+ at 0x........: free (vg_replace_malloc.c:...)
+ ...
+ Block was alloc'd at
+ at 0x........: malloc (vg_replace_malloc.c:...)
...
---------------------------------------------------------