You can subscribe to this list here.
| 2002 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(1) |
Oct
(122) |
Nov
(152) |
Dec
(69) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2003 |
Jan
(6) |
Feb
(25) |
Mar
(73) |
Apr
(82) |
May
(24) |
Jun
(25) |
Jul
(10) |
Aug
(11) |
Sep
(10) |
Oct
(54) |
Nov
(203) |
Dec
(182) |
| 2004 |
Jan
(307) |
Feb
(305) |
Mar
(430) |
Apr
(312) |
May
(187) |
Jun
(342) |
Jul
(487) |
Aug
(637) |
Sep
(336) |
Oct
(373) |
Nov
(441) |
Dec
(210) |
| 2005 |
Jan
(385) |
Feb
(480) |
Mar
(636) |
Apr
(544) |
May
(679) |
Jun
(625) |
Jul
(810) |
Aug
(838) |
Sep
(634) |
Oct
(521) |
Nov
(965) |
Dec
(543) |
| 2006 |
Jan
(494) |
Feb
(431) |
Mar
(546) |
Apr
(411) |
May
(406) |
Jun
(322) |
Jul
(256) |
Aug
(401) |
Sep
(345) |
Oct
(542) |
Nov
(308) |
Dec
(481) |
| 2007 |
Jan
(427) |
Feb
(326) |
Mar
(367) |
Apr
(255) |
May
(244) |
Jun
(204) |
Jul
(223) |
Aug
(231) |
Sep
(354) |
Oct
(374) |
Nov
(497) |
Dec
(362) |
| 2008 |
Jan
(322) |
Feb
(482) |
Mar
(658) |
Apr
(422) |
May
(476) |
Jun
(396) |
Jul
(455) |
Aug
(267) |
Sep
(280) |
Oct
(253) |
Nov
(232) |
Dec
(304) |
| 2009 |
Jan
(486) |
Feb
(470) |
Mar
(458) |
Apr
(423) |
May
(696) |
Jun
(461) |
Jul
(551) |
Aug
(575) |
Sep
(134) |
Oct
(110) |
Nov
(157) |
Dec
(102) |
| 2010 |
Jan
(226) |
Feb
(86) |
Mar
(147) |
Apr
(117) |
May
(107) |
Jun
(203) |
Jul
(193) |
Aug
(238) |
Sep
(300) |
Oct
(246) |
Nov
(23) |
Dec
(75) |
| 2011 |
Jan
(133) |
Feb
(195) |
Mar
(315) |
Apr
(200) |
May
(267) |
Jun
(293) |
Jul
(353) |
Aug
(237) |
Sep
(278) |
Oct
(611) |
Nov
(274) |
Dec
(260) |
| 2012 |
Jan
(303) |
Feb
(391) |
Mar
(417) |
Apr
(441) |
May
(488) |
Jun
(655) |
Jul
(590) |
Aug
(610) |
Sep
(526) |
Oct
(478) |
Nov
(359) |
Dec
(372) |
| 2013 |
Jan
(467) |
Feb
(226) |
Mar
(391) |
Apr
(281) |
May
(299) |
Jun
(252) |
Jul
(311) |
Aug
(352) |
Sep
(481) |
Oct
(571) |
Nov
(222) |
Dec
(231) |
| 2014 |
Jan
(185) |
Feb
(329) |
Mar
(245) |
Apr
(238) |
May
(281) |
Jun
(399) |
Jul
(382) |
Aug
(500) |
Sep
(579) |
Oct
(435) |
Nov
(487) |
Dec
(256) |
| 2015 |
Jan
(338) |
Feb
(357) |
Mar
(330) |
Apr
(294) |
May
(191) |
Jun
(108) |
Jul
(142) |
Aug
(261) |
Sep
(190) |
Oct
(54) |
Nov
(83) |
Dec
(22) |
| 2016 |
Jan
(49) |
Feb
(89) |
Mar
(33) |
Apr
(50) |
May
(27) |
Jun
(34) |
Jul
(53) |
Aug
(53) |
Sep
(98) |
Oct
(206) |
Nov
(93) |
Dec
(53) |
| 2017 |
Jan
(65) |
Feb
(82) |
Mar
(102) |
Apr
(86) |
May
(187) |
Jun
(67) |
Jul
(23) |
Aug
(93) |
Sep
(65) |
Oct
(45) |
Nov
(35) |
Dec
(17) |
| 2018 |
Jan
(26) |
Feb
(35) |
Mar
(38) |
Apr
(32) |
May
(8) |
Jun
(43) |
Jul
(27) |
Aug
(30) |
Sep
(43) |
Oct
(42) |
Nov
(38) |
Dec
(67) |
| 2019 |
Jan
(32) |
Feb
(37) |
Mar
(53) |
Apr
(64) |
May
(49) |
Jun
(18) |
Jul
(14) |
Aug
(53) |
Sep
(25) |
Oct
(30) |
Nov
(49) |
Dec
(31) |
| 2020 |
Jan
(87) |
Feb
(45) |
Mar
(37) |
Apr
(51) |
May
(99) |
Jun
(36) |
Jul
(11) |
Aug
(14) |
Sep
(20) |
Oct
(24) |
Nov
(40) |
Dec
(23) |
| 2021 |
Jan
(14) |
Feb
(53) |
Mar
(85) |
Apr
(15) |
May
(19) |
Jun
(3) |
Jul
(14) |
Aug
(1) |
Sep
(57) |
Oct
(73) |
Nov
(56) |
Dec
(22) |
| 2022 |
Jan
(3) |
Feb
(22) |
Mar
(6) |
Apr
(55) |
May
(46) |
Jun
(39) |
Jul
(15) |
Aug
(9) |
Sep
(11) |
Oct
(34) |
Nov
(20) |
Dec
(36) |
| 2023 |
Jan
(79) |
Feb
(41) |
Mar
(99) |
Apr
(169) |
May
(48) |
Jun
(16) |
Jul
(16) |
Aug
(57) |
Sep
(19) |
Oct
|
Nov
|
Dec
|
| S | M | T | W | T | F | S |
|---|---|---|---|---|---|---|
|
|
|
1
(7) |
2
(5) |
3
(2) |
4
(8) |
5
(10) |
|
6
(3) |
7
(9) |
8
(7) |
9
(8) |
10
(7) |
11
(4) |
12
(11) |
|
13
(5) |
14
(17) |
15
(6) |
16
(15) |
17
|
18
(3) |
19
(1) |
|
20
(6) |
21
(18) |
22
(5) |
23
(9) |
24
(6) |
25
(3) |
26
(1) |
|
27
(1) |
28
|
29
(8) |
30
(5) |
|
|
|
|
From: Florian K. <fl...@ei...> - 2015-09-29 20:30:59
|
On 27.09.2015 21:19, Matthias Schwarzott wrote: > Hi there! > > This patch will fix all assembler files that do not declare their stack > as non-executable. > > All assembler files that do not contain this code tells the linker to > mark the stack executable: > > .section .note.GNU-stack,"",@progbits > OR > .section .note.GNU-stack,"",%progbits > > My patch creates a macro that contains either version or nothing if the > platform does not require it. > > Then all asm-files are changed to unconditionally call this macro at the > end of file. > It's nice to clean this up. Thanks! > Additionally it removes an unneeded inclusion of "config.h" from > "dispatch-ppc32-linux.S". No. dispatch-ppc32-linux.S has an #ifdef HAS_ALTIVEC and that symbol is being defined in config.h . > > The only thing I am not sure about is: On which platforms to use > @progbits or %progbits. m_trampoline.S has this: #if defined(VGO_linux) /* Let the linker know we don't need an executable stack */ # if defined(VGP_arm_linux) .section .note.GNU-stack,"",%progbits # else .section .note.GNU-stack,"",@progbits # endif #endif That code is shared for all platforms. A web search provides further evidence that on ARM the @ character introduces a comment in assembler code. On other platforms, the choice of @progbits or %progbits apparently does not matter. At least on mips a grep shows: ./coregrind/m_syswrap/syscall-mips64-linux.S:.section .note.GNU-stack,"",%progbits ./coregrind/m_dispatch/dispatch-mips64-linux.S:.section .note.GNU-stack,"",@progbits So let's run with the above ifdeffery. What I did not quite understand why (sometimes) you moved code outside the #ifdef that guards the complete contents of a file. For instance: --- a/coregrind/m_syswrap/syscall-x86-solaris.S +++ b/coregrind/m_syswrap/syscall-x86-solaris.S @@ -28,9 +28,10 @@ The GNU General Public License is contained in the file COPYING. */ +#include "pub_core_basics_asm.h" + #if defined(VGP_x86_solaris) -#include "pub_core_basics_asm.h" #include "pub_core_vkiscnums_asm.h" #include "libvex_guest_offsets.h" @@ -270,6 +271,9 @@ ML_(blksys_finished_DRET): .long 4b #endif // defined(VGP_x86_solaris) +/* Let the linker know we don't need an executable stack */ +MARK_STACK_NO_EXEC + I don't see a need for that or did you encounter some sort of problem? Florian |
|
From: <sv...@va...> - 2015-09-29 19:03:12
|
Author: iraisr
Date: Tue Sep 29 20:03:05 2015
New Revision: 15691
Log:
Ignore some more executable files in memcheck/tests/solaris.
n-i-bz
Modified:
trunk/memcheck/tests/solaris/ (props changed)
|
Author: iraisr
Date: Tue Sep 29 19:57:56 2015
New Revision: 15690
Log:
Move more complicated tests out of memcheck/tests/solaris/scalar_ioctl
to memcheck/tests/solaris/ioctl.
While at it, remove a fixed size buffer as reported by Florian Krohm.
n-i-bz
Added:
trunk/memcheck/tests/solaris/ioctl.c
trunk/memcheck/tests/solaris/ioctl.stderr.exp
trunk/memcheck/tests/solaris/ioctl.stdout.exp
trunk/memcheck/tests/solaris/ioctl.vgtest
Modified:
trunk/memcheck/tests/solaris/Makefile.am
trunk/memcheck/tests/solaris/scalar_ioctl.c
trunk/memcheck/tests/solaris/scalar_ioctl.stderr.exp
Modified: trunk/memcheck/tests/solaris/Makefile.am
==============================================================================
--- trunk/memcheck/tests/solaris/Makefile.am (original)
+++ trunk/memcheck/tests/solaris/Makefile.am Tue Sep 29 19:57:56 2015
@@ -20,6 +20,7 @@
getzoneoffset.stderr.exp getzoneoffset.vgtest \
gethrtime.stderr.exp gethrtime.stdout.exp gethrtime.vgtest \
gethrusec.stderr.exp gethrusec.stdout.exp gethrusec.vgtest \
+ ioctl.stderr.exp ioctl.stdout.exp ioctl.vgtest \
ldynsym.stderr.exp ldynsym.stdout.exp ldynsym.vgtest \
lsframe1.stderr.exp lsframe1.stdout.exp lsframe1.vgtest \
lsframe2.stderr.exp lsframe2.stdout.exp lsframe2.vgtest \
@@ -60,6 +61,7 @@
gethrtime \
inlinfo \
inlinfo_nested.so \
+ ioctl \
ldynsym \
lsframe1 \
lsframe2 \
@@ -147,6 +149,7 @@
AM_CXXFLAGS += $(AM_FLAG_M3264_PRI)
door_kill_LDADD = -lpthread
+ioctl_LDADD = -lsocket
ldynsym_LDFLAGS = -Wl,--strip-all
pkcs11_LDADD = -lpkcs11
sendfilev_LDADD = -lsendfile
Added: trunk/memcheck/tests/solaris/ioctl.c
==============================================================================
--- trunk/memcheck/tests/solaris/ioctl.c (added)
+++ trunk/memcheck/tests/solaris/ioctl.c Tue Sep 29 19:57:56 2015
@@ -0,0 +1,91 @@
+/* Tests for ioctl wrappers.
+ More complicated ones than just trivial ones in scalar_ioctl. */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <strings.h>
+#include <unistd.h>
+#include <net/if.h>
+#include <sys/socket.h>
+#include <sys/sockio.h>
+
+/* sockio */
+__attribute__((noinline))
+static int test_SIOCGIFCONF(void)
+{
+ int fd = socket(AF_INET, SOCK_DGRAM, 0);
+ if (fd < 0)
+ perror("socket");
+
+ int n_ifs;
+ if (ioctl(fd, SIOCGIFNUM, &n_ifs) < 0)
+ perror("ioctl(SIOCGIFNUM)");
+
+ struct ifconf ifc;
+ ifc.ifc_len = (n_ifs + 1) * sizeof(struct ifreq);
+ ifc.ifc_buf = malloc((n_ifs + 1) * sizeof(struct ifreq));
+ if (ifc.ifc_buf == NULL)
+ perror("malloc");
+
+ if (ioctl(fd, SIOCGIFCONF, &ifc) < 0)
+ perror("ioctl(SIOCGIFCONF)");
+
+ /* Check definedness of ifc attributes ... */
+ int x = 0;
+ if (ifc.ifc_len != 0) x = -1; else x = -2;
+ if (ifc.ifc_req != NULL) x = -3; else x = -4;
+ if (strcmp(ifc.ifc_req[0].ifr_name, "") != 0) x = -5; else x = -6;
+ /* ... and now one which is not defined. */
+ if (strcmp(ifc.ifc_req[n_ifs].ifr_name, "") != 0) x = -7; else x = -8;
+
+ free(ifc.ifc_buf);
+ close(fd);
+ return x;
+}
+
+__attribute__((noinline))
+static int test_SIOCGLIFCONF(void)
+{
+ int fd = socket(AF_INET, SOCK_DGRAM, 0);
+ if (fd < 0)
+ perror("socket");
+
+ struct lifnum lifn;
+ lifn.lifn_family = AF_INET;
+ lifn.lifn_flags = 0;
+ if (ioctl(fd, SIOCGLIFNUM, &lifn) < 0)
+ perror("ioctl(SIOCGLIFNUM)");
+
+ struct lifconf lifc;
+ lifc.lifc_family = AF_INET;
+ lifc.lifc_flags = 0;
+ lifc.lifc_len = (lifn.lifn_count + 1) * sizeof(struct lifreq);
+ lifc.lifc_buf = malloc((lifn.lifn_count + 1) * sizeof(struct lifreq));
+ if (lifc.lifc_buf == NULL)
+ perror("malloc");
+
+ if (ioctl(fd, SIOCGLIFCONF, &lifc) < 0)
+ perror("ioctl(SIOCGLIFCONF)");
+
+ /* Check definedness of lifc attributes ... */
+ int x = 0;
+ if (lifc.lifc_len != 0) x = -1; else x = -2;
+ if (lifc.lifc_req != NULL) x = -3; else x = -4;
+ if (strcmp(lifc.lifc_req[0].lifr_name, "") != 0) x = -5; else x = -6;
+ /* ... and now one which is not defined. */
+ if (strcmp(lifc.lifc_req[lifn.lifn_count].lifr_name, "") != 0)
+ x = -7; else x = -8;
+
+ free(lifc.lifc_buf);
+ close(fd);
+ return x;
+}
+
+int main(void)
+{
+ /* sockio */
+ test_SIOCGIFCONF();
+ test_SIOCGLIFCONF();
+
+ return 0;
+}
Added: trunk/memcheck/tests/solaris/ioctl.stderr.exp
==============================================================================
--- trunk/memcheck/tests/solaris/ioctl.stderr.exp (added)
+++ trunk/memcheck/tests/solaris/ioctl.stderr.exp Tue Sep 29 19:57:56 2015
@@ -0,0 +1,8 @@
+Conditional jump or move depends on uninitialised value(s)
+ at 0x........: test_SIOCGIFCONF (ioctl.c:39)
+ by 0x........: main (ioctl.c:87)
+
+Conditional jump or move depends on uninitialised value(s)
+ at 0x........: test_SIOCGLIFCONF (ioctl.c:76)
+ by 0x........: main (ioctl.c:88)
+
Added: trunk/memcheck/tests/solaris/ioctl.stdout.exp
==============================================================================
(empty)
Added: trunk/memcheck/tests/solaris/ioctl.vgtest
==============================================================================
--- trunk/memcheck/tests/solaris/ioctl.vgtest (added)
+++ trunk/memcheck/tests/solaris/ioctl.vgtest Tue Sep 29 19:57:56 2015
@@ -0,0 +1,2 @@
+prog: ioctl
+vgopts: -q
Modified: trunk/memcheck/tests/solaris/scalar_ioctl.c
==============================================================================
--- trunk/memcheck/tests/solaris/scalar_ioctl.c (original)
+++ trunk/memcheck/tests/solaris/scalar_ioctl.c Tue Sep 29 19:57:56 2015
@@ -1,10 +1,9 @@
-/* Basic ioctl test. */
+/* Basic ioctl scalar tests. */
#define __EXTENSIONS__ 1
#include "scalar.h"
-#include <unistd.h>
#include <net/if.h>
#include <sys/crypto/ioctl.h>
#include <sys/dtrace.h>
@@ -223,9 +222,9 @@
static void sys_ioctl_SIOCGIFCONF_2(void)
{
struct ifconf ifc;
- char buf[5];
+ char buf[] = "";
- ifc.ifc_len = x0 + 5;
+ ifc.ifc_len = x0 + 1;
ifc.ifc_buf = (void *) (x0 + buf);
GO(SYS_ioctl, "(SIOCGIFCONF), 5s 0m");
@@ -233,40 +232,6 @@
}
__attribute__((noinline))
-static int sys_ioctl_SIOCGIFCONF_3(void)
-{
- int fd = socket(AF_INET, SOCK_DGRAM, 0);
- if (fd < 0)
- perror("socket");
-
- int n_ifs;
- if (ioctl(fd, SIOCGIFNUM, &n_ifs) < 0)
- perror("ioctl(SIOCGIFNUM)");
-
- struct ifconf ifc;
- ifc.ifc_len = (n_ifs + 1) * sizeof(struct ifreq);
- ifc.ifc_buf = malloc((n_ifs + 1) * sizeof(struct ifreq));
- if (ifc.ifc_buf == NULL)
- perror("malloc");
-
- GO(SYS_ioctl, "(SIOCGIFCONF), 1s 0m");
- if (ioctl(fd, SIOCGIFCONF, &ifc) < 0)
- perror("ioctl(SIOCGIFCONF)");
-
- /* Check definedness of ifc attributes ... */
- int x = 0;
- if (ifc.ifc_len != 0) x = -1; else x = -2;
- if (ifc.ifc_req != NULL) x = -3; else x = -4;
- if (strcmp(ifc.ifc_req[0].ifr_name, "") != 0) x = -5; else x = -6;
- /* ... and now one which is not defined. */
- if (strcmp(ifc.ifc_req[n_ifs].ifr_name, "") != 0) x = -7; else x = -8;
-
- free(ifc.ifc_buf);
- close(fd);
- return x;
-}
-
-__attribute__((noinline))
static void sys_ioctl_SIOCGIFFLAGS(void)
{
GO(SYS_ioctl, "(SIOCGIFFLAGS) 3s 2m");
@@ -356,9 +321,9 @@
static void sys_ioctl_SIOCGLIFCONF_2(void)
{
struct lifconf lifc;
- char buf[5];
+ char buf[] = "";
- lifc.lifc_len = x0 + 5;
+ lifc.lifc_len = x0 + 1;
lifc.lifc_buf = (void *) (x0 + buf);
lifc.lifc_family = x0 + 1;
lifc.lifc_flags = x0 + 0;
@@ -368,45 +333,6 @@
}
__attribute__((noinline))
-static int sys_ioctl_SIOCGLIFCONF_3(void)
-{
- int fd = socket(AF_INET, SOCK_DGRAM, 0);
- if (fd < 0)
- perror("socket");
-
- struct lifnum lifn;
- lifn.lifn_family = AF_INET;
- lifn.lifn_flags = 0;
- if (ioctl(fd, SIOCGLIFNUM, &lifn) < 0)
- perror("ioctl(SIOCGLIFNUM)");
-
- struct lifconf lifc;
- lifc.lifc_family = AF_INET;
- lifc.lifc_flags = 0;
- lifc.lifc_len = (lifn.lifn_count + 1) * sizeof(struct lifreq);
- lifc.lifc_buf = malloc((lifn.lifn_count + 1) * sizeof(struct lifreq));
- if (lifc.lifc_buf == NULL)
- perror("malloc");
-
- GO(SYS_ioctl, "(SIOCGLIFCONF), 1s 0m");
- if (ioctl(fd, SIOCGLIFCONF, &lifc) < 0)
- perror("ioctl(SIOCGLIFCONF)");
-
- /* Check definedness of lifc attributes ... */
- int x = 0;
- if (lifc.lifc_len != 0) x = -1; else x = -2;
- if (lifc.lifc_req != NULL) x = -3; else x = -4;
- if (strcmp(lifc.lifc_req[0].lifr_name, "") != 0) x = -5; else x = -6;
- /* ... and now one which is not defined. */
- if (strcmp(lifc.lifc_req[lifn.lifn_count].lifr_name, "") != 0)
- x = -7; else x = -8;
-
- free(lifc.lifc_buf);
- close(fd);
- return x;
-}
-
-__attribute__((noinline))
static void sys_ioctl_SIOCGLIFFLAGS(void)
{
GO(SYS_ioctl, "(SIOCGLIFFLAGS) 3s 2m");
@@ -557,7 +483,6 @@
/* sockio */
sys_ioctl_SIOCGIFCONF();
sys_ioctl_SIOCGIFCONF_2();
- sys_ioctl_SIOCGIFCONF_3();
sys_ioctl_SIOCGIFFLAGS();
sys_ioctl_SIOCGIFFLAGS_2();
sys_ioctl_SIOCGIFNETMASK();
@@ -568,7 +493,6 @@
sys_ioctl_SIOCGLIFBRDADDR_2();
sys_ioctl_SIOCGLIFCONF();
sys_ioctl_SIOCGLIFCONF_2();
- sys_ioctl_SIOCGLIFCONF_3();
sys_ioctl_SIOCGLIFFLAGS();
sys_ioctl_SIOCGLIFFLAGS_2();
sys_ioctl_SIOCGLIFNETMASK();
Modified: trunk/memcheck/tests/solaris/scalar_ioctl.stderr.exp
==============================================================================
--- trunk/memcheck/tests/solaris/scalar_ioctl.stderr.exp (original)
+++ trunk/memcheck/tests/solaris/scalar_ioctl.stderr.exp Tue Sep 29 19:57:56 2015
@@ -464,12 +464,6 @@
Address 0x........ is on thread 1's stack
---------------------------------------------------------
- 54: SYS_ioctl (SIOCGIFCONF), 1s 0m
----------------------------------------------------------
-Conditional jump or move depends on uninitialised value(s)
- ...
-
----------------------------------------------------------
54: SYS_ioctl (SIOCGIFFLAGS) 3s 2m
---------------------------------------------------------
Syscall param ioctl(fd) contains uninitialised byte(s)
@@ -662,12 +656,6 @@
Address 0x........ is on thread 1's stack
---------------------------------------------------------
- 54: SYS_ioctl (SIOCGLIFCONF), 1s 0m
----------------------------------------------------------
-Conditional jump or move depends on uninitialised value(s)
- ...
-
----------------------------------------------------------
54: SYS_ioctl (SIOCGLIFFLAGS) 3s 2m
---------------------------------------------------------
Syscall param ioctl(fd) contains uninitialised byte(s)
|
|
From: Florian K. <fl...@ei...> - 2015-09-29 15:34:34
|
On 29.09.2015 16:23, sv...@va... wrote:
> +static void sys_ioctl_SIOCGLIFCONF_2(void)
> +{
> + struct lifconf lifc;
> + char buf[5];
If this buffer is always large enough, could you add a comment saying
so? In the past we had many fixed size buffers that were not large
enough and I got rid of almost all of them. For the remaining fixed size
buffers I added a comment (where appropriate) to make it clear for the
cursory reader that the array bound is not a problem.
Thanks,
Florian
|
Author: iraisr
Date: Tue Sep 29 15:23:51 2015
New Revision: 15689
Log:
Solaris ioctl: more of those sockio ioctl wrappers.
SIOCGLIFBRDADDR, SIOCGLIFCONF, SIOCGLIFFLAGS, SIOCGLIFNETMASK.
n-i-bz
Modified:
trunk/coregrind/m_syswrap/syswrap-solaris.c
trunk/include/vki/vki-solaris.h
trunk/memcheck/tests/solaris/scalar_ioctl.c
trunk/memcheck/tests/solaris/scalar_ioctl.stderr.exp
Modified: trunk/coregrind/m_syswrap/syswrap-solaris.c
==============================================================================
--- trunk/coregrind/m_syswrap/syswrap-solaris.c (original)
+++ trunk/coregrind/m_syswrap/syswrap-solaris.c Tue Sep 29 15:23:51 2015
@@ -3184,6 +3184,50 @@
case VKI_SIOCGIFNUM:
PRE_MEM_WRITE("ioctl(SIOCGIFNUM)", ARG3, sizeof(int));
break;
+ case VKI_SIOCGLIFBRDADDR:
+ {
+ struct vki_lifreq *p = (struct vki_lifreq *) ARG3;
+ PRE_FIELD_READ("ioctl(SIOCGLIFBRDADDR, lifreq->lifr_name)",
+ p->lifr_name);
+ PRE_FIELD_WRITE("ioctl(SIOCGLIFBRDADDR, lifreq->lifr_addr)",
+ p->lifr_addr);
+ }
+ break;
+ case VKI_SIOCGLIFCONF:
+ {
+ struct vki_lifconf *p = (struct vki_lifconf *) ARG3;
+ PRE_FIELD_READ("ioctl(SIOCGLIFCONF, lifconf->lifc_len)", p->lifc_len);
+ PRE_FIELD_READ("ioctl(SIOCGLIFCONF, lifconf->lifc_buf)", p->lifc_buf);
+ PRE_FIELD_READ("ioctl(SIOCGLIFCONF, lifconf->lifc_family)",
+ p->lifc_family);
+ PRE_FIELD_READ("ioctl(SIOCGLIFCONF, lifconf->lifc_flags)",
+ p->lifc_flags);
+ if (ML_(safe_to_deref)(p, sizeof(*p))) {
+ if ((p->lifc_buf != NULL) && (p->lifc_len > 0))
+ PRE_MEM_WRITE("ioctl(SIOCGLIFCONF, lifconf->lifc_buf)",
+ (Addr) p->lifc_buf, p->lifc_len);
+ }
+ /* lifc_len gets also written to during SIOCGLIFCONF ioctl. */
+ }
+ break;
+ case VKI_SIOCGLIFFLAGS:
+ {
+ struct vki_lifreq *p = (struct vki_lifreq *) ARG3;
+ PRE_FIELD_READ("ioctl(SIOCGLIFFLAGS, lifreq->lifr_name)",
+ p->lifr_name);
+ PRE_FIELD_WRITE("ioctl(SIOCGLIFFLAGS, lifreq->lifr_flags)",
+ p->lifr_flags);
+ }
+ break;
+ case VKI_SIOCGLIFNETMASK:
+ {
+ struct vki_lifreq *p = (struct vki_lifreq *) ARG3;
+ PRE_FIELD_READ("ioctl(SIOCGLIFNETMASK, lifreq->lifr_name)",
+ p->lifr_name);
+ PRE_FIELD_WRITE("ioctl(SIOCGLIFNETMASK, lifreq->lifr_addr)",
+ p->lifr_addr);
+ }
+ break;
case VKI_SIOCGLIFNUM:
{
struct vki_lifnum *p = (struct vki_lifnum *) ARG3;
@@ -3375,6 +3419,33 @@
case VKI_SIOCGIFNUM:
POST_MEM_WRITE(ARG3, sizeof(int));
break;
+ case VKI_SIOCGLIFBRDADDR:
+ {
+ struct vki_lifreq *p = (struct vki_lifreq *) ARG3;
+ POST_FIELD_WRITE(p->lifr_addr);
+ }
+ break;
+ case VKI_SIOCGLIFCONF:
+ {
+ struct vki_lifconf *p = (struct vki_lifconf *) ARG3;
+ POST_FIELD_WRITE(p->lifc_len);
+ POST_FIELD_WRITE(p->lifc_req);
+ if ((p->lifc_req != NULL) && (p->lifc_len > 0))
+ POST_MEM_WRITE((Addr) p->lifc_req, p->lifc_len);
+ }
+ break;
+ case VKI_SIOCGLIFFLAGS:
+ {
+ struct vki_lifreq *p = (struct vki_lifreq *) ARG3;
+ POST_FIELD_WRITE(p->lifr_flags);
+ }
+ break;
+ case VKI_SIOCGLIFNETMASK:
+ {
+ struct vki_lifreq *p = (struct vki_lifreq *) ARG3;
+ POST_FIELD_WRITE(p->lifr_addr);
+ }
+ break;
case VKI_SIOCGLIFNUM:
{
struct vki_lifnum *p = (struct vki_lifnum *) ARG3;
Modified: trunk/include/vki/vki-solaris.h
==============================================================================
--- trunk/include/vki/vki-solaris.h (original)
+++ trunk/include/vki/vki-solaris.h Tue Sep 29 15:23:51 2015
@@ -205,7 +205,9 @@
#include <net/if.h>
#define vki_ifconf ifconf
#define vki_ifreq ifreq
+#define vki_lifconf lifconf
#define vki_lifnum lifnum
+#define vki_lifreq lifreq
#include <netinet/in.h>
@@ -1068,6 +1070,10 @@
#define VKI_SIOCGIFFLAGS SIOCGIFFLAGS
#define VKI_SIOCGIFNETMASK SIOCGIFNETMASK
#define VKI_SIOCGIFNUM SIOCGIFNUM
+#define VKI_SIOCGLIFBRDADDR SIOCGLIFBRDADDR
+#define VKI_SIOCGLIFCONF SIOCGLIFCONF
+#define VKI_SIOCGLIFFLAGS SIOCGLIFFLAGS
+#define VKI_SIOCGLIFNETMASK SIOCGLIFNETMASK
#define VKI_SIOCGLIFNUM SIOCGLIFNUM
Modified: trunk/memcheck/tests/solaris/scalar_ioctl.c
==============================================================================
--- trunk/memcheck/tests/solaris/scalar_ioctl.c (original)
+++ trunk/memcheck/tests/solaris/scalar_ioctl.c Tue Sep 29 15:23:51 2015
@@ -235,8 +235,6 @@
__attribute__((noinline))
static int sys_ioctl_SIOCGIFCONF_3(void)
{
-#define BUF_SIZE sizeof(struct ifreq) * 1000
-
int fd = socket(AF_INET, SOCK_DGRAM, 0);
if (fd < 0)
perror("socket");
@@ -327,6 +325,130 @@
}
__attribute__((noinline))
+static void sys_ioctl_SIOCGLIFBRDADDR(void)
+{
+ GO(SYS_ioctl, "(SIOCGLIFBRDADDR) 3s 2m");
+ SY(SYS_ioctl, x0 - 1, x0 + SIOCGLIFBRDADDR, x0 - 1); FAIL;
+}
+
+__attribute__((noinline))
+static void sys_ioctl_SIOCGLIFBRDADDR_2(void)
+{
+ struct lifreq lifr;
+
+ lifr.lifr_name[0] = x0 + 'l';
+ lifr.lifr_name[1] = x0 + 'o';
+ lifr.lifr_name[2] = x0 + '0';
+ lifr.lifr_name[3] = x0 + '\0';
+
+ GO(SYS_ioctl, "(SIOCGLIFBRDADDR), 4s 0m");
+ SY(SYS_ioctl, x0 - 1, x0 + SIOCGLIFBRDADDR, &lifr + x0); FAIL;
+}
+
+__attribute__((noinline))
+static void sys_ioctl_SIOCGLIFCONF(void)
+{
+ GO(SYS_ioctl, "(SIOCGLIFCONF), 3s 4m");
+ SY(SYS_ioctl, x0 - 1, x0 + SIOCGLIFCONF, x0 - 1); FAIL;
+}
+
+__attribute__((noinline))
+static void sys_ioctl_SIOCGLIFCONF_2(void)
+{
+ struct lifconf lifc;
+ char buf[5];
+
+ lifc.lifc_len = x0 + 5;
+ lifc.lifc_buf = (void *) (x0 + buf);
+ lifc.lifc_family = x0 + 1;
+ lifc.lifc_flags = x0 + 0;
+
+ GO(SYS_ioctl, "(SIOCGLIFCONF), 7s 0m");
+ SY(SYS_ioctl, x0 - 1, x0 + SIOCGLIFCONF, &lifc + x0); FAIL;
+}
+
+__attribute__((noinline))
+static int sys_ioctl_SIOCGLIFCONF_3(void)
+{
+ int fd = socket(AF_INET, SOCK_DGRAM, 0);
+ if (fd < 0)
+ perror("socket");
+
+ struct lifnum lifn;
+ lifn.lifn_family = AF_INET;
+ lifn.lifn_flags = 0;
+ if (ioctl(fd, SIOCGLIFNUM, &lifn) < 0)
+ perror("ioctl(SIOCGLIFNUM)");
+
+ struct lifconf lifc;
+ lifc.lifc_family = AF_INET;
+ lifc.lifc_flags = 0;
+ lifc.lifc_len = (lifn.lifn_count + 1) * sizeof(struct lifreq);
+ lifc.lifc_buf = malloc((lifn.lifn_count + 1) * sizeof(struct lifreq));
+ if (lifc.lifc_buf == NULL)
+ perror("malloc");
+
+ GO(SYS_ioctl, "(SIOCGLIFCONF), 1s 0m");
+ if (ioctl(fd, SIOCGLIFCONF, &lifc) < 0)
+ perror("ioctl(SIOCGLIFCONF)");
+
+ /* Check definedness of lifc attributes ... */
+ int x = 0;
+ if (lifc.lifc_len != 0) x = -1; else x = -2;
+ if (lifc.lifc_req != NULL) x = -3; else x = -4;
+ if (strcmp(lifc.lifc_req[0].lifr_name, "") != 0) x = -5; else x = -6;
+ /* ... and now one which is not defined. */
+ if (strcmp(lifc.lifc_req[lifn.lifn_count].lifr_name, "") != 0)
+ x = -7; else x = -8;
+
+ free(lifc.lifc_buf);
+ close(fd);
+ return x;
+}
+
+__attribute__((noinline))
+static void sys_ioctl_SIOCGLIFFLAGS(void)
+{
+ GO(SYS_ioctl, "(SIOCGLIFFLAGS) 3s 2m");
+ SY(SYS_ioctl, x0 - 1, x0 + SIOCGLIFFLAGS, x0 - 1); FAIL;
+}
+
+__attribute__((noinline))
+static void sys_ioctl_SIOCGLIFFLAGS_2(void)
+{
+ struct lifreq lifr;
+
+ lifr.lifr_name[0] = x0 + 'l';
+ lifr.lifr_name[1] = x0 + 'o';
+ lifr.lifr_name[2] = x0 + '0';
+ lifr.lifr_name[3] = x0 + '\0';
+
+ GO(SYS_ioctl, "(SIOCGLIFFLAGS), 4s 0m");
+ SY(SYS_ioctl, x0 - 1, x0 + SIOCGLIFFLAGS, &lifr + x0); FAIL;
+}
+
+__attribute__((noinline))
+static void sys_ioctl_SIOCGLIFNETMASK(void)
+{
+ GO(SYS_ioctl, "(SIOCGLIFNETMASK) 3s 2m");
+ SY(SYS_ioctl, x0 - 1, x0 + SIOCGLIFNETMASK, x0 - 1); FAIL;
+}
+
+__attribute__((noinline))
+static void sys_ioctl_SIOCGLIFNETMASK_2(void)
+{
+ struct lifreq lifr;
+
+ lifr.lifr_name[0] = x0 + 'l';
+ lifr.lifr_name[1] = x0 + 'o';
+ lifr.lifr_name[2] = x0 + '0';
+ lifr.lifr_name[3] = x0 + '\0';
+
+ GO(SYS_ioctl, "(SIOCGLIFNETMASK), 4s 0m");
+ SY(SYS_ioctl, x0 - 1, x0 + SIOCGLIFNETMASK, &lifr + x0); FAIL;
+}
+
+__attribute__((noinline))
static void sys_ioctl_SIOCGLIFNUM(void)
{
struct lifnum lifn;
@@ -442,6 +564,15 @@
sys_ioctl_SIOCGIFNETMASK_2();
sys_ioctl_SIOCGIFNUM();
sys_ioctl_SIOCGIFNUM_2();
+ sys_ioctl_SIOCGLIFBRDADDR();
+ sys_ioctl_SIOCGLIFBRDADDR_2();
+ sys_ioctl_SIOCGLIFCONF();
+ sys_ioctl_SIOCGLIFCONF_2();
+ sys_ioctl_SIOCGLIFCONF_3();
+ sys_ioctl_SIOCGLIFFLAGS();
+ sys_ioctl_SIOCGLIFFLAGS_2();
+ sys_ioctl_SIOCGLIFNETMASK();
+ sys_ioctl_SIOCGLIFNETMASK_2();
sys_ioctl_SIOCGLIFNUM();
/* filio */
Modified: trunk/memcheck/tests/solaris/scalar_ioctl.stderr.exp
==============================================================================
--- trunk/memcheck/tests/solaris/scalar_ioctl.stderr.exp (original)
+++ trunk/memcheck/tests/solaris/scalar_ioctl.stderr.exp Tue Sep 29 15:23:51 2015
@@ -570,6 +570,176 @@
Address 0x........ is not stack'd, malloc'd or (recently) free'd
---------------------------------------------------------
+ 54: SYS_ioctl (SIOCGLIFBRDADDR) 3s 2m
+---------------------------------------------------------
+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(SIOCGLIFBRDADDR, lifreq->lifr_name) points to unaddressable byte(s)
+ ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+Syscall param ioctl(SIOCGLIFBRDADDR, lifreq->lifr_addr) points to unaddressable byte(s)
+ ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+---------------------------------------------------------
+ 54: SYS_ioctl (SIOCGLIFBRDADDR), 4s 0m
+---------------------------------------------------------
+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(SIOCGLIFBRDADDR, lifreq->lifr_name) points to uninitialised byte(s)
+ ...
+ Address 0x........ is on thread 1's stack
+
+---------------------------------------------------------
+ 54: SYS_ioctl (SIOCGLIFCONF), 3s 4m
+---------------------------------------------------------
+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(SIOCGLIFCONF, lifconf->lifc_len) points to unaddressable byte(s)
+ ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+Syscall param ioctl(SIOCGLIFCONF, lifconf->lifc_buf) points to unaddressable byte(s)
+ ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+Syscall param ioctl(SIOCGLIFCONF, lifconf->lifc_family) points to unaddressable byte(s)
+ ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+Syscall param ioctl(SIOCGLIFCONF, lifconf->lifc_flags) points to unaddressable byte(s)
+ ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+---------------------------------------------------------
+ 54: SYS_ioctl (SIOCGLIFCONF), 7s 0m
+---------------------------------------------------------
+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(SIOCGLIFCONF, lifconf->lifc_len) points to uninitialised byte(s)
+ ...
+ Address 0x........ is on thread 1's stack
+
+Syscall param ioctl(SIOCGLIFCONF, lifconf->lifc_buf) points to uninitialised byte(s)
+ ...
+ Address 0x........ is on thread 1's stack
+
+Syscall param ioctl(SIOCGLIFCONF, lifconf->lifc_family) points to uninitialised byte(s)
+ ...
+ Address 0x........ is on thread 1's stack
+
+Syscall param ioctl(SIOCGLIFCONF, lifconf->lifc_flags) points to uninitialised byte(s)
+ ...
+ Address 0x........ is on thread 1's stack
+
+---------------------------------------------------------
+ 54: SYS_ioctl (SIOCGLIFCONF), 1s 0m
+---------------------------------------------------------
+Conditional jump or move depends on uninitialised value(s)
+ ...
+
+---------------------------------------------------------
+ 54: SYS_ioctl (SIOCGLIFFLAGS) 3s 2m
+---------------------------------------------------------
+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(SIOCGLIFFLAGS, lifreq->lifr_name) points to unaddressable byte(s)
+ ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+Syscall param ioctl(SIOCGLIFFLAGS, lifreq->lifr_flags) points to unaddressable byte(s)
+ ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+---------------------------------------------------------
+ 54: SYS_ioctl (SIOCGLIFFLAGS), 4s 0m
+---------------------------------------------------------
+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(SIOCGLIFFLAGS, lifreq->lifr_name) points to uninitialised byte(s)
+ ...
+ Address 0x........ is on thread 1's stack
+
+---------------------------------------------------------
+ 54: SYS_ioctl (SIOCGLIFNETMASK) 3s 2m
+---------------------------------------------------------
+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(SIOCGLIFNETMASK, lifreq->lifr_name) points to unaddressable byte(s)
+ ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+Syscall param ioctl(SIOCGLIFNETMASK, lifreq->lifr_addr) points to unaddressable byte(s)
+ ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+---------------------------------------------------------
+ 54: SYS_ioctl (SIOCGLIFNETMASK), 4s 0m
+---------------------------------------------------------
+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(SIOCGLIFNETMASK, lifreq->lifr_name) points to uninitialised byte(s)
+ ...
+ Address 0x........ is on thread 1's stack
+
+---------------------------------------------------------
54: SYS_ioctl (SIOCGLIFNUM) 4s 0m
---------------------------------------------------------
Syscall param ioctl(fd) contains uninitialised byte(s)
|
|
From: <sv...@va...> - 2015-09-29 05:40:50
|
Author: bart
Date: Tue Sep 29 06:40:43 2015
New Revision: 15688
Log:
NEWS: Update
Modified:
trunk/NEWS
Modified: trunk/NEWS
==============================================================================
--- trunk/NEWS (original)
+++ trunk/NEWS Tue Sep 29 06:40:43 2015
@@ -12,6 +12,9 @@
* Callgrind:
+* DRD:
+n-i-bz Improved thread startup time significantly on non-Linux platforms.
+
* ==================== OTHER CHANGES ====================
* ==================== FIXED BUGS ====================
|
|
From: <sv...@va...> - 2015-09-29 05:39:07
|
Author: bart
Date: Tue Sep 29 06:39:00 2015
New Revision: 15687
Log:
drd: Improve thread startup code for non-Linux platforms
Ivo Raisr had reported that thread startup was slow on Solaris.
This patch reduces the thread startup time on Solaris.
Modified:
trunk/drd/drd_pthread_intercepts.c
Modified: trunk/drd/drd_pthread_intercepts.c
==============================================================================
--- trunk/drd/drd_pthread_intercepts.c (original)
+++ trunk/drd/drd_pthread_intercepts.c Tue Sep 29 06:39:00 2015
@@ -55,13 +55,6 @@
#include <stdlib.h> /* malloc(), free() */
#include <unistd.h> /* confstr() */
#include "config.h" /* HAVE_PTHREAD_MUTEX_ADAPTIVE_NP etc. */
-#ifdef HAVE_USABLE_LINUX_FUTEX_H
-#include <asm/unistd.h> /* __NR_futex */
-#include <linux/futex.h> /* FUTEX_WAIT */
-#ifndef FUTEX_PRIVATE_FLAG
-#define FUTEX_PRIVATE_FLAG 0
-#endif
-#endif
#include "drd_basics.h" /* DRD_() */
#include "drd_clientreq.h"
#include "pub_tool_redir.h" /* VG_WRAP_FUNCTION_ZZ() */
@@ -218,8 +211,8 @@
typedef struct {
pthread_mutex_t mutex;
+ pthread_cond_t cond;
int counter;
- int waiters;
} DrdSema;
typedef struct
@@ -280,43 +273,21 @@
DRD_IGNORE_VAR(*sema);
pthread_mutex_init(&sema->mutex, NULL);
DRD_(ignore_mutex_ordering)(&sema->mutex);
+ pthread_cond_init(&sema->cond, NULL);
sema->counter = 0;
- sema->waiters = 0;
}
static void DRD_(sema_destroy)(DrdSema* sema)
{
pthread_mutex_destroy(&sema->mutex);
+ pthread_cond_destroy(&sema->cond);
}
static void DRD_(sema_down)(DrdSema* sema)
{
- int res = ENOSYS;
-
pthread_mutex_lock(&sema->mutex);
- if (sema->counter == 0) {
- sema->waiters++;
- while (sema->counter == 0) {
- pthread_mutex_unlock(&sema->mutex);
-#ifdef HAVE_USABLE_LINUX_FUTEX_H
- if (syscall(__NR_futex, (UWord)&sema->counter,
- FUTEX_WAIT | FUTEX_PRIVATE_FLAG, 0) == 0)
- res = 0;
- else
- res = errno;
-#endif
- /*
- * Invoke sched_yield() on non-Linux systems, if the futex syscall has
- * not been invoked or if this code has been built on a Linux system
- * where __NR_futex is defined and is run on a Linux system that does
- * not support the futex syscall.
- */
- if (res != 0 && res != EWOULDBLOCK)
- sched_yield();
- pthread_mutex_lock(&sema->mutex);
- }
- sema->waiters--;
- }
+ while (sema->counter == 0)
+ pthread_cond_wait(&sema->cond, &sema->mutex);
sema->counter--;
pthread_mutex_unlock(&sema->mutex);
}
@@ -325,11 +296,7 @@
{
pthread_mutex_lock(&sema->mutex);
sema->counter++;
-#ifdef HAVE_USABLE_LINUX_FUTEX_H
- if (sema->waiters > 0)
- syscall(__NR_futex, (UWord)&sema->counter,
- FUTEX_WAKE | FUTEX_PRIVATE_FLAG, 1);
-#endif
+ pthread_cond_signal(&sema->cond);
pthread_mutex_unlock(&sema->mutex);
}
|
Author: iraisr
Date: Tue Sep 29 06:20:16 2015
New Revision: 15686
Log:
Solaris ioctl: more wrappers for sockio ioctls.
SIOCGIFCONF, SIOCGIFFLAGS, SIOCGIFNETMASK, and SIOCGIFNUM.
n-i-bz
Modified:
trunk/coregrind/m_syswrap/syswrap-solaris.c
trunk/include/vki/vki-solaris.h
trunk/memcheck/tests/solaris/scalar_ioctl.c
trunk/memcheck/tests/solaris/scalar_ioctl.stderr.exp
Modified: trunk/coregrind/m_syswrap/syswrap-solaris.c
==============================================================================
--- trunk/coregrind/m_syswrap/syswrap-solaris.c (original)
+++ trunk/coregrind/m_syswrap/syswrap-solaris.c Tue Sep 29 06:20:16 2015
@@ -3154,6 +3154,36 @@
break;
/* sockio */
+ case VKI_SIOCGIFCONF:
+ {
+ struct vki_ifconf *p = (struct vki_ifconf *) ARG3;
+ PRE_FIELD_READ("ioctl(SIOCGIFCONF, ifconf->ifc_len)", p->ifc_len);
+ PRE_FIELD_READ("ioctl(SIOCGIFCONF, ifconf->ifc_buf)", p->ifc_buf);
+ if (ML_(safe_to_deref)(p, sizeof(*p))) {
+ if ((p->ifc_buf != NULL) && (p->ifc_len > 0))
+ PRE_MEM_WRITE("ioctl(SIOCGIFCONF, ifconf->ifc_buf)",
+ (Addr) p->ifc_buf, p->ifc_len);
+ }
+ /* ifc_len gets also written to during SIOCGIFCONF ioctl. */
+ }
+ break;
+ case VKI_SIOCGIFFLAGS:
+ {
+ struct vki_ifreq *p = (struct vki_ifreq *) ARG3;
+ PRE_FIELD_READ("ioctl(SIOCGIFFLAGS, ifreq->ifr_name)", p->ifr_name);
+ PRE_FIELD_WRITE("ioctl(SIOCGIFFLAGS, ifreq->ifr_flags)", p->ifr_flags);
+ }
+ break;
+ case VKI_SIOCGIFNETMASK:
+ {
+ struct vki_ifreq *p = (struct vki_ifreq *) ARG3;
+ PRE_FIELD_READ("ioctl(SIOCGIFFLAGS, ifreq->ifr_name)", p->ifr_name);
+ PRE_FIELD_WRITE("ioctl(SIOCGIFFLAGS, ifreq->ifr_addr)", p->ifr_addr);
+ }
+ break;
+ case VKI_SIOCGIFNUM:
+ PRE_MEM_WRITE("ioctl(SIOCGIFNUM)", ARG3, sizeof(int));
+ break;
case VKI_SIOCGLIFNUM:
{
struct vki_lifnum *p = (struct vki_lifnum *) ARG3;
@@ -3164,7 +3194,7 @@
PRE_FIELD_WRITE("ioctl(SIOCGLIFNUM, lifn->lifn_count)",
p->lifn_count);
}
- break;
+ break;
/* filio */
case VKI_FIOSETOWN:
@@ -3321,6 +3351,30 @@
break;
/* sockio */
+ case VKI_SIOCGIFCONF:
+ {
+ struct vki_ifconf *p = (struct vki_ifconf *) ARG3;
+ POST_FIELD_WRITE(p->ifc_len);
+ POST_FIELD_WRITE(p->ifc_req);
+ if ((p->ifc_req != NULL) && (p->ifc_len > 0))
+ POST_MEM_WRITE((Addr) p->ifc_req, p->ifc_len);
+ }
+ break;
+ case VKI_SIOCGIFFLAGS:
+ {
+ struct vki_ifreq *p = (struct vki_ifreq *) ARG3;
+ POST_FIELD_WRITE(p->ifr_flags);
+ }
+ break;
+ case VKI_SIOCGIFNETMASK:
+ {
+ struct vki_ifreq *p = (struct vki_ifreq *) ARG3;
+ POST_FIELD_WRITE(p->ifr_addr);
+ }
+ break;
+ case VKI_SIOCGIFNUM:
+ POST_MEM_WRITE(ARG3, sizeof(int));
+ break;
case VKI_SIOCGLIFNUM:
{
struct vki_lifnum *p = (struct vki_lifnum *) ARG3;
Modified: trunk/include/vki/vki-solaris.h
==============================================================================
--- trunk/include/vki/vki-solaris.h (original)
+++ trunk/include/vki/vki-solaris.h Tue Sep 29 06:20:16 2015
@@ -203,6 +203,8 @@
#include <net/if.h>
+#define vki_ifconf ifconf
+#define vki_ifreq ifreq
#define vki_lifnum lifnum
@@ -1062,6 +1064,10 @@
#include <sys/sockio.h>
+#define VKI_SIOCGIFCONF SIOCGIFCONF
+#define VKI_SIOCGIFFLAGS SIOCGIFFLAGS
+#define VKI_SIOCGIFNETMASK SIOCGIFNETMASK
+#define VKI_SIOCGIFNUM SIOCGIFNUM
#define VKI_SIOCGLIFNUM SIOCGLIFNUM
Modified: trunk/memcheck/tests/solaris/scalar_ioctl.c
==============================================================================
--- trunk/memcheck/tests/solaris/scalar_ioctl.c (original)
+++ trunk/memcheck/tests/solaris/scalar_ioctl.c Tue Sep 29 06:20:16 2015
@@ -4,6 +4,7 @@
#include "scalar.h"
+#include <unistd.h>
#include <net/if.h>
#include <sys/crypto/ioctl.h>
#include <sys/dtrace.h>
@@ -212,6 +213,120 @@
/* sockio */
__attribute__((noinline))
+static void sys_ioctl_SIOCGIFCONF(void)
+{
+ GO(SYS_ioctl, "(SIOCGIFCONF), 3s 2m");
+ SY(SYS_ioctl, x0 - 1, x0 + SIOCGIFCONF, x0 - 1); FAIL;
+}
+
+__attribute__((noinline))
+static void sys_ioctl_SIOCGIFCONF_2(void)
+{
+ struct ifconf ifc;
+ char buf[5];
+
+ ifc.ifc_len = x0 + 5;
+ ifc.ifc_buf = (void *) (x0 + buf);
+
+ GO(SYS_ioctl, "(SIOCGIFCONF), 5s 0m");
+ SY(SYS_ioctl, x0 - 1, x0 + SIOCGIFCONF, &ifc + x0); FAIL;
+}
+
+__attribute__((noinline))
+static int sys_ioctl_SIOCGIFCONF_3(void)
+{
+#define BUF_SIZE sizeof(struct ifreq) * 1000
+
+ int fd = socket(AF_INET, SOCK_DGRAM, 0);
+ if (fd < 0)
+ perror("socket");
+
+ int n_ifs;
+ if (ioctl(fd, SIOCGIFNUM, &n_ifs) < 0)
+ perror("ioctl(SIOCGIFNUM)");
+
+ struct ifconf ifc;
+ ifc.ifc_len = (n_ifs + 1) * sizeof(struct ifreq);
+ ifc.ifc_buf = malloc((n_ifs + 1) * sizeof(struct ifreq));
+ if (ifc.ifc_buf == NULL)
+ perror("malloc");
+
+ GO(SYS_ioctl, "(SIOCGIFCONF), 1s 0m");
+ if (ioctl(fd, SIOCGIFCONF, &ifc) < 0)
+ perror("ioctl(SIOCGIFCONF)");
+
+ /* Check definedness of ifc attributes ... */
+ int x = 0;
+ if (ifc.ifc_len != 0) x = -1; else x = -2;
+ if (ifc.ifc_req != NULL) x = -3; else x = -4;
+ if (strcmp(ifc.ifc_req[0].ifr_name, "") != 0) x = -5; else x = -6;
+ /* ... and now one which is not defined. */
+ if (strcmp(ifc.ifc_req[n_ifs].ifr_name, "") != 0) x = -7; else x = -8;
+
+ free(ifc.ifc_buf);
+ close(fd);
+ return x;
+}
+
+__attribute__((noinline))
+static void sys_ioctl_SIOCGIFFLAGS(void)
+{
+ GO(SYS_ioctl, "(SIOCGIFFLAGS) 3s 2m");
+ SY(SYS_ioctl, x0 - 1, x0 + SIOCGIFFLAGS, x0 - 1); FAIL;
+}
+
+__attribute__((noinline))
+static void sys_ioctl_SIOCGIFFLAGS_2(void)
+{
+ struct ifreq ifr;
+
+ ifr.ifr_name[0] = x0 + 'l';
+ ifr.ifr_name[1] = x0 + 'o';
+ ifr.ifr_name[2] = x0 + '0';
+ ifr.ifr_name[3] = x0 + '\0';
+
+ GO(SYS_ioctl, "(SIOCGIFFLAGS), 4s 0m");
+ SY(SYS_ioctl, x0 - 1, x0 + SIOCGIFFLAGS, &ifr + x0); FAIL;
+}
+
+__attribute__((noinline))
+static void sys_ioctl_SIOCGIFNETMASK(void)
+{
+ GO(SYS_ioctl, "(SIOCGIFNETMASK) 3s 2m");
+ SY(SYS_ioctl, x0 - 1, x0 + SIOCGIFNETMASK, x0 - 1); FAIL;
+}
+
+__attribute__((noinline))
+static void sys_ioctl_SIOCGIFNETMASK_2(void)
+{
+ struct ifreq ifr;
+
+ ifr.ifr_name[0] = x0 + 'l';
+ ifr.ifr_name[1] = x0 + 'o';
+ ifr.ifr_name[2] = x0 + '0';
+ ifr.ifr_name[3] = x0 + '\0';
+
+ GO(SYS_ioctl, "(SIOCGIFNETMASK), 4s 0m");
+ SY(SYS_ioctl, x0 - 1, x0 + SIOCGIFNETMASK, &ifr + x0); FAIL;
+}
+
+__attribute__((noinline))
+static void sys_ioctl_SIOCGIFNUM(void)
+{
+ int ifnum;
+
+ GO(SYS_ioctl, "(SIOCGIFNUM) 3s 0m");
+ SY(SYS_ioctl, x0 - 1, x0 + SIOCGIFNUM, &ifnum + x0); FAIL;
+}
+
+__attribute__((noinline))
+static void sys_ioctl_SIOCGIFNUM_2(void)
+{
+ GO(SYS_ioctl, "(SIOCGIFNUM) 3s 1m");
+ SY(SYS_ioctl, x0 - 1, x0 + SIOCGIFNUM, x0 - 1); FAIL;
+}
+
+__attribute__((noinline))
static void sys_ioctl_SIOCGLIFNUM(void)
{
struct lifnum lifn;
@@ -318,6 +433,15 @@
sys_ioctl_I_CANPUT();
/* sockio */
+ sys_ioctl_SIOCGIFCONF();
+ sys_ioctl_SIOCGIFCONF_2();
+ sys_ioctl_SIOCGIFCONF_3();
+ sys_ioctl_SIOCGIFFLAGS();
+ sys_ioctl_SIOCGIFFLAGS_2();
+ sys_ioctl_SIOCGIFNETMASK();
+ sys_ioctl_SIOCGIFNETMASK_2();
+ sys_ioctl_SIOCGIFNUM();
+ sys_ioctl_SIOCGIFNUM_2();
sys_ioctl_SIOCGLIFNUM();
/* filio */
Modified: trunk/memcheck/tests/solaris/scalar_ioctl.stderr.exp
==============================================================================
--- trunk/memcheck/tests/solaris/scalar_ioctl.stderr.exp (original)
+++ trunk/memcheck/tests/solaris/scalar_ioctl.stderr.exp Tue Sep 29 06:20:16 2015
@@ -424,6 +424,152 @@
...
---------------------------------------------------------
+ 54: SYS_ioctl (SIOCGIFCONF), 3s 2m
+---------------------------------------------------------
+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(SIOCGIFCONF, ifconf->ifc_len) points to unaddressable byte(s)
+ ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+Syscall param ioctl(SIOCGIFCONF, ifconf->ifc_buf) points to unaddressable byte(s)
+ ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+---------------------------------------------------------
+ 54: SYS_ioctl (SIOCGIFCONF), 5s 0m
+---------------------------------------------------------
+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(SIOCGIFCONF, ifconf->ifc_len) points to uninitialised byte(s)
+ ...
+ Address 0x........ is on thread 1's stack
+
+Syscall param ioctl(SIOCGIFCONF, ifconf->ifc_buf) points to uninitialised byte(s)
+ ...
+ Address 0x........ is on thread 1's stack
+
+---------------------------------------------------------
+ 54: SYS_ioctl (SIOCGIFCONF), 1s 0m
+---------------------------------------------------------
+Conditional jump or move depends on uninitialised value(s)
+ ...
+
+---------------------------------------------------------
+ 54: SYS_ioctl (SIOCGIFFLAGS) 3s 2m
+---------------------------------------------------------
+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(SIOCGIFFLAGS, ifreq->ifr_name) points to unaddressable byte(s)
+ ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+Syscall param ioctl(SIOCGIFFLAGS, ifreq->ifr_flags) points to unaddressable byte(s)
+ ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+---------------------------------------------------------
+ 54: SYS_ioctl (SIOCGIFFLAGS), 4s 0m
+---------------------------------------------------------
+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(SIOCGIFFLAGS, ifreq->ifr_name) points to uninitialised byte(s)
+ ...
+ Address 0x........ is on thread 1's stack
+
+---------------------------------------------------------
+ 54: SYS_ioctl (SIOCGIFNETMASK) 3s 2m
+---------------------------------------------------------
+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(SIOCGIFFLAGS, ifreq->ifr_name) points to unaddressable byte(s)
+ ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+Syscall param ioctl(SIOCGIFFLAGS, ifreq->ifr_addr) points to unaddressable byte(s)
+ ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+---------------------------------------------------------
+ 54: SYS_ioctl (SIOCGIFNETMASK), 4s 0m
+---------------------------------------------------------
+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(SIOCGIFFLAGS, ifreq->ifr_name) points to uninitialised byte(s)
+ ...
+ Address 0x........ is on thread 1's stack
+
+---------------------------------------------------------
+ 54: SYS_ioctl (SIOCGIFNUM) 3s 0m
+---------------------------------------------------------
+Syscall param ioctl(fd) contains uninitialised byte(s)
+ ...
+
+Syscall param ioctl(request) contains uninitialised byte(s)
+ ...
+
+Syscall param ioctl(arg) contains uninitialised byte(s)
+ ...
+
+---------------------------------------------------------
+ 54: SYS_ioctl (SIOCGIFNUM) 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(SIOCGIFNUM) points to unaddressable byte(s)
+ ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+---------------------------------------------------------
54: SYS_ioctl (SIOCGLIFNUM) 4s 0m
---------------------------------------------------------
Syscall param ioctl(fd) contains uninitialised byte(s)
|