190 Commits

Author SHA1 Message Date
Earl Chew
d387566dd7 Support Linux syscall 434 pidfd_open 2023-04-14 23:06:48 +02:00
Paul Floyd
2c93baf53a Bug 433873 - openat2 syscall unimplemented on Linux
This syscall is not exposed via glibc, so there is only an
addition to the scalar test.
2023-01-06 21:27:01 +01:00
Di Chen
fca4a3d8e5 Support new memfd_secret linux syscall (447)
memfd_secret is a new syscall in linux 5.14. memfd_secret() is
disabled by default and a command-line option needs to be added to
enable it at boot time.

$ cat /proc/cmdline
[...] secretmem.enable=y

https://bugs.kde.org/451878
https://lwn.net/Articles/865256/
2022-04-19 11:59:36 +02:00
Mark Wielaard
1024237358 Implement linux rseq syscall as ENOSYS
This implements rseq for amd64, arm, arm64, ppc32, ppc64,
s390x and x86 linux as ENOSYS (without warning).

glibc will start using rseq to accelerate sched_getcpu, if
available. This would cause a warning from valgrind every
time a new thread is started.

Real rseq (restartable sequences) support is pretty hard, so
for now just explicitly return ENOSYS (just like we do for clone3).

https://sourceware.org/pipermail/libc-alpha/2021-December/133656.html
2021-12-15 12:15:06 +01:00
Lubomir Rintel
a21e890f82 Add close_range(2) support
This is a system call introduced in Linux 5.9.

It's typically used to bulk-close file descriptors that a process inherited
without having desired so and doesn't want to pass them to its offspring
for security reasons. For this reason the sensible upper limit value tends
to be unknown and the users prefer to stay on the safe side by setting it
high.

This is a bit peculiar because, if unfiltered, the syscall could end up
closing descriptors Valgrind uses for its purposes, ending in no end of
mayhem and suffering.

This patch adjusts the upper bounds to a safe value and then skips over
the descriptor Valgrind uses by potentially calling the real system call
with sub-ranges that are safe to close.

The call can fail on negative ranges and bad flags -- we're dealing with
the first condition ourselves while letting the real call fail on bad
flags.

https://bugs.kde.org/show_bug.cgi?id=439090
2021-10-12 22:58:45 +02:00
Mark Wielaard
9aa51a6e25 Hook up acct syscall for amd64, mips32, ppc32 and ppc64
There was already a generic linux wrapper for acct, but it was not
hooked up for all linux arches.
2021-10-04 11:34:08 +02:00
Mark Wielaard
52ed51fc35 Generate a ENOSYS (sys_ni_syscall) for clone3 on all linux arches
glibc 2.34 will try to use clone3 first before falling back to
the clone syscall. So implement clone3 as sys_ni_syscall which
simply return ENOSYS without producing a warning.

https://bugs.kde.org/show_bug.cgi?id=439590
2021-07-21 19:53:21 +02:00
Mark Wielaard
fe4b349df3 Support new faccessat2 linux syscall (439)
faccessat2 is a new syscall in linux 5.8 and will be used by glibc 2.33.
faccessat2 is simply faccessat with a new flag argument. It has
a common number across all linux arches.

https://bugs.kde.org/427787
2020-10-16 02:55:06 +02:00
Mark Wielaard
6323fd5bfd Handle linux syscalls sched_getattr and sched_setattr
The only "special" thing about these syscalls is that the given
struct sched_attr determines its own size for future expansion.

Original fix by "ISHIKAWA,chiaki" <ishikawa@yk.rim.or.jp>

https://bugs.kde.org/show_bug.cgi?id=369029
2020-08-01 15:34:48 +02:00
Alexandra Hájková
6f6ff49ffa Add support for execveat syscall
Refactor the code to be reusable between execve and
execveat syscalls.

https://bugs.kde.org/show_bug.cgi?id=345077
2020-06-08 20:58:09 +02:00
Michal Privoznik
60a7ebedc0 Add support for setns syscall
I've tested this on amd64 and arm but I'm enabling it on all
arches since the syscall should work identically on all of them.

This was requested by users for a long time (almost 5 years) and
in fact, some programs (like libvirt) use namespaces and fork off
to enter other namespaces. Lack of implementation means valgrind
can't be used with these programs (or their configuration must be
changed to not use namespaces, which defeats the purpose).

Without knowing it, I've converged to same patch as mentioned in
bugs below.

