From: Ivo Raisr Date: Mon, 16 May 2016 06:12:27 +0000 (+0000) Subject: Solaris ioctl: Add wrapper for I_FIND. X-Git-Tag: svn/VALGRIND_3_12_0~146 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=662eab632a6ef48b8237d11c7cd2bc810c9a654a;p=thirdparty%2Fvalgrind.git Solaris ioctl: Add wrapper for I_FIND. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15877 --- diff --git a/coregrind/m_syswrap/syswrap-solaris.c b/coregrind/m_syswrap/syswrap-solaris.c index 45e3a18e78..c8781a125d 100644 --- a/coregrind/m_syswrap/syswrap-solaris.c +++ b/coregrind/m_syswrap/syswrap-solaris.c @@ -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; diff --git a/include/vki/vki-solaris.h b/include/vki/vki-solaris.h index a7b80c6b6d..9568036562 100644 --- a/include/vki/vki-solaris.h +++ b/include/vki/vki-solaris.h @@ -1177,6 +1177,7 @@ typedef struct sigaction vki_sigaction_fromK_t; #include #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 diff --git a/memcheck/tests/solaris/scalar_ioctl.c b/memcheck/tests/solaris/scalar_ioctl.c index dfc39fbce1..a8c056ec90 100644 --- a/memcheck/tests/solaris/scalar_ioctl.c +++ b/memcheck/tests/solaris/scalar_ioctl.c @@ -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(); diff --git a/memcheck/tests/solaris/scalar_ioctl.stderr.exp b/memcheck/tests/solaris/scalar_ioctl.stderr.exp index fdb1a56508..3add960632 100644 --- a/memcheck/tests/solaris/scalar_ioctl.stderr.exp +++ b/memcheck/tests/solaris/scalar_ioctl.stderr.exp @@ -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