Bug 369402

Summary: Bad set/get_thread_area pointer crashes valgrind
Product: [Developer tools] valgrind Reporter: Mark Wielaard <mark>
Component: generalAssignee: Julian Seward <jseward>
Status: RESOLVED FIXED    
Severity: normal    
Priority: NOR    
Version First Reported In: unspecified   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:
Attachments: linux-x86 check get/set_thread_area pointer before use.

Description Mark Wielaard 2016-09-26 21:09:39 UTC
LTP testcases/kernel/syscalls/set_thread_area/set_thread_area01 crashes valgrind:

==5690== Syscall param set_thread_area(u_info) points to unaddressable byte(s)
==5690==    at 0x4129977: syscall (in /usr/lib/libc-2.23.so)
==5690==    by 0x8049A7B: main (set_thread_area01.c:77)
==5690==  Address 0xfffffff7 is not stack'd, malloc'd or (recently) free'd
==5690== 
--5690-- VALGRIND INTERNAL ERROR: Valgrind received a signal 11 (SIGSEGV) - exiting
--5690-- si_code=1;  Faulting address: 0xFFFFFFF7;  sp: 0x62a5fe30

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

host stacktrace:
==5690==    at 0x380B5F3C: sys_set_thread_area (syswrap-x86-linux.c:641)


Reproducible: Always
Comment 1 Mark Wielaard 2016-09-26 21:13:04 UTC
Created attachment 101307 [details]
linux-x86 check get/set_thread_area pointer before use.
Comment 2 Mark Wielaard 2016-10-01 11:56:57 UTC
valgrind svn r15996