https://bugs.kde.org/show_bug.cgi?id=343099
https://bugs.kde.org/show_bug.cgi?id=368923
https://bugs.kde.org/show_bug.cgi?id=369031

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
2020-04-28 17:36:20 +02:00
Alexandra Hájková
b0861063a8 Add support for preadv2 and pwritev2 syscalls
Support for amd64, x86 - 64 and 32 bit, arm64, ppc64, ppc64le,
s390x, mips64. This should work identically on all
arches, tested on x86 32bit and 64bit one, but enabled on all.

Refactor the code to be reusable between old/new syscalls. Resolve TODO
items in the code. Add the testcase for the preadv2/pwritev2 and also
add the (similar) testcase for the older preadv/pwritev syscalls.

Trying to test handling an uninitialized flag argument for the v2 syscalls
does not work because the flag always comes out as defined zero.
Turns out glibc does this deliberately on 64bit architectures because
the kernel does actually have a low_offset and high_offset argument, but
ignores the high_offset/assumes it is zero.
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=601cc11d054ae4b5e9b5babec3d8e4667a2cb9b5

https://bugs.kde.org/408414
2019-07-03 00:19:16 +02:00
Bart Van Assche
97fa86915e Add support for the Linux io_uring system calls
Man pages and test code are available in the following git repository:

http://git.kernel.dk/cgit/liburing/
2019-07-01 19:27:23 -07:00
Mark Wielaard
e00335bd38 linux x86 and amd64 memory protection key syscalls.
This implements minimal support for the pkey_alloc, pkey_free and
pkey_mprotect syscalls. pkey_alloc will simply indicate that pkeys
are not supported. pkey_free always fails. pkey_mprotect works just
like mprotect if the special pkey -1 is provided.

https://bugs.kde.org/show_bug.cgi?id=408091
2019-06-06 18:18:47 +02:00
Mark Wielaard
461cc5c003 Cleanup GPL header address notices by using http://www.gnu.org/licenses/
Sync VEX/LICENSE.GPL with top-level COPYING file. We used 3 different
addresses for writing to the FSF to receive a copy of the GPL. Replace
all different variants with an URL <http://www.gnu.org/licenses/>.

The following files might still have some slightly different (L)GPL
copyright notice because they were derived from other programs:

- files under coregrind/m_demangle which come from libiberty:
  cplus-dem.c, d-demangle.c, demangle.h, rust-demangle.c,
  safe-ctype.c and safe-ctype.h
- coregrind/m_demangle/dyn-string.[hc] derived from GCC.
- coregrind/m_demangle/ansidecl.h derived from glibc.
- VEX files for FMA detived from glibc:
  host_generic_maddf.h and host_generic_maddf.c
- files under coregrin/m_debuginfo derived from LZO:
  lzoconf.h, lzodefs.h, minilzo-inl.c and minilzo.h
- files under coregrind/m_gdbserver detived from GDB:
  gdb/signals.h, inferiors.c, regcache.c, regcache.h,
  regdef.h, remote-utils.c, server.c, server.h, signals.c,
  target.c, target.h and utils.c

Plus the following test files:

- none/tests/ppc32/testVMX.c derived from testVMX.
- ppc tests derived from QEMU: jm-insns.c, ppc64_helpers.h
  and test_isa_3_0.c
- tests derived from bzip2 (with embedded GPL text in code):
  hackedbz2.c, origin5-bz2.c, varinfo6.c
- tests detived from glibc: str_tester.c, pth_atfork1.c
- test detived from GCC libgomp: tc17_sembar.c
- performance tests derived from bzip2 or tinycc (with embedded GPL
  text in code): bz2.c, test_input_for_tinycc.c and tinycc.c
2019-05-26 20:07:51 +02:00
Alexandra Hajkova
5f00db054a Add support for the copy_file_range syscall
Support amd64, x86, arm64, ppc64, ppc32 and s390x architectures.
Also add sys-copy_file_range test case.
2019-05-05 15:27:13 +02:00
Philippe Waroquiers
d7d8231750 Fix false positive 'Conditional jump or move' on amd64 64 bits ptracing 32 bits.
PTRACE_GET_THREAD_AREA is not handled by amd64 linux syswrap, which leads
to false positive errors in 64 bits program ptrace-ing 32 bits processes.

For example, the below error was wrongly reported on GDB:
==25377== Conditional jump or move depends on uninitialised value(s)
==25377==    at 0x8A1D7EC: td_thr_get_info (td_thr_get_info.c:35)
==25377==    by 0x526819: thread_from_lwp(thread_info*, ptid_t) (linux-thread-db.c:417)
==25377==    by 0x5281D4: thread_db_notice_clone(ptid_t, ptid_t) (linux-thread-db.c:442)
==25377==    by 0x51773B: linux_handle_extended_wait(lwp_info*, int) (linux-nat.c:2027)
....
==25377==  Uninitialised value was created by a stack allocation
==25377==    at 0x69A360: x86_linux_get_thread_area(int, void*, unsigned int*) (x86-linux-nat.c:278)

