Bug 498861

Summary: Crash while trying to set SELinux security context
Product: [Fedora] Fedora Reporter: Pavel Roskin <proski>
Component: patchAssignee: Tim Waugh <twaugh>
Status: CLOSED DUPLICATE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: low    
Version: 11CC: sergio, twaugh
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2009-06-10 05:12:16 EDT Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Description Pavel Roskin 2009-05-04 01:03:41 EDT
Description of problem:
The "patch" utility crashed for me several times when I was trying to apply a patch.

Version-Release number of selected component (if applicable):
2.5.4-38.fc11

How reproducible:
I cannot reproduce it, but anyone versed in SELinux should be able to.

Steps to Reproduce:
1. Apply a patch to some sources.
  
Actual results:
Segmentation fault.

Expected results:
The patch is applied.

Additional info:

I'm using a kernel without SELinux support.  The sources are located on a ext4 partition.

(gdb) where
#0  0x0000003fa347fc00 in strcmp () from /lib64/libc.so.6
#1  0x0000000000408233 in main (argc=8, argv=<value optimized out>) at patch.c:420
(gdb) up
#1  0x0000000000408233 in main (argc=8, argv=<value optimized out>) at patch.c:420
420                               if (strcmp(outcontext, incontext) && 
(gdb) p outcontext
$1 = (security_context_t) 0x0
(gdb) p incontext
$2 = (security_context_t) 0x162f6e0 "system_u:object_r:user_home_t:s0"
(gdb) p outname
$3 = 0x162e270 "fs/ntfscomp.c"
(gdb) p inerrno 
$4 = 0
(gdb) p inname
$5 = 0x162e270 "fs/ntfscomp.c"
(gdb)
Comment 1 Tim Waugh 2009-05-05 07:58:32 EDT
Please try this package:
  https://koji.fedoraproject.org/koji/buildinfo?buildID=100263

Does that fix the problem?
Comment 2 Sergio Monteiro Basto 2009-05-10 01:14:31 EDT
ok I got the same problem patch-2.5.4-38.fc11.i586

and I'm using a kernel without SELinux support 

on dmesg appears: 
patch[19635]: segfault at 0 ip 006a4308 sp bfa6793c error 4 in libc-2.9.90.so[62b000+16d000]

rpm -Uvh http://kojipkgs.fedoraproject.org/packages/patch/2.5.4/39.fc11/i586/patch-2.5.4-39.fc11.i586.rpm

solved the problem thanks,
Comment 3 Pavel Roskin 2009-05-10 10:25:26 EDT
I can reproduce the crash now by setting some security attributes with "chcon" and applying a patch to that file.  I confirm that the new build fixes the crash.
Comment 4 Bug Zapper 2009-06-09 11:05:55 EDT
This bug appears to have been reported against 'rawhide' during the Fedora 11 development cycle.
Changing version to '11'.

More information and reason for this action is here:
http://fedoraproject.org/wiki/BugZappers/HouseKeeping
Comment 5 Tim Waugh 2009-06-10 05:12:16 EDT

*** This bug has been marked as a duplicate of bug 498102 ***