Commit Graph

1057 Commits

Author SHA1 Message Date
Mark Wielaard
c33888cd76 aarch64: enable kcmp syscall (generic wrapper)
Patch by Marcin Juszkiewicz <marcin.juszkiewicz@linaro.org>

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16245
2017-02-18 21:16:02 +00:00
Mark Wielaard
83530aa5cb aarch64: enable clock_adjtime syscall (generic wrapper)
Patch by Marcin Juszkiewicz <marcin.juszkiewicz@linaro.org>

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16244
2017-02-18 21:16:01 +00:00
Mark Wielaard
cb5c2db67d aarch64: enable fanotify_mark syscall (generic wrapper)
Patch by Marcin Juszkiewicz <marcin.juszkiewicz@linaro.org>

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16243
2017-02-18 21:16:00 +00:00
Mark Wielaard
a0c40043fd aarch64: enable fanotify_init syscall (generic wrapper)
Patch by Marcin Juszkiewicz <marcin.juszkiewicz@linaro.org>

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16242
2017-02-18 21:16:00 +00:00
Mark Wielaard
cbc35e55e3 aarch64: enable rt_tgsigqueueinfo syscall (generic wrapper)
Patch by Marcin Juszkiewicz <marcin.juszkiewicz@linaro.org>

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16241
2017-02-18 21:15:59 +00:00
Mark Wielaard
2bb11a32ac aarch64: enable move_pages syscall (generic wrapper)
Patch by Marcin Juszkiewicz <marcin.juszkiewicz@linaro.org>

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16240
2017-02-18 21:15:58 +00:00
Mark Wielaard
67c85b2cc8 aarch64: enable request_key syscall (generic wrapper)
Patch by Marcin Juszkiewicz <marcin.juszkiewicz@linaro.org>

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16239
2017-02-18 21:15:57 +00:00
Mark Wielaard
c4ce4f8099 aarch64: enable tkill syscall (generic wrapper)
Patch by Marcin Juszkiewicz <marcin.juszkiewicz@linaro.org>

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16238
2017-02-18 21:15:56 +00:00
Mark Wielaard
b49d8c0666 aarch64: enable sched_rr_get_interval syscall (generic wrapper)
Patch by Marcin Juszkiewicz <marcin.juszkiewicz@linaro.org>

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16237
2017-02-18 21:15:55 +00:00
Mark Wielaard
3729c265d0 aarch64: enable delete_module syscall (generic wrapper)
Patch by Marcin Juszkiewicz <marcin.juszkiewicz@linaro.org>

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16236
2017-02-18 21:15:54 +00:00
Mark Wielaard
2d6a711e16 aarch64: enable get_robust_list syscall (generic wrapper)
Patch by Marcin Juszkiewicz <marcin.juszkiewicz@linaro.org>

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16235
2017-02-18 21:15:53 +00:00
Mark Wielaard
ce78c07359 aarch64: enable unshare syscall (generic wrapper)
Patch by Marcin Juszkiewicz <marcin.juszkiewicz@linaro.org>

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16234
2017-02-18 21:15:53 +00:00
Mark Wielaard
c97d53db3a aarch64: enable sync_file_range syscall (generic wrapper)
Patch by Marcin Juszkiewicz <marcin.juszkiewicz@linaro.org>

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16233
2017-02-18 21:15:52 +00:00
Mark Wielaard
1dbcb195da aarch64: enable pivot_root syscall (generic wrapper)
Patch by Marcin Juszkiewicz <marcin.juszkiewicz@linaro.org>

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16232
2017-02-18 21:15:51 +00:00
Mark Wielaard
dc1e28e958 aarch64: remove bogus syscall part
Patch by Marcin Juszkiewicz <marcin.juszkiewicz@linaro.org>

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16231
2017-02-18 21:15:50 +00:00
Mark Wielaard
58b58f73e4 aarch64: add missing syscalls into table
All entries are added disabled - enabling them will be done later.

