Bug 138297

Summary: libapol/policy-io.c:search_policy_src_file segfault in strcpy
Product: [Fedora] Fedora Reporter: Sami Farin <hvtaifwkbgefbaei>
Component: setoolsAssignee: Daniel Walsh <dwalsh>
Status: CLOSED CURRENTRELEASE QA Contact:
Severity: high Docs Contact:
Priority: medium    
Version: 3   
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Current Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2005-09-27 20:37:36 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
fix to calculate path len correctly none

Description Sami Farin 2004-11-07 19:28:26 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.3)
Gecko/20041020

Description of problem:
Starting program: /var/rpmbuild/BUILD/setools-1.5.1/secmds/seinfo 

  Electric Fence 2.2.0 Copyright (C) 1987-1999 Bruce Perens
<bruce>

  Electric Fence 2.2.0 Copyright (C) 1987-1999 Bruce Perens
<bruce>

Program received signal SIGSEGV, Segmentation fault.
0x05acb8a6 in strcpy () from /lib/tls/libc.so.6
(gdb) bt
#0  0x05acb8a6 in strcpy () from /lib/tls/libc.so.6
#1  0x08052659 in search_policy_src_file (policy_file_path=0x80729e4)
at policy-io.c:350
#2  0x080526fd in find_default_policy_file (search_opt=3,
policy_file_path=0x80729e4)
    at policy-io.c:379
#3  0x0804abbf in main (argc=1, argv=0xbfee2f54) at seinfo.c:545

patch attached.



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


How reproducible:
Always

Steps to Reproduce:
1. run seinfo or some other program using the crashy function
2.
3.
    

Actual Results:  strcpy caused segfault in the offending function

Expected Results:  seinfo should have not segfaulted :)


Additional info:

libselinux-1.18.1-4
setools-1.5.1-1

Comment 1 Sami Farin 2004-11-07 19:31:10 UTC
Created attachment 106261 [details]
fix to calculate path len correctly

Comment 2 Daniel Walsh 2004-11-08 14:09:29 UTC
Applied in setools-1.5.1-2, and notified upstream.

Thanks.

Dan