Commit Graph

644 Commits

Author SHA1 Message Date
Petar Jovanovic
302ca71a6a mips32: another VG_(am_get_advisory) needs non-single-page-size adjustment
Another mmap issue in which another VG_(am_get_advisory) needs adjustment
wrapper for cases when (VKI_SHMLBA > VKI_PAGE_SIZE) and argument is
VKI_MAP_SHARED.

Fix by DejanJ for Bug #320057.
Issue and the test case by Vasile Floroiu.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13450
2013-07-12 15:32:27 +00:00
Mark Wielaard
fe9acdded4 Bug 321969. Support [lf]setxattr on ppc32 and ppc64 linux kernel.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13449
2013-07-05 09:50:26 +00:00
Bart Van Assche
7e6e7ae4d1 [PATCH 4/4] xen: VKI_XENMEM_get_sharing_{freed, shared}_pages hypercall (#321065)
From: Andrew Cooper <andrew.cooper3@citrix.com>


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13438
2013-06-30 07:59:50 +00:00
Bart Van Assche
8650980ea8 [PATCH 3/4] xen: VKI_XEN_SYSCTL_sched_id hypercall (#321065)
From: Andrew Cooper <andrew.cooper3@citrix.com>


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13437
2013-06-30 07:59:09 +00:00
Bart Van Assche
bbe2f19d40 [PATCH 2/4] xen: update for interface changes in Xen 4.3 release (#321065)
From: Ian Campbell <ian.campbell@citrix.com>



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13436
2013-06-30 07:58:19 +00:00
Bart Van Assche
c46c27fd34 [PATCH 1/4] xen: distinguish the various fields of the Xen privcmd ioctls in the logging (#321065)
From: Ian Campbell <ian.campbell@citrix.com>


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13435
2013-06-30 07:57:35 +00:00
Petar Jovanovic
3c8aeab70e mips64: add cases in wrappers for ptrace calls with GETREGSET
Add cases for PTRACE_GETREGSET in PRE(sys_ptrace) and POST(sys_ptrace).

This fixes memcheck/tests/linux/getregset on MIPS64 platforms with kernel
that supports ptrace call with PTRACE_GETREGSET.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13418
2013-06-03 15:33:09 +00:00
Mark Wielaard
6fd4d3b541 Don't break platforms without AF_BLUETOOTH.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13405
2013-05-22 10:37:52 +00:00
Mark Wielaard
86f74d6026 Support Linux kernel AF_BLUETOOTH for bind().
Bug #320116. sockaddr_rc might contain some padding which might not be
initialized. Explicitly check the sockaddr_rc fields are set. That also
produces better diagnostics about which field is unitialized.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13404
2013-05-22 10:21:10 +00:00
Mark Wielaard
d4513c94f0 Support PTRACE_GET/SET_THREAD_AREA on x86.
BZ#320063.  (Josh Stone, jistone@redhat.com)

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13403
2013-05-22 10:21:08 +00:00
Petar Jovanovic
c116ce3d06 mips: enable syscalls prlimit64, process_vm_readv, process_vm_writev
Enable wrappers for syscalls prlimit64, process_vm_readv, process_vm_writev,
needed by the following tests:

- none/tests/rlimit64_nofile and
- none/tests/process_vm_readv_writev.

The change also adds definitions for several system calls for MIPS64.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13400
2013-05-14 14:13:15 +00:00
Carl Love
7c6281ffb8 Add syscall suport for system calls sys_mbind, sys_set_mempolicy and
sys_get_mempolicy.

This patch add support for the PPC64 sytem calls:
        259 - sys_mbind
	260 - sys_get_mempolicy
	261 - sys_set_mempolicy

This patch also adds the Add syscall 259, sys_mbind, support for the PPC32
platform.

The patch fixes bugzilla 318932.

Signed-off-by: Carl Love <cel@us.ibm.com>
---


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13383
2013-05-07 15:47:35 +00:00
Petar Jovanovic
1fb2e817bb mips: fixup blksys_restart address for mips64
Restart logic has changed in kernel, this is counterpart in Valgrind.

This change fixes:

none/tests/syscall-restart1
none/tests/syscall-restart2

for mips64.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13379
2013-04-26 19:01:04 +00:00
Petar Jovanovic
4ee8c6feea mips: enable several system call wrappers on mips64
Enable wrappers on mips64 for the following calls:

- dup3
- accept4
- epoll_create1
- timerfd_settime
- newfstatat

Also, allow additional flock64 values in sys_fcntl for mips64.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13358
2013-04-03 23:43:11 +00:00
Julian Seward
cca00cebc1 Enable prctl on ppc64-linux. Fixes #308089.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13350
2013-03-29 09:40:48 +00:00
Bart Van Assche
1ae0d437be Darwin: Fix a compiler warning
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13319
2013-03-10 12:49:08 +00:00
Tom Hughes
269fc43ee7 Implement the name_to_handle_at system call for x86 and amd64.
Based on patch from Asmadeus to fix BZ#308930.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13304
2013-03-03 12:57:20 +00:00
Philippe Waroquiers
1b9a118603 Factorise some code from syswrap-amd64/arm/mips32/mips64-linux.c to syswrap-linux.c
Almost mechanical transformation, removes > 1000 SLOC.

Compiled and regtested on amd64/x86/mips32
Compiled and (somewhat) tested on mips64
Compiled on arm



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13302
2013-03-01 23:31:09 +00:00
Christian Borntraeger
293a0cefd6 wire up 2 vhost ioctls. The kernel does not use any parameter
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13298
2013-03-01 13:17:49 +00:00
Christian Borntraeger
85a4737869 initial tun/tap ioctls.
TUNSETIFF/TUNGETIFF/TUNSETOFFLOAD. See 315952.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13297
2013-03-01 12:56:07 +00:00
Tom Hughes
592e58c747 Don't check the flags word in msghdr for sendmsg as the
kernel will neither read nor write it.

Patch from Mark Wielaard to fix BZ#315441.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13294
2013-02-28 12:50:55 +00:00
Petar Jovanovic
5dd4c02e39 mips: adding MIPS64LE support to Valgrind
Necessary changes to Valgrind to support MIPS64LE on Linux.
Minor cleanup/style changes embedded in the patch as well.
The change corresponds to r2687 in VEX.
Patch written by Dejan Jevtic and Petar Jovanovic.

More information about this issue:
https://bugs.kde.org/show_bug.cgi?id=313267


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13292
2013-02-27 23:17:33 +00:00
Tom Hughes
0d1fe31512 Make msgrcv wrappers on amd64, arm and mips32 look for IPC_NOWAIT in
the flags argument, not the type argument. Fixes #315534.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13289
2013-02-21 10:57:23 +00:00
Bart Van Assche
a367a2d4fe Add support for the Linux ioctl IB_USER_MAD_ENABLE_PKEY
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13287
2013-02-14 17:10:01 +00:00
Florian Krohm
86d64d0227 xen: Add a missing break to the handling of XEN_DOMCTL_max_vcpus
found by Coverity's checker.
Also fix another missing break XEN_SYSCTL_numainfo found by via a
by-eye check. This one is at the end of the switch so it is benign.
Patch by Ian Campbell <ian.campbell@citrix.com>.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13251
2013-01-21 13:46:57 +00:00
Bart Van Assche
bcfbe494bc xen: add a missing break to the handling of XEN_DOMCTL_getdomaininfo
Thanks to Florian Krohm

From: Ian Campbell <Ian.Campbell@citrix.com>


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13244
2013-01-19 13:22:54 +00:00
Florian Krohm
66925ec149 Fix a few compiler warnings on Darwin.
Patch Guy Harris (guy@alum.mit.edu). Part of fixing BZ 312980.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13231
2013-01-15 03:19:54 +00:00
Tom Hughes
e960453f98 Test file mode correctly in vmsplice wrapper.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13229
2013-01-14 22:14:21 +00:00
Julian Seward
36468d9ae2 For sys-openat the dirfd argument should be ignored when the pathname
is absolute.  Fixes #307103.  (Mark Wielaard, mjw@redhat.com)



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13159
2012-12-06 16:05:18 +00:00
Florian Krohm
e7f4d4f57f Fix some casts that removed const-ness as pointed out by
GCC's -Wcast-qual.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13138
2012-11-24 19:41:54 +00:00
Florian Krohm
af66466ce4 Changes to allow compilation with -Wwrite-strings. That compiler option
is not used for testcases, just for valgrind proper.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13137
2012-11-23 16:17:43 +00:00
Julian Seward
6f44cae342 Fix a couple of x86 char-signedness stragglers
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13128
2012-11-19 14:55:15 +00:00
Florian Krohm
c42327c171 One more Char/HChar mixup in conditional code. Reported by Bart.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13127
2012-11-18 22:15:22 +00:00
Florian Krohm
117196ac6d Char/HChar fixups for m_debuginfo and m_gdbserver.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13122
2012-11-15 04:27:04 +00:00
Florian Krohm
d0aa69c331 Fix more Char/HChar mixups. Closing in...
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13119
2012-11-10 22:29:54 +00:00
Christian Borntraeger
bf1836a5d9 add BLKPBSZGET ioctl
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13117
2012-11-09 16:01:38 +00:00
Christian Borntraeger
a4b734a6ac also wire up arm, x86 and amd64 regarding ptrace regsets
original patch from 
Andreas Arnez <arnez AT  linux DOT vnet DOT ibm DOT com>

Seems that ppc and mips dont have ptrace support....



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13113
2012-11-08 20:27:05 +00:00
Christian Borntraeger
4155f1b382 add s390 specific fix for getregset
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13112
2012-11-08 20:10:10 +00:00
Philippe Waroquiers
88d11f08b4 factorise sys_socketcall
sys_socketcall was duplicated in syswrap-{ppc64|ppc32|arm|mips32|s390x}-linux.c
=>
* Similarly for what was done for sys_ipc, factorise the code in syswrap-linux.c
* re-enabled PRE_MEM_READ for VKI_SYS_SENDMSG and VKI_SYS_RECVMSG 
  (PRE_MEM_READ calls were commented out around 2003, for what
   was supposed a glibc bug.
   The PRE_MEM_READ calls were already re-enabled in s390x)
* s390x also had some more checking to verify the addressibility of
  the args and fail the syscall with EFAULT if not addressable
  => same checks are now done for all platforms.

(tested on x86/amd64/mips32/s390x/ppc32/ppc64, 
 compiled for arm-android-emulator)



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13104
2012-11-04 20:40:33 +00:00
Petar Jovanovic
d75506405e Additional refinement in PRE(sys_ipc).
Additional refinement in PRE(sys_ipc) on which arguments to check for the call.
This is still a simplistic check, yet it should resolve additional cases.
One of the resolved cases is memcheck/tests/sem on MIPS.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13084
2012-10-26 16:16:43 +00:00
Philippe Waroquiers
85947ee43b fix 123837 semctl system call: 4rth argument is optional, depending on cmd
Depending on the semctl command (arg3), arg4 might or might not be needed.
The PRE(sys_ipc) multiplexed syscall for semctl was always checking
all 4 args.

The fix consists in dereferencing the 4th arg (which in sys_ipc is ARG5)
only if the semctl syscall cmd implies 4 arguments.
This avoids the false positive on linux x86.

Note that PRE(sys_ipc) is still too simplistic as it assumes
that 6 args are always read, which is not the case.
This seems to cause false positive on mips:
  memcheck on none/tests/sem gives:
     Syscall param ipc(fifth) contains uninitialised byte(s)

It would be nice to implement the multiplexed PRE(sys_ipc) by
calling the PRE(sys_xxxx) similar PRE, depending on ARG1 of sys_ipc.
This would then avoid the simplistic PRE(sys_ipc) logic without duplicating
the logic in PRE(sys_semctl) (and all other sys_ipc multiplexed syscalls).
However, I found no easy way to do that.

With the current fix, some logic about semctl is partially duplicated between
the PRE(sys_ipc) (for platforms such as x86 having a multiplexed sys call)
and PRE(sys_semctl) (for platforms such as amd64, having a direct sys call)
to fix the false positive encountered on x86.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13082
2012-10-23 21:38:52 +00:00
Bart Van Assche
3fd464fbf3 Remove build dependency on Xen header files - closes #308495
From: Ian Campbell <ian.campbell@citrix.com>


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13081
2012-10-23 18:03:28 +00:00
Philippe Waroquiers
e344ae06dd Follow-up to sys_ipc restructuration
Rev 13078 removed a PRE call (for SEMCTL) in the POST(sys_ipc).
This commit adds the correct POST call for SEMCTL in POST(sys_ipc).
(note: some tests are missing in this area, as removing PRE
and adding POST did not cause any test result to change).

This is the last patch to restructure the sys_ipc code.

After this patch, should be able to do the real fix
for 23837 (semctl GETVAL false positive)



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13079
2012-10-21 21:49:33 +00:00
Philippe Waroquiers
78966742aa Follow-up to sys_ipc restructuration
Now that the PRE/POS(sys_ipc) code is not duplicated anymore,
fix two strange things in this code:

* PRE(sys_ipc) : add missing ; after the call PRE_REG_READ6
  (strange that this was compiling without it ???)

* POST(sys_ipc) : it seems there was a copy/paste of
  the  PRE(sys_ipc) code for VKI_SEMCTL.
  Cannot understand why we would need to call again
  deref_Addr and ML_(generic_PRE_sys_semctl) in the POST(sys_ipc).




git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13078
2012-10-21 21:13:39 +00:00
Philippe Waroquiers
b83003a1e0 restructure code for future fixing of 123837 (semctl GETVAL false positive)
Regrouped identical code (except for indentation)
from syswrap-ppc64-linux.c, syswrap-ppc32-linux.c,syswrap-mips32-linux.c
  syswrap-x86-linux.c, syswrap-s390x-linux.c
into
  syswrap-linux.c

(compiled/regtested on x86, amd64, ppc64, mips32, s390x)



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13076
2012-10-21 20:21:17 +00:00
Florian Krohm
79b79d6388 First round of Char/HChar fixups for coregrind and memcheck.
Little bit of ripple in tools, too.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13074
2012-10-21 19:43:43 +00:00
Philippe Waroquiers
0df0a2725c Fix 308644 vgdb command for having the info for the track-fds option
(allows to have the list of opened fds and the associated info
on request from GDB or from the shell, using vgdb)



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13072
2012-10-21 14:37:14 +00:00
Bart Van Assche
109e687afd xen: include arg struct field names when marking memory as read.
Makes it easier to figure out what was not initialised.

Thanks, once again, to Julien Grall.

From: Ian Campbell <ian.campbell@citrix.com>


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13050
2012-10-15 18:46:08 +00:00
Bart Van Assche
af89e2e88a xen: Remove cast of ARG* to unsigned int before pointer conversion.
This is pretty dodgy on 64 bit systems.

Thanks to Julien Grall.

From: Ian Campbell <ian.campbell@citrix.com>


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13049
2012-10-15 18:45:28 +00:00
Bart Van Assche
c38ab89684 xen: adding missing break.
Thanks to Julien Grall.

From: Ian Campbell <ian.campbell@citrix.com>


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13048
2012-10-15 18:44:59 +00:00