Fix this by implementing PTRACE_GET|SET_THREAD_AREA on amd64.
2019-01-12 15:35:59 +01:00
Quentin Monnet
1d933b5a4a Add support for bpf system call
Fixes: 388786 - Support bpf syscall in amd64 Linux

Add support for bpf() Linux-specific system call on amd64 platform. The
bpf() syscall is used to handle eBPF objects (programs and maps), and
can be used for a number of operations. It takes three arguments:

- "cmd" is an integer encoding a subcommand to run. Available subcommand
  include loading a new program, creating a map or updating its entries,
  retrieving information about an eBPF object, and may others.
- "attr" is a pointer to an object of type union bpf_attr. This object
  converts to a struct related to selected subcommand, and embeds the
  various parameters used with this subcommand. Some of those parameters
  are read by the kernel (example for an eBPF map lookup: the key of the
  entry to lookup), others are written into (the value retrieved from
  the map lookup).
- "attr_size" is the size of the object pointed by "attr".

Since the action performed by the kernel, and the way "attr" attributes
are processed depends on the subcommand in use, the PRE() and POST()
wrappers need to make the distinction as well. For each subcommand, mark
the attributes that are read or written.

For some map operations, the only way to infer the size of the memory
areas used for read or write operations seems to involve reading
from /proc/<pid>/fdinfo/<fd> in order to retrieve the size of keys
and values for this map.

The definitions of union bpf_attr and of other eBPF-related elements
required for adequately performing the checks were added to the Linux
header file.

Processing related to file descriptors is added in a follow-up patch.
2018-08-14 20:47:19 +01:00
Philippe Waroquiers
8bc2b6fd26 Fix 392118 - unhandled amd64-linux syscall: 332 (statx)
Code patch provided by Mattias Andrée

Added a regression test to (somewhat) test stat and statx.

Tested on amd64 only.
2018-08-11 15:56:56 +02:00
Mark Wielaard
21a01b13e2 Bug 396887 - arch_prctl should return EINVAL on unknown option.
Currently arch_prctl calls VG_(core_panic) when it sees an unknown
arch_prctl option which kills the process. glibc uses arch_prctl with
an (as yet) unknown option to see if the kernel supports CET. This
breaks any application running under valgrind on x86_64 with:

valgrind: the 'impossible' happened:
   Unsupported arch_prctl option

Thread 1: status = VgTs_Runnable (lwpid 19934)
==19934==    at 0x121A15: get_cet_status (cpu-features.c:28)
==19934==    by 0x121A15: init_cpu_features (cpu-features.c:474)
==19934==    by 0x121A15: dl_platform_init (dl-machine.h:228)
==19934==    by 0x121A15: _dl_sysdep_start (dl-sysdep.c:231)
==19934==    by 0x10A1D7: _dl_start_final (rtld.c:413)
==19934==    by 0x10A1D7: _dl_start (rtld.c:520)

We already handle all known options. It would be better to do as the
kernel does and just return failure with EINVAL instead.
2018-07-30 12:20:16 +02:00
Bart Van Assche
959a54cb3a Add support for the Linux membarrier() system call
Signed-off-by: Bart Van Assche <bart.vanassche@wdc.com>
2018-06-15 08:25:28 -07:00
Julian Seward
20b6c5f506 Bug 379966 - WARNING: unhandled amd64-linux syscall: 313 (finit_module).
Patch from Bartosz Golaszewski (bartekgola@gmail.com).


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16403
2017-05-22 07:53:04 +00:00
Ivo Raisr
38edd50c0e Update copyright end year to 2017 in preparation for 3.13 release.
n-i-bz



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16333
2017-05-04 15:09:39 +00:00
Petar Jovanovic
30717ab5a2 Add support for syscall ptrace(traceme)
It fixes Bug 377376.

Patch by Aleksandra Karadzic.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16273
2017-03-15 15:23:27 +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
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
Mark Wielaard
6b8c5dfb75 Bug 363680 add renameat2() support
Patch written by Jann Horn <jannhorn@googlemail.com>.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15889
2016-05-31 12:16:15 +00:00
Ivo Raisr
912bede3dd Sanitize signal mask in ppoll and pselect syscalls
Reported and Linux patch contributed by Steven Smith <sos22@archy.org.uk>
Fixes BZ#359871



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15823
2016-03-08 09:04:48 +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
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
Florian Krohm
7a474c9455 Fix typos in source code. Patch by Dmitriy (olshevskiy87@bk.ru).
Fixes BZ #349874


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15394
2015-07-05 21:53:33 +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
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
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
Philippe Waroquiers
70a8ef051c Fix 197259 Unsupported arch_prtctl PR_SET_GS option
(valgrind side).
In summary: we were counting somewhat on the luck for FS,
we now similarly count on luch for GS
See VEX commit log r3043 for more details.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14815
2014-12-17 00:00:11 +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
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
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
Philippe Waroquiers
51c6c85e22 The semantic of the stack bounds is not consistent or is not described.
At various places, there were either some assumption that the 'end'
boundary (highest address) was either not included, included,
or was the highest addressable word, or the highest addressable byte.
This e.g. was very visible when doing:
  ./vg-in-place -d -d ./helgrind/tests/tc01_simple_race|&grep regi
giving
  --24040:2:stacks     register 0xBEDB4000-0xBEDB4FFF as stack 0
  --24040:2:stacks     register 0x402C000-0x4A2C000 as stack 1
showing that the main stack end was (on x86) not the highest word
but the highest byte, while for the thread 1, the registered end
was a byte not part of the stack.

The attached patch ensures that stack bounds semantic are documented and
consistent. Also, some of the stack handling code is factorised.

The convention that the patch ensures and documents is:
start is the lowest addressable byte, end is the highest addressable byte.
(the words 'min' and 'max' have been kept when already used, as this wording is 
consistent with the new semantic of start/end).

In various debug log, used brackets [ and ] to make clear that
both bounds are included.

The code to guess and register the client stack was duplicated
in all the platform specific syswrap-<plat>-<os>.c files.
Code has been factorised in syswrap-generic.c

The patch has been regression tested on
   x86, amd64, ppc32/64, s390x.
It has been compiled and one test run on arm64.
Not compiled/not tested on darwin, android, mips32/64, arm


More in details, the patch does the following:

coregrind/pub_core_aspacemgr.h
include/valgrind.h
include/pub_tool_machine.h
coregrind/pub_core_scheduler.h
coregrind/pub_core_stacks.h
  - document start/end semantic in various functions
 also in pub_tool_machine.h:
  - replaces unclear 'bottommost address' by 'lowest address'
    (unclear as stack bottom is or at least can be interpreted as
     the 'functional' bottom of the stack, which is the highest
      address for 'stack growing downwards').
coregrind/pub_core_initimg.h
  replace unclear clstack_top by clstack_end
coregrind/m_main.c
  updated to clstack_end

coregrind/pub_core_threadstate.h
  renamed client_stack_highest_word to client_stack_highest_byte
coregrind/m_scheduler/scheduler.c
  computes client_stack_highest_byte as the highest addressable byte
  Update comments in call to VG_(show_sched_status)
coregrind/m_machine.c
coregrind/m_stacktrace.c
  updated to client_stack_highest_byte, and switched 
    stack_lowest/highest_word to stack_lowest/highest_byte accordingly

coregrind/m_stacks.c
  clarify semantic of start/end,
  added a comment to indicate why we invert start/end in register call
  (note that the code find_stack_by_addr was already assuming that
  end was included as the checks were doing e.g.
    sp >= i->start && sp <= i->end

coregrind/pub_core_clientstate.h
coregrind/m_clientstate.c
  renames Addr  VG_(clstk_base) to Addr  VG_(clstk_start_base)
    (start to indicate it is the lowest address, base suffix kept
     to indicate it is the initial lowest address).

coregrind/m_initimg/initimg-darwin.c
   updated to  VG_(clstk_start_base)
   replace unclear iicii.clstack_top by iicii.clstack_end
   updated clstack_max_size computation according to both bounds included.

coregrind/m_initimg/initimg-linux.c
   updated to  VG_(clstk_start_base)
   updated VG_(clstk_end) computation according to both bounds included.
   replace unclear iicii.clstack_top by iicii.clstack_end

coregrind/pub_core_aspacemgr.h
  extern Addr VG_(am_startup) : clarify semantic of the returned value
coregrind/m_aspacemgr/aspacemgr-linux.c
   removed a copy of a comment that was already in pub_core_aspacemgr.h
     (avoid double maintenance)
   renamed unclear suggested_clstack_top to suggested_clstack_end
    (note that here, it looks like suggested_clstack_top was already
     the last addressable byte)

* factorisation of the stack guessing and registration causes
  mechanical changes in the following files:
      coregrind/m_syswrap/syswrap-ppc64-linux.c
      coregrind/m_syswrap/syswrap-x86-darwin.c
      coregrind/m_syswrap/syswrap-amd64-linux.c
      coregrind/m_syswrap/syswrap-arm-linux.c
      coregrind/m_syswrap/syswrap-generic.c
      coregrind/m_syswrap/syswrap-mips64-linux.c
      coregrind/m_syswrap/syswrap-ppc32-linux.c
      coregrind/m_syswrap/syswrap-amd64-darwin.c
      coregrind/m_syswrap/syswrap-mips32-linux.c
      coregrind/m_syswrap/priv_syswrap-generic.h
      coregrind/m_syswrap/syswrap-x86-linux.c
      coregrind/m_syswrap/syswrap-s390x-linux.c
      coregrind/m_syswrap/syswrap-darwin.c
      coregrind/m_syswrap/syswrap-arm64-linux.c
 Some files to look at more in details:
  syswrap-darwin.c : the handling of sysctl(kern.usrstack) looked
    buggy to me, and has probably be made correct by the fact that
     VG_(clstk_end) is now the last addressable byte. However,unsure
    about this, as I could not find any documentation about 
    sysctl(kern.usrstack). I only find several occurences on the web,
    showing that the result of this is page aligned, which I guess
    means it must be 1+ the last addressable byte.
  syswrap-x86-darwin.c and syswrap-amd64-darwin.c
   I suspect the code that was computing client_stack_highest_word
   was wrong, and the patch makes it correct.
  syswrap-mips64-linux.c
    not sure what to do for this code. This is the only code
    that was guessing the stack differently from others.
    Kept (almost) untouched. To be discussed with mips maintainers.

coregrind/pub_core_libcassert.h
coregrind/m_libcassert.c
  * void VG_(show_sched_status):
     renamed Bool valgrind_stack_usage to Bool stack_usage
     if stack_usage, shows both the valgrind stack usage and
     the client stack boundaries
coregrind/m_scheduler/scheduler.c
coregrind/m_gdbserver/server.c
coregrind/m_gdbserver/remote-utils.c
   Updated comments in callers to VG_(show_sched_status)



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14392
2014-08-29 22:53:19 +00:00
Philippe Waroquiers
2f460aaec6 The attached patch cleanups the clo processing
of clo which are (or should be) 'enum set'.

* pub_tool_options.h : add new macrox VG_USET_CLO and VG_USETX_CLO to
  parse an 'enum set' command line option (with or without "all" keyword).

* use VG_USET_CLO for existing enum set clo options:
   memcheck --errors-for-leak-kinds, --show-leak-kinds, --leak-check-heuristics
   coregrind --vgdb-stop-at

* change --sim-hints and --kernel-variants to enum set
  (this allows to detect user typos: currently, a typo in a sim-hint
   or kernel variant is silently ignored. Now, an error will be given
   to the user)

* The 2 new sets (--sim-hints and --kernel-variants) should not make
  use of the 'all' keyword => VG_(parse_enum_set) has a new argument
  to enable/disable the use of the "all" keyword.

* The macros defining an 'all enum' set definition was duplicating
  all enum values (so addition of a new enum value could easily
  give a bug). Removing these macros as they are unused
  (to the exception of the leak-kind set).
  For this set, the 'all macro' has been replaced by an 'all function',
  coded using parse_enum_set parsing the "all" keyword.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14301
2014-08-17 20:03:51 +00:00
Tom Hughes
6ef2cbe59d Add support for the clock_adjtime system call.
Based on a patch from Stefan Sørensen on BZ#330469.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13785
2014-01-30 22:33:02 +00:00
Tom Hughes
f1c82feda5 Both eventfd and eventfd2 have post handlers that we were failing
to call on most platforms. Fixes BZ #330459.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13784
2014-01-30 21:47:30 +00:00
Julian Seward
dbf9b63605 Update copyright dates (20XY-2012 ==> 20XY-2013)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13658
2013-10-18 14:27:36 +00:00
Tom Hughes
479650d938 Add support for fanotify_init and fanotify_mark, based on patches
from Heinrich Schuchardt. BZ#320895.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13460
2013-07-17 13:58:59 +00:00
Tom Hughes
6754a87d67 Add support for open_by_handle_at and fix name_to_handle_at
to check the file handle argument correctly. BZ#316761.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13459
2013-07-17 13:25:08 +00:00
Tom Hughes
a9453e4bce Handle the sethostname system call. BZ#311922.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13458
2013-07-17 12:43:30 +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
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
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