Patch by Marcin Juszkiewicz <marcin.juszkiewicz@linaro.org>

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16230
2017-02-18 21:15:49 +00:00
Mark Wielaard
83a0887f9a fix order of timer_* syscalls on aarch64 - bug #371225
Signed-off-by: Marcin Juszkiewicz <marcin.juszkiewicz@linaro.org>

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16229
2017-02-18 21:15:48 +00:00
Mark Wielaard
8a63a637d8 Bug 376611 - ppc64 and arm64 don't know about prlimit64 syscall.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16228
2017-02-18 13:20:16 +00:00
Ivo Raisr
804686fc2c Solaris: Add syscall wrapper for fast trap getlgrp(6)
Fixes BZ#376518.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16227
2017-02-16 18:29:46 +00:00
Ivo Raisr
72a8b52a60 Solaris: Add additional subcodes for lgrpsys(180) syscall
Fixes BZ#376455.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16225
2017-02-14 12:38:06 +00:00
Ivo Raisr
0f667376e6 Solaris: Add syscall wrapper for lgrpsys(180)
Fixes BZ#376455.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16224
2017-02-14 10:35:20 +00:00
Petar Jovanovic
795ee051e6 mips32: add support for ptrace syscall
Add wrapers for ptrace syscall for mips32.

Patch by Aleksandra Karadzic.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16211
2017-01-27 17:01:49 +00:00
Julian Seward
f9e2cc163f x86-linux: Initialize x86 system GDT on first use. Bug 344139 comment 3.
Patch from Sebastian Lackner, sebastian@fds-team.de.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16204
2017-01-20 09:58:15 +00:00
Ivo Raisr
db21c24191 Fix a bug when --log-file output isn't split when a program forks.
Patch loosely based on idea by Timur Iskhodzhanov <timurrrr@google.com>.
Fixes BZ#162848


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16200
2017-01-12 11:28:20 +00:00
Petar Jovanovic
98d36af988 mips: remove some old cruft from clone functions
Follow up to r16186 when this cruft was noticed.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16188
2016-12-16 18:31:57 +00:00
Philippe Waroquiers
489cfd5156 Fix 342040 Valgrind mishandles clone with CLONE_VFORK | CLONE_VM that clones to a different stack
Fix 373192 Calling posix_spawn in glibc 2.24 completely broken

Functionally, this patch just does the following 2 changes to the
fork clone handling:
* It does not mask anymore CLONE_VFORK :
  The only effect of this flag is to suspend the parent, waiting for
  the child to either exit or execve.
  If some applications depends on this synchronisation, better keep it,
  as it will not harm to suspend the parent valgrind waiting for the
  child valgrind to exit or execve.
* In case the guest calls the clone syscall providing a non zero client stack,
  set the child guest SP after the syscall, before executing guest instructions.
  Not setting the guest stack ptr was the source of the problem reported
  in the bugs.

This also adds a test case  none/tests/linux/clonev.
Before this patch, test gives a SEGV, which is fixed by the patch.

The patch is however a lot bigger : this fix was touching some (mostly
identical/duplicated) code in all the linux platforms.
So, the clone/fork code has been factorised as much as possible.
This removes about 1700 lines of code.

This has been tested on:
* amd64
* x86
* ppc64 be and le
* ppc32
* arm64

This has been compiled on but *not really tested* on:
* mips64 (not too clear how to properly build and run valgrind on gcc22)

It has *not* been compiled and *not* tested on:
* arm
* mips32
* tilegx
* darwin   (normally, no impact)
* solaris  (normally, no impact)

The changes are relatively mechanical, so it is not impossible that
it will compile and work out of the box on these platforms.
Otherwise, questions welcome.

A few points of interest:
* Some platforms did have a typedef void vki_modify_ldt_t,
  and some platforms had no definition for this type at all.
  To make it easier to factorise, for such platforms, the following has
  been used:
     typedef char vki_modify_ldt_t;
    When the sizeof vki_modify_ldt_t is > 1, then the arg syscall is checked.
  This is somewhat a hack, but was simplifying the factorisation.

