Bug 109642

Summary: PATCH: pstack can segfault on certain binaries in strcpy
Product: Red Hat Enterprise Linux 3 Reporter: Neil Horman <nhorman>
Component: pstackAssignee: Roland McGrath <roland>
Status: CLOSED ERRATA QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 3.0   
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2003-12-19 14:41:42 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
patch to avoid buffer overflows in strcpy none

Description Neil Horman 2003-11-10 15:51:34 UTC
Description of problem:
If pstack attempts to decode a stack in which a given function
signature is more than 256 characters, pstack will segfulat, due to a
buffer overrun error in symAddress

Version-Release number of selected component (if applicable):


How reproducible:
Sometimes

Steps to Reproduce:
1.create a test program in which function signatures have 256 or more
characters
2.run the program in a loop
3.run pstack on the program, and eventually pstack will segfault
  
Actual results:
pstack segfaults

Expected results:
pstack should display as much of each function signature as possible

Additional info:

Comment 1 Neil Horman 2003-11-10 15:54:58 UTC
Created attachment 95877 [details]
patch to avoid buffer overflows in strcpy

This patch replaces the use of strcpy with strncpy and allows callers of
symAddress function to specify the length of the passed in buffer.  This avoids
the possibility of bufferoverflows which lead to the reported SIGSEGV

Comment 3 Roland McGrath 2003-11-11 22:05:44 UTC
I have fixed the bug without imposing a length limitation on symbols.
Thanks for the report.

Comment 4 John Flanagan 2003-12-19 14:41:42 UTC
An errata has been issued which should help the problem described in this bug report. 
This report is therefore being closed with a resolution of ERRATA. For more information
on the solution and/or where to find the updated files, please follow the link below. You may reopen 
this bug report if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2003-250.html