Bug 369362 - Bad sigaction arguments crash valgrind
Summary: Bad sigaction arguments crash valgrind
Status: RESOLVED FIXED
Alias: None
Product: valgrind
Classification: Developer tools
Component: general (other bugs)
Version First Reported In: unspecified
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Julian Seward
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-09-25 22:31 UTC by Mark Wielaard
Modified: 2016-10-01 11:58 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments
Fix crash in linux [rt_]sigaction wrapper with bad old/new sigaction handler. (5.89 KB, patch)
2016-09-25 22:33 UTC, Mark Wielaard
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Mark Wielaard 2016-09-25 22:31:05 UTC
LTP testcases/kernel/syscalls/rt_sigaction/rt_sigaction02 crashes valgrind:

--29814-- VALGRIND INTERNAL ERROR: Valgrind received a signal 11 (SIGSEGV) - exi
ting
--29814-- si_code=1;  Faulting address: 0xA;  sp: 0x80327ad70

valgrind: the 'impossible' happened:
   Killed by fatal signal

host stacktrace:
==29814==    at 0x380AF328: vgSysWrap_linux_sys_rt_sigaction_before (syswrap-lin
ux.c:3376)
==29814==    by 0x38092CDF: vgPlain_client_syscall (syswrap-main.c:1906)
==29814==    by 0x3808F8B2: handle_syscall (scheduler.c:1118)
==29814==    by 0x38090E76: vgPlain_scheduler (scheduler.c:1435)
==29814==    by 0x380A027A: thread_wrapper (syswrap-linux.c:103)
==29814==    by 0x380A027A: run_a_thread_NORETURN (syswrap-linux.c:156)


Reproducible: Always
Comment 1 Mark Wielaard 2016-09-25 22:33:18 UTC
Created attachment 101290 [details]
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.
Comment 2 Mark Wielaard 2016-10-01 11:58:19 UTC
valgrind svn r15994