* for mips32/mips64 and tilegx, there is a strange unconditional assignment
  of 0 to a register (guest_r2 on mips, guest_r0 on tilegx).
  Unclear what this is, in particular because this is assigned whatever
  the result of the syscall (success or not).
  



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16186
2016-12-11 21:39:23 +00:00
Rhys Kidd
db0a061667 Add placeholders for all new OS X 10.11 syscalls. Related to bz#348909.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16185
2016-12-11 08:07:21 +00:00
Rhys Kidd
766afc937e Add placeholders for all new macOS 10.12 syscalls. Related to bz#365327.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16184
2016-12-11 07:17:43 +00:00
Rhys Kidd
f3bc22d097 Fix typo in syswrap-darwin log output. n-i-bz.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16169
2016-12-04 03:50:33 +00:00
Rhys Kidd
386749fe29 Fix 373046 - Stacks registered by core are never deregistered (macOS-specific follow-up). Refer r16159.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16168
2016-12-04 03:43:29 +00:00
Petar Jovanovic
7746f34db7 mips: fix call_on_new_stack_0_1 code
MIPS32 implementation missed to set up a correct (zero) return address.
This led to incorrect execution of get_StackTrace_wrk as it was not
able to unwind stack correctly.
This change fixes memcheck/tests/leak-autofreepool-5.

MIPS64 implementation missed clearing all integer registers before
entering the function.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16166
2016-12-01 16:01:45 +00:00
Petar Jovanovic
dee49c2144 mips64: fix fadvise64 syscall wrappers
Use platform specific pre-wrapper for fadvise64 system call and respect
size of parameters, instead of using generic wrapper written for 32bit
architectures.

Issue reported by Marcin Juszkiewicz.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16163
2016-11-29 14:57:51 +00:00
Petar Jovanovic
9a6096841e mips32: fix fadvise64 system call
For fadvise64 system call, 7th 32-bit argument slot (third on the stack)
will also be used due to MIPS O32 calling convention in passing 64-bit
values.

sys_fadvise64(int fd, loff_t offset, loff_t len, int advice);

NR_fadvise64 -> v0               (sysno)
fd           -> a0               (ARG1)
offset       -> a2, a3           (ARG3, ARG4)
len          -> SP + 16, SP + 20 (ARG5, ARG6)
advise       -> SP + 24          (ARG7)

Change the code according to it.

Patch by Aleksandar Rikalo.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16162
2016-11-29 14:27:25 +00:00
Ivo Raisr
adb196abf3 Fix compiler warning on Solaris.
n-i-bz


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16161
2016-11-28 22:14:58 +00:00
Ivo Raisr
02a02e7bf9 Use NULL_STK_ID consistently throughout whole Valgrind.
Follow up to SVN r16159, BZ#373046. 


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16160
2016-11-28 21:41:28 +00:00
Philippe Waroquiers
260f165999 Fix 373046 - Stacks registered by core are never deregistered
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16159
2016-11-28 19:34:06 +00:00
Julian Seward
cad347059e Bug 348616 - Wine/valgrind: Warning: noted but unhandled ioctl 0x5390
with no size/direction hints. (DVD_READ_STRUCT)

Patch from Austin English (austinenglish@gmail.com).



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16153
2016-11-23 13:26:23 +00:00
Julian Seward
15f0421b15 Bug 352767 - Wine/valgrind: Warning: noted but unhandled ioctl 0x5307
with no size/direction hints. (CDROMSTOP).

