281 Commits

Author SHA1 Message Date
Julian Seward
5e5d78dda0 Fix inconsistent use of vki_ prefixes for struct vki_ifreq.
No functional change.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15713
2015-10-19 11:21:33 +00:00
Florian Krohm
c332279b5c Fix up a few comments.
Patch by Jean Delvare <jdelvare@suse.de>.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15657
2015-09-20 13:42:06 +00:00
Florian Krohm
0d5f723bec Followup to r14908 (BZ #342603).
Comparing the command byte with VKI_I2C_SMBUS_QUICK is like comparing
apples to carrots, it makes no sense. The command byte is unused for
quick transactions anyway so checking its value is pointless.
Patch by Jean Delvare <jdelvare@suse.de>.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15656
2015-09-20 13:41:25 +00:00
Florian Krohm
4a999cf4a2 Followup to r14908 (BZ #342603).
The first byte of the data array holds the length, so the actual data
length is the value of that byte plus one.
Patch by Jean Delvare <jdelvare@suse.de>.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15655
2015-09-20 13:40:47 +00:00
Julian Seward
adc2dafee9 Update copyright dates, to include 2015. No functional change.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15577
2015-08-21 11:32:26 +00:00
Julian Seward
e421887527 345338 - TIOCGSERIAL and TIOCSSERIAL ioctl support on Linux
Patch from Martin Ling (martin-kdebugs@earth.li)


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15542
2015-08-14 08:17:37 +00:00
Julian Seward
396f02357d Bug 349034 - Add Lustre ioctls LL_IOC_GROUP_LOCK and LL_IOC_GROUP_UNLOCK
Patch from Frank Zago (fzago@cray.com)


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15541
2015-08-14 08:05:35 +00:00
Julian Seward
a2df7642ef Bug 339563 - The DVB demux DMX_STOP ioctl doesn't have a wrapper.
Patch from mchehab@infradead.org (Mauro Carvalho Chehab).


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15537
2015-08-13 14:53:17 +00:00
Florian Krohm
9a3883bf3d Fix printf format inconsistencies as pointed out by gcc -Wformat-signedness.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15510
2015-08-08 21:45:33 +00:00
Christian Borntraeger
c2baee9b7b add KVM_S390_MEMOP ioctl handling
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15334
2015-06-12 10:54:12 +00:00
Julian Seward
a4d69434b8 Bug 348728 - Fix broken check for VIDIOC_G_ENC_INDEX
Patch from Hans Verkuil (hverkuil@xs4all.nl)


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15314
2015-06-05 11:25:32 +00:00
Julian Seward
eed8fbcd80 Bug 348102 - Patch updating v4l2 API support (edit)
Patch from Hans Verkuil (hverkuil@xs4all.nl) 


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15313
2015-06-05 11:23:35 +00:00
Julian Seward
9dc5a73468 Fix bug 345126: Incorrect handling of VIDIOC_G_AUDIO and G_AUDOUT
Patch from Hans Verkuil (hverkuil@xs4all.nl)


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15276
2015-05-22 10:40:42 +00:00
Tom Hughes
2799d8f88a Add support for the syncfs system call.
Based on patch from j@eckel.me on BZ#347389.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15191
2015-05-07 18:54:31 +00:00
Bart Van Assche
44609129ea Add support for LL_IOC_PATH2FID and LL_IOC_GETPARENT Lustre ioctls
From: Frank Zago <fzago@cray.com>


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15123
2015-04-21 17:46:52 +00:00
Florian Krohm
8d5672dbd6 Remove a few unneeded header files.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15111
2015-04-18 17:45:34 +00:00
Julian Seward
082f9298a1 Add a port to Linux/TileGx. Zhi-Gang Liu (zliu@tilera.com)
Valgrind aspects, to match vex r3124.

See bug 339778 - Linux/TileGx platform support to Valgrind



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15080
2015-04-10 12:30:09 +00:00
Julian Seward
37f7ddaea7 PRE(sys_prctl): handle PR_SET_SECCOMP.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14994
2015-03-10 11:05:10 +00:00
Julian Seward
2ef97db660 POST(sys_ioctl): identify kernel variant "Qualcomm Adreno 3xx" correctly.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14978
2015-03-05 11:22:41 +00:00
Mark Wielaard
5fa9a30cea Bug #344318 socketcall should wrap recvmmsg and sendmmsg
Some architectures, e.g. s390, don't have dedicated recvmmsg and sendmmsg
system calls, but use the socketcall multiplexing system call with
SYS_RECVMMSG or SYS_SENDMMSG (just like the accept4 systemcall can also
be called through socketcall). Create separate helpers for recvmmsg and
sendmmsg helpers that can be used by either the direct syscall or the
socket call.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14964
2015-02-25 14:00:14 +00:00
Julian Seward
199646a9cd Correctly handle prctl(VKI_PR_SET_PTRACER, ..) so as to avoid false
positives (eg when running Wine).


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14946
2015-02-18 15:46:19 +00:00
Julian Seward
fc8c7cbd98 Add wrapper support for I2C_SMBUS ioctls. Patch from
super.firetwister@gmail.com.  Fixes #342603.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14908
2015-02-05 15:52:46 +00:00
Julian Seward
af929fb880 Write proper wrappers for ioctls ION_IOC_ALLOC, ION_IOC_MAP and
ION_IOC_IMPORT, and add a wrapper for SYNC_IOC_MERGE.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14883
2015-01-23 12:00:25 +00:00
Tom Hughes
6504fa50c3 Handle the memfd_create system call.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14875
2015-01-19 21:52:44 +00:00
Florian Krohm
a9aa079113 Change most remaining use of Addr64 in coregrind and the tools to Addr.
Tracking VEX r3056.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14846
2015-01-04 17:20:45 +00:00
Florian Krohm
87dbf329ed Buffer audit. Resize some.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14825
2014-12-20 16:52:08 +00:00
Tom Hughes
b8308dd756 Add support for the getrandom system call. BZ#340788.
Requires r14705 for updated system call lists.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14709
2014-11-10 09:55:59 +00:00
Julian Seward
59b90d186c PRE(sys_openat): when checking whether ARG1 == VKI_AT_FDCWD, be sure
only to check the lowest 32 bits, since that arg is a file descriptor
-- hence "int" -- and checking all 64 bits fails unexpectedly if ARG1
and VKI_AT_FDCWD are not both zero- or sign- extended.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14689
2014-11-04 17:35:04 +00:00
Philippe Waroquiers
80ae5a2395 fix 338995 shmat with hugepages (SHM_HUGETLB) fails with EINVAL
Bug is not really fixed, instead the SHM_HUGETLB flag is ignored.
Note that it is not straightforward to properly fix this,
as this implies either to learn aspacemgr what huge pages are.
Also, the trick used in the fix for 333051 cannot be used easily,
because the SHM_HUGETLB flag is given in shmget, while the mmap
is done in shmat.

So, the easiest is to just ignore the SHM_HUGETLB flag.

SHM_HUGETLB is supposed to only give a performance impact.
Ignoring it should be benign.
Theoretically, the caller might expect a sucessful shmget(SHM_HUGETLB)+shmat
to give pages aligned on e.g. 1MB.
In this case, bad luck, the program will misbehave under valgrind.
To warn of this, a warning is given (once) when SHM_HUGETLB is seen.

The map_unmap.c test has been restructured somewaht to allow
TEST_SHM_HUGETLB to be tested independently (or not) of the TEST_MAP_HUGETLB.

Note also that by default, testing  MAP_HUGETLB and SHM_HUGETLB
is disabled as usually, huge pages are not enabled.




git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14683
2014-11-01 22:00:50 +00:00
Florian Krohm
17fe8c0a09 Add support for ioctl(fd, TIOCSIG, signal_number) which used
to issue a false complaint. Fixes BZ #339706
Source patch by David Herrmann (dh.herrmann@gmail.com).
Testcase by myself.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14646
2014-10-21 07:20:20 +00:00
Christian Borntraeger
3b8b96e924 implement KVM_KVMCLOCK_CTRL. Interestingly, the kernel does not check
the parameter. QEMU does pass 0 nevertheless as parameter.

bugzilla:  [Bug 339424] Full support of KVM ioctl


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14569
2014-09-26 18:44:40 +00:00
Christian Borntraeger
0b5642095e provide ioctl handlers for KVM_SET_TSS_ADDR.
part of bugzilla 339424


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14568
2014-09-26 12:25:02 +00:00
Florian Krohm
3b95ad549a Use wrapper functions VG_(malloc) and friends consistently across the
board (instead of e.g. VG_(arena_malloc)(VG_AR_CORE,...). This change
also benefits static analysers. We can tell tools that VG_(malloc) allocates
and VG_(free) deallocates and that they are a pair. But we cannot do that for 
arena_malloc/free.
Also provide a wrapper VG_(realloc_shrink).


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14517
2014-09-11 21:19:17 +00:00
Julian Seward
af2f0eb3ab Add support for sys_pivot_root and sys_unshare. Patch from
Steven Stewart-Gallus <sstewartgallus00@mylangara.bc.ca>.
n-i-bz (patch on dev@, 27 Aug 2014)



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14494
2014-09-08 11:19:48 +00:00
Julian Seward
50618eb024 Improved argument checking for sys_kcmp. Derived from patch from
Christian Borntraeger.  Followup to r14451.  Pertains to #338106.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14473
2014-09-05 21:11:18 +00:00
Julian Seward
775ae0473b Patch adding support for V4L2/media ioctls. Patch from Hans Verkuil
(hverkuil@xs4all.nl).  Fixes #338023.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14455
2014-09-04 11:08:45 +00:00
Julian Seward
29797aa4c0 Add Xen 4.4 evtchn ioctl wrappers. Patch from Antony Saba
(antony.saba@fireeye.com).  Second of two patches from #337740.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14454
2014-09-04 11:02:24 +00:00
Julian Seward
8f579dba61 Add support for sys_kcmp. Patch from Chris Jones
(cjones.bugs@gmail.com).  Fixes #338106.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14451
2014-09-04 10:17:08 +00:00
Julian Seward
7e3f04874a Improvements for Android:
* All Linux targets: add minimal ioctl support for the ION_IOC family

* Android targets: change proprietary-ioctl support for GPUs from
  being a build-time #define kludge to being controlled by --kernel-variant,
  as it should be.  Update documentation accordingly.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14440
2014-09-03 15:19:25 +00:00
Tom Hughes
612c18619d Add support for some more tun/tap ioctls. BZ#315952.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14432
2014-09-02 12:54:29 +00:00
Mark Wielaard
e12b5e5ac2 Fix typo in syswrap ppoll param, equate ppoll and poll for memcheck testcase.
ppoll argument is called ufds like the poll argument.
Newer architectures (aarch64) implement poll by calling ppoll directly.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14370
2014-08-26 22:15:58 +00:00
Carl Love
914f75de32 This commit is for Bugzilla 334384. The Bugzilla contains patch 1 of 3
to add PPC64 LE support.  The other two patches can be found in Bugzillas
334834 and 334836.  The commit does not have a VEX commit associated with it.

POWER PC, add initial Little Endian support

The IBM POWER processor now supports both Big Endian and Little Endian.
This patch renames the #defines with the name ppc64 to ppc64be for the BE
specific code.  This patch adds the Little Endian #define ppc64le to the

Additionally, a few functions are renamed to remove BE from the name if the
function is used by BE and LE. Functions that are BE specific have BE put
in the name.

The goals of this patch is to make sure #defines, function names and
variables consistently use PPC64/ppc64 if it refers to BE and LE,
PPC64BE/ppc64be if it is specific to BE, PPC64LE/ppc64le if it is LE
specific.  The patch does not break the code for PPC64 Big Endian.

The test files memcheck/tests/atomic_incs.c, tests/power_insn_available.c
and tests/power_insn_available.c are also updated to the new #define
definition for PPC64 BE.

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


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14238
2014-08-07 23:17:29 +00:00
Christian Borntraeger
00a31dd3d1 add support for VKI_BLKDISCARDZEROES
this is used in some newer QEMU versions and other tools


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14235
2014-08-05 15:14:52 +00:00
Bart Van Assche
e7777bc867 Linux: Add support for Lustre FID2PATH ioctl (#331829)
This is a modified version of a patch provided by Frank Zago (fzago@cray.com).


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14233
2014-08-05 12:01:26 +00:00
Bart Van Assche
f47a931b8c Linux system call wrappers: truncate ioctl request number to 32 bits
As explained in https://bugs.kde.org/show_bug.cgi?id=331829, when passing
an ioctl request number as an int to a function the request number will
be sign-extended to 64 bits on 64-bit systems. Avoid that this causes
Valgrind to fail to recognize an ioctl by truncating the request number
to 32 bits.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14232
2014-08-05 11:35:48 +00:00
Tom Hughes
90f471b945 Move DRM ioctl handlers to the right places. Fixes r13486 breakage.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14151
2014-07-10 14:56:48 +00:00
Tom Hughes
ceb1ad640a Add support for the F_OFD_SETLK, F_OFD_SETLKW, and F_OFD_GETLK fcntl
commands. BZ#337285.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14150
2014-07-10 14:50:06 +00:00
Tom Hughes
82ec0b5d43 Add support for the F_OFD_SETLK, F_OFD_SETLKW, and F_OFD_GETLK fcntl
commands. BZ#337285.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14149
2014-07-10 14:48:00 +00:00
Tom Hughes
94b049ff1d Add support for various SIOCETHTOOL operations. BZ#303536.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14114
2014-06-27 09:59:52 +00:00
Tom Hughes
13c65e031d Add SIOCATMARK ioctl support.
Patch from Austin English via BZ#335441.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14112
2014-06-26 13:14:56 +00:00