Commit Graph

805 Commits

Author SHA1 Message Date
Mark Wielaard
547abdee69 Fix crash in sys_modify_ldt wrapper on bad ptr. Bug #369383.
Make sure ptr is safe_to_deref if not NULL.
Also fixup some corner case error return codes.
We have to do that ourselves since we never actually call into the kernel.

Found by LTP testcases/kernel/syscalls/modify_ldt/modify_ldt01.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15995
2016-10-01 11:54:50 +00:00
Mark Wielaard
e1e9a77564 Fix crash in linux [rt_]sigaction wrapper with bad old/new sigaction handler.
Since we try to modify the old/new sigaction handler before passing it
to the kernel we must make sure that (if they aren't NULL) it is safe
to use. If not we should bail out early with EFAULT.

Bug #369362
Found by LTP testcases/kernel/syscalls/rt_sigaction/rt_sigaction02.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15994
2016-10-01 11:54:49 +00:00
Mark Wielaard
1063360181 Fix crash in vmsplice linux kernel wrapper when iovec is bad. Bug #369361.
Found by LTP testcases/kernel/syscalls/vmsplice/vmsplice02.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15993
2016-10-01 11:54:48 +00:00
Mark Wielaard
52b55f29f3 Fix crash when old/new sigprocmask isn't safe to dereference. Bug #369360.
Since we want to use the set and oldset for bookkeeping we also want
to make sure they are addressable otherwise, like the kernel, we EFAULT.
Also use EINVAL instead of EMFILE as failure when sigset size is wrong.

Found by LTP testcases/kernel/syscalls/rt_sigprocmask/rt_sigprocmask02.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15992
2016-10-01 11:54:47 +00:00
Mark Wielaard
1e3852e27c Fix crash in msghdr_foreachfield when iov_len isn't safe to dereference.
Also stop checking when max length of bytes have been reached.

Bug #369359
Found by LTP testcases/kernel/syscalls/recvmsg/recvmsg01.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15991
2016-10-01 11:54:41 +00:00
Mark Wielaard
31e1b8c9ba Fix pre_mem_read_sockaddr crash on invalid syscall arguments. Bug #369356.
Don't do any more checks if it isn't safe to inspect the address family.
Likewise, don't check sun_path if the string address isn't safe.

Found by LTP testcases/kernel/syscalls/bind/bind01.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15990
2016-10-01 11:54:40 +00:00
Mark Wielaard
be052139d6 Don't require the current working directory to exist. Bug #369209.
At startup valgrind fetches the current working directory and stashes
it away to be used later (in debug messages, read config files or create
log files). But if the current working directory didn't exist (or there
was some other error getting its path) then valgrind would go in an
endless loop. This was caused by assuming that any error meant a larger
buffer needed to be created to store the cwd path (ERANGE). However
there could be other reasons calling getcwd failed.

Fix this by only looping and resizing the buffer when the error is
ERANGE. Any other error just means we cannot fetch and store the current
working directory. Fix all callers to check get_startup_wd() returns
NULL. Only abort startup if a relative path needs to be used for
user supplied relative log files. Debug messages will just show
"<NO CWD>". And skip reading any config files from the startup_wd
if it doesn't exist.

Also add a new testcase that tests executing valgrind in a deep,
inaccessible and/or non-existing directory (none/tests/nocwd.vgtest).

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15989
2016-10-01 11:54:38 +00:00
Ivo Raisr
f2b34df721 Added meta mempool support into memcheck for describing a custom allocator which:
- Auto-frees all chunks assuming that destroying a pool destroys all
  objects in the pool
- Uses itself to allocate other memory blocks
Unit tests included.
Fixes BZ#367995
Patch by: Ruurd Beerstra <ruurd.beerstra@infor.com>



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15984
2016-09-24 21:15:44 +00:00
Philippe Waroquiers
eaefbe1f25 Fix 361615 - Inconsistent termination for multithreaded process terminated by signal
Test program by earl_chew



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15982
2016-09-24 12:06:34 +00:00
Carl Love
3c751e88ac Powerpc big endian, fix the expected output file for
none/tests/ppc64/jm_int_isa_2_07.stdout.exp

By convention the file jm_int_isa_2_07.stdout.exp is the big endian reuslts.
If the little endian results differ, the file has -LE appended to it.
This patch replaces the little endian results that are currenttly in
none/tests/ppc64/jm_int_isa_2_07.stdout.exp with the correct the big
endian results.

Bugzilla 369169


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15977
2016-09-22 15:37:57 +00:00
Rhys Kidd
ab2edd2901 Preliminary support for macOS Sierra (10.12). Does not fully resolve bz#365327.
No regressions on OS X 10.11.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15976
2016-09-22 02:55:24 +00:00
Julian Seward
4216a9e19a Update.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15974
2016-09-21 13:48:20 +00:00
Christian Borntraeger
bcef0a5407 fix for bugzilla 361253 [s390x] ex_clone.c:42: undefined reference to `pthread_create'
Fix provides by Dann Frazier



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15970
2016-09-20 12:31:49 +00:00
Mark Wielaard
c5556b2094 Testcases for fma4 instructions. Bug #369000.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15961
2016-09-19 12:41:38 +00:00
Julian Seward
237fcf7d36 Update bug lists.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15959
2016-09-16 13:38:02 +00:00
Julian Seward
f4e420c096 Update bug list.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15958
2016-09-15 10:56:00 +00:00
Carl Love
97783a3760 updated the NEWS file for bugzillas that have been closed:
Bugzilla 368412 commit15952
   Bugzilla 368416 commit15956
   

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15957
2016-09-14 17:16:52 +00:00
Julian Seward
dbbb036b4a Update.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15954
2016-09-14 13:15:28 +00:00
Mark Wielaard
a57acb9be6 Correct an Altivec configure think-o.
An earlier change introduced a think-o in the altivec capability
check, allowing a false positive if the compiler supported altivec
but the hardware did not.

Resolves bug #368412 - False positive result for altivec capability check
Patch by Will Schmidt <will_schmidt@vnet.ibm.com>

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15952
2016-09-13 19:18:36 +00:00
Mark Wielaard
9d0a8787d5 Update libiberty demangler.
Update the libiberty demangler using the auxprogs/update-demangler
script. There were various extensions and bug fixes since our last
import. Add new D language demangler file d-demangle.c and update
the vg_libciface.h header with some new constructs used (strtol,
xmalloc_failed, xmemdup, XDELETEVEC, XDUPVEC).

Resolves bug #359181 - Buffer Overflow during Demangling.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15951
2016-09-13 19:06:23 +00:00
Carl Love
4a1581f982 Adapt massif mmapunmap test to handle ppc64 backtrace
The reported backtrace on ppc64 platform reports "generic_start_main.isra.0"
in the backtrace, where other platforms typically see "main".  Adjust the
vgtest file to handle this variation.  This is similar to existing changes
as seen in deep-D.post.exp

Bugzilla 368461
  

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15950
2016-09-13 15:54:33 +00:00
Rhys Kidd
002a63dfd7 Support clang compiler shipped with Apple’s Xcode 8. bz#366138.
This applies to both OS X 10.11 and macOS 10.12.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15949
2016-09-11 13:54:04 +00:00
Philippe Waroquiers
5de4bad5a7 Fix 199468 - Suppressions: stack size limited to 25 while --num-callers allows more frames
Nr of callers in a suppression entry had a smaller limit than the max
for --num-callers.
This means it was not possible to precisely suppress an error with a big
stack trace.
Also, --gen-suppressions was not providing the full stack trace of
the error in the generated suppressions.

Now, a suppression entry can have the same nr of callers as a backtrace.
Generated suppressions are generated with up to --num-callers callers.

This change has neglectible impact :
* memory: stack array of 500*2 words is declared, instead of 24*2 words
  This array is declared on the interim stack (startup stack), which is
  largely big enough.
* cpu : neglectible more cpu needed to read suppression entries
        (to initialise the bigger stack array when reading a supp entry),
Apart of the above, no impact on performance (unless of course bigger
supp entries are really used).

Note that this does not impact the behaviour for existing suppression files.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15945
2016-09-07 20:12:30 +00:00
Carl Love
d2450cd776 Power PC test suite for ISA 3.0, part 5 of 5
The test suite support for the Power PC ISA 3.0 instructions added in
VEX commit 3244 is added in this commit.

bugzilla 364948

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15938
2016-08-15 21:54:04 +00:00
Julian Seward
d8fc8361bc Update.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15928
2016-08-05 15:15:20 +00:00
Carl Love
68a17eeb24 When running the valgrind tests, the jm-insns test is segfaulting when it
attempts to patch instructions as it deals with the ppc64 (BE) function
descriptor. This is actually due to the RELRO option being enabled by default
for the ppc64 (BE) platform, per an upstream binutils change.

Bugzilla 365912 reported by  Will Schmidt, Will supplied the patch to fix the
make file none/tests/ppc64/Makefile.a

Patch tested on Power 7 and Power 8.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15917
2016-07-28 16:51:53 +00:00
Julian Seward
48adfb9ed4 Update.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15914
2016-07-24 11:45:58 +00:00
Julian Seward
55c7b5dd94 Update.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15911
2016-07-20 17:51:53 +00:00
Julian Seward
33140037a9 Update w/ recent arm64 insn emulation fixes.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15909
2016-07-19 07:08:56 +00:00
Philippe Waroquiers
2679aea160 Regression test for n-i-bz amd64: memcheck false positive with shr %edx
Valgrind side : reproducer for the false positive memcheck
+ announce the fix (VEX side in next commit)



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15905
2016-07-12 20:48:31 +00:00
Philippe Waroquiers
80dec3e514 Fix 365273 - Invalid write to stack location reported after signal handler runs
Analysis and patch by Earl Chew

Tested on x86/amd64/ppc64



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15902
2016-07-10 21:17:58 +00:00
Julian Seward
e5782be21b Finish first-pass classification of bugs reported up to 4 July 2016.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15901
2016-07-05 08:41:07 +00:00
Julian Seward
259caf2e10 Initial triage of a bunch of bugs from Oct 2015 to Feb 2016, roughly.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15900
2016-07-04 16:57:36 +00:00
Philippe Waroquiers
35589fdb14 fix 364058 - clarify in manual limitations of array overruns detections
Further try to clarify again with more words the way sgcheck works
and the implied limitations


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15897
2016-06-30 20:28:53 +00:00
Carl Love
47216ba855 Add the HW register support for missing registers in get_otrack_shadow_offset_wrk(). The registers are: NRADDR, NRADDR_GPR2, (REDIR_STACK, TFHAR, TEXASR, TEXASRU, TFIAR, PPR, PSPB.
Bugzilla  36728

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15895
2016-06-27 15:50:29 +00:00
Mark Wielaard
08086f0855 Bug 364413 pselect sycallwrapper mishandles NULL sigmask.
Don't check or try to copy sigmask if it is NULL. The sigmask might be
given in a struct, where the length is non-zero, but the signal set
pointer is NULL.

Testcase provided by Paul Eggert <eggert@cs.ucla.edu>.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15893
2016-06-21 19:58:21 +00:00
Carl Love
fd13333a69 Updated NEWS file for bugzilla 360035: missing (broken) support for wbit field
on mtfsfi instruction (ppc64).  VEX fix committed, vex commit 3221.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15892
2016-06-13 17:30:24 +00:00
Rhys Kidd
2ea4e5efa4 Fix tst->os_state.pthread - magic_delta assertion failure on OSX 10.11
bz#354883

Whilst I’ve seen different magic_delta values on one of my older development machines (Intel Nehalem-based), enough other users have reported success with this change.

If this causes regressions, please report your hardware details in our Bugzilla.

Regression test output on OS X 10.11

Before:

== 601 tests, 223 stderr failures, 12 stdout failures, 0 stderrB failures, 0 stdoutB failures, 31 post failures ==

After:

== 601 tests, 223 stderr failures, 12 stdout failures, 0 stderrB failures, 0 stdoutB failures, 31 post failures ==

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15891
2016-06-04 15:34:56 +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
Mark Wielaard
59d79476bc Bug 363714 ppc64 missing syscalls sync, waitid and name_to/open_by_handle_at
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15888
2016-05-30 20:16:04 +00:00
Mark Wielaard
958ea4cb5b Bug #363705 arm64 missing syscall name_to_handle_at and open_by_handle_at
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15887
2016-05-30 14:17:25 +00:00
Philippe Waroquiers
268ff84f7b Document brk segment limitation, reference manual in limit reached msg.
The msg telling brk cannot be extended confuses some users
so improve the documentation and have the msg referencing the doc.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15880
2016-05-22 20:48:09 +00:00
Carl Love
62e815e8af Power PC Fix V bit error in 128-bit BCD add and subtract instructions
Update the NEWS file for this bug

VEX commit       3218
Valgrind commit 15871 

Bugzilla 360035


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15872
2016-04-26 20:05:13 +00:00
Ivo Raisr
da7df0f276 Valgrind is able to read compressed debuginfo sections in two formats:
- zlib ELF gABI format with SHF_COMPRESSED flag (gcc option -gz=zlib)
  - zlib GNU format with .zdebug sections (gcc option -gz=zlib-gnu)

Patch by: Aleksandar Rikalo <aleksandar.rikalo@imgtec.com>
Fixes BZ#303877



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15868
2016-04-23 20:28:27 +00:00
Ivo Raisr
5d4c5ae3d6 Fix Valgrind coredump when VG_(unimplemented)() is called
early during main initialization, before the threads are
created and scheduler is initialized.
Fixes BZ#362009


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15867
2016-04-23 19:35:11 +00:00
Carl Love
ee51765c22 Update NEWS file for Bugzilla 360008 which has been fixed.
valgrind commit 15864


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15865
2016-04-21 19:56:12 +00:00
Ivo Raisr
91f7614767 Solaris: Add syscall wrapper for sysfs(84)
Fixes BZ#361926


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15862
2016-04-19 15:57:13 +00:00
Ivo Raisr
60a0aa1d53 Kludge for multiple .rodata sections on Solaris introduced by BZ#353802
is no longer needed. The situation with multiple ".rodata" sections existed
only between dozens of builds of Solaris 12.
Fixes BZ#360749


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15853
2016-04-08 20:38:30 +00:00
Christian Borntraeger
b8593502ea Bug 361226 valgrind part: s390x: risbgn (EC59) not implemented
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15852
2016-04-07 18:55:25 +00:00
Rhys Kidd
c8f08a1e4d Fix ppoll_alarm exclusion on OS X. n-i-bz.
ppoll() is not POSIX, and accordingly we should ignore the lack
of support for this on OS X.

Exclude the ppoll_alarm regression test on that platform, as
introduced in r15823.

Regression test output on OS X 10.11

Before:

n/a

After:

== 602 tests, 223 stderr failures, 13 stdout failures, 0 stderrB failures, 0 stdoutB failures, 31 post failures ==

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15851
2016-04-07 03:48:59 +00:00