Patch from Austin English (austinenglish@gmail.com).


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16152
2016-11-23 13:15:22 +00:00
Ivo Raisr
8f6ff4a27b Solaris: Add syscall wrapper for sigsendsys(108)
n-i-bz


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16145
2016-11-20 05:19:02 +00:00
Ivo Raisr
8e08fc91ec Solaris: Add syscall wrapper for sigsuspend(95)
n-i-bz


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16144
2016-11-20 00:20:34 +00:00
Philippe Waroquiers
d208bc934b Fix 372504 Hanging on exit_group
Note that it is unclear if the PRE syscall for rt_sigsuspend
is properly setting up a temporary mask in the thread state
tmp_sig_mask:  if an handler is called while a thread is
calling sigsuspend, the mask during the handler run must be
the temporary mask set by sigsuspend.
It is not clear if/where the valgrind sigframe builder/handler
sets the tmp_sig_mask to the value as expected by the user
(i.e. the value of the temporary mask which was given to
the sigsuspend syscall)



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16141
2016-11-19 14:54:44 +00:00
Rhys Kidd
ccc8f80b4f Fix compile error on macOS introduced in r16111. n-i-bz.
m_syswrap/syswrap-generic.c:4148:26: error: use of undeclared identifier 'PID_EXEPATH'
      VG_(sprintf)(name, PID_EXEPATH, VG_(getpid)());
                         ^
m_syswrap/syswrap-generic.c:4150:56: error: use of undeclared identifier 'SELF_EXEPATH'
          && (VG_STREQ(arg1s, name) || VG_STREQ(arg1s, SELF_EXEPATH))) {
                                                       ^
m_syswrap/syswrap-generic.c:4150:56: error: use of undeclared identifier 'SELF_EXEPATH'
m_syswrap/syswrap-generic.c:4151:29: error: use of undeclared identifier 'SELF_EXEFD'
         VG_(sprintf)(name, SELF_EXEFD, VG_(cl_exec_fd));
                            ^

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16116
2016-11-04 03:43:28 +00:00
Philippe Waroquiers
46f6a5f92d Some small optimisation+some code reformatting
* Use stack arrays instead of malloc/free
* ensure  msghdr_foreachfield does one single call to foreach_func
  for consecutive fields
* some small code reformatting or factorisation

Tested on linux, hoping it also works on solaris



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16111
2016-11-02 20:59:51 +00:00
Petar Jovanovic
5fba00cd1f mips: add POST function to sys_prctl
Add missing POST wrapper for sys_prctl.
This fixes regressions from r15934 (on MIPS32 platforms) and r16003
(on MIPS64 platforms).

Related test: memcheck/tests/threadname


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16110
2016-11-01 18:28:26 +00:00
Philippe Waroquiers
54a1e7856d 371412 Rename wrap_sys_shmat to sys_shmat like other wrappers
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16109
2016-11-01 15:00:45 +00:00
Ivo Raisr
a32762d529 Solaris: Add wrapper for fcntl(F_DUPFD_CLOEXEC)
n-i-bz



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16105
2016-10-25 04:55:35 +00:00
Julian Seward
71b25c5da3 Add support for Linux perf-events ioctls. Fixes #368419.
Patch from Keno Fischer (keno@juliacomputing.com).


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16077
2016-10-19 16:08:25 +00:00
Julian Seward
33b32326e0 Bug 368120 - x86_linux asm _start functions do not keep 16-byte
aligned stack pointer.  Patch from chh@google.com.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16075
2016-10-19 06:00:32 +00:00
Julian Seward
01492a3544 Fix run_a_thread_NORETURN assembly code typo for VGP_arm64_linux target.
Fixes #368823.  Patch from chh@google.com.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16074
2016-10-18 17:31:53 +00:00
Petar Jovanovic
6e45ce45ac mips32: add pselect6 to the list of supported syscalls
Add pselect6 to the list of supported syscalls on MIPS32.
It fixes:

none/tests/pselect_alarm                 (stderr)
none/tests/pselect_sigmask_null          (stderr)

on mips32 platforms.

Patch by Aleksandra Karadzic.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16031
2016-10-07 17:04:33 +00:00