]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Solaris ioctl: Add wrapper for I_FIND.
authorIvo Raisr <ivosh@ivosh.net>
Mon, 16 May 2016 06:12:27 +0000 (06:12 +0000)
committerIvo Raisr <ivosh@ivosh.net>
Mon, 16 May 2016 06:12:27 +0000 (06:12 +0000)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15877

coregrind/m_syswrap/syswrap-solaris.c
include/vki/vki-solaris.h
memcheck/tests/solaris/scalar_ioctl.c
memcheck/tests/solaris/scalar_ioctl.stderr.exp

index 45e3a18e783b0f338bf4e448f0587d998710f0f9..c8781a125d02a6640477a45cba9a3945b6dd2acd 100644 (file)
@@ -3127,6 +3127,9 @@ PRE(sys_ioctl)
          }
       }
       break;
+   case VKI_I_FIND:
+      PRE_MEM_RASCIIZ("ioctl(I_FIND)", ARG3);
+      break;
    case VKI_I_PEEK:
       {
          /* Try hard not to mark strpeek->*buf.len members as being read. */
@@ -3384,6 +3387,8 @@ POST(sys_ioctl)
             POST_MEM_WRITE((Addr) p->ic_dp, p->ic_len);
       }
       break;
+   case VKI_I_FIND:
+      break;
    case VKI_I_PEEK:
       {
          struct vki_strpeek *p = (struct vki_strpeek*)ARG3;
index a7b80c6b6d03376c57dd19349d1c27ab640f9415..9568036562bd7cf634909848c46b923fcb32ff16 100644 (file)
@@ -1177,6 +1177,7 @@ typedef struct sigaction vki_sigaction_fromK_t;
 
 #include <sys/stropts.h>
 #define VKI_I_CANPUT I_CANPUT
+#define VKI_I_FIND I_FIND
 #define VKI_I_PEEK I_PEEK
 #define VKI_I_PUSH I_PUSH
 #define VKI_I_STR I_STR
index dfc39fbce14442a67b79157e1a7e9897a04d37e6..a8c056ec90604b13ded22243142d11f62bb567ce 100644 (file)
@@ -179,6 +179,13 @@ static void sys_ioctl_I_STR_2(void)
    SY(SYS_ioctl, x0 - 1, x0 + I_STR, &str + x0); FAIL;
 }
 
+__attribute__((noinline))
+static void sys_ioctl_I_FIND(void)
+{
+   GO(SYS_ioctl, "(I_FIND) 3s 1m");
+   SY(SYS_ioctl, x0 - 1, x0 + I_FIND, x0 + 1); FAIL;
+}
+
 __attribute__((noinline))
 static void sys_ioctl_I_PEEK(void)
 {
@@ -476,6 +483,7 @@ int main(void)
    sys_ioctl_I_PUSH();
    sys_ioctl_I_STR();
    sys_ioctl_I_STR_2();
+   sys_ioctl_I_FIND();
    sys_ioctl_I_PEEK();
    sys_ioctl_I_PEEK_2();
    sys_ioctl_I_CANPUT();
index fdb1a56508091a3752f49f49b7954df35acac97d..3add9606328963e65143634f9d867f935256e199 100644 (file)
@@ -328,6 +328,22 @@ Syscall param ioctl(I_STR, strioctl->ic_dp) points to unaddressable byte(s)
    ...
  Address 0x........ is not stack'd, malloc'd or (recently) free'd
 
+---------------------------------------------------------
+ 54:               SYS_ioctl (I_FIND) 3s 1m
+---------------------------------------------------------
+Syscall param ioctl(fd) contains uninitialised byte(s)
+   ...
+
+Syscall param ioctl(request) contains uninitialised byte(s)
+   ...
+
+Syscall param ioctl(arg) contains uninitialised byte(s)
+   ...
+
+Syscall param ioctl(I_FIND) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
 ---------------------------------------------------------
  54:               SYS_ioctl (I_PEEK) 3s 7m
 ---------------------------------------------------------
@@ -384,6 +400,9 @@ Syscall param ioctl(I_PEEK, strpeek->ctlbuf.maxlen) points to uninitialised byte
    ...
  Address 0x........ is on thread 1's stack
 
+
+More than 100 errors detected.  Subsequent errors
+will still be recorded, but in less detail than before.
 Syscall param ioctl(I_PEEK, strpeek->ctlbuf.buf) points to uninitialised byte(s)
    ...
  Address 0x........ is on thread 1's stack
@@ -400,9 +419,6 @@ Syscall param ioctl(I_PEEK, strpeek->flags) points to uninitialised byte(s)
    ...
  Address 0x........ is on thread 1's stack
 
-
-More than 100 errors detected.  Subsequent errors
-will still be recorded, but in less detail than before.
 Syscall param ioctl(I_PEEK, strpeek->ctlbuf.buf) points to unaddressable byte(s)
    ...
  Address 0x........ is not stack'd, malloc'd or (recently) free'd