Bug 107307

Summary: Exec Shield in 2.6 kernel causes random executable crashes
Product: [Fedora] Fedora Reporter: Daniel Walsh <dwalsh>
Component: kernelAssignee: Arjan van de Ven <arjanv>
Status: CLOSED CURRENTRELEASE QA Contact: Brian Brock <bbrock>
Severity: high Docs Contact:
Priority: medium    
Version: rawhideCC: roland
Target Milestone: ---   
Target Release: ---   
Hardware: i686   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2004-09-21 18:55:33 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
reproducer program for kernel stack bug
none
fix for overflow in expand_stack rlimit check none

Description Daniel Walsh 2003-10-16 19:04:18 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.5) Gecko/20030927

Description of problem:
System seems unstable with 2.6 kernel and exec shield installed.  I have seen
emacs, find, gcc and prelink fail with segfaults.

Version-Release number of selected component (if applicable):
 2.6.0-0.test7.1.57

How reproducible:
Always

Steps to Reproduce:
1.Install  2.6.0-0.test7.1.57 kernel
2. set /proc/sys/kernel/exec_shield to 1
3. run rpmbuild --rebuild prelink*src.rpm
4. Build crashes
5. set /proc/sys/kernel/exec_shield to 0
6. run rpmbuild --rebuild prelink*src.rpm
7. Build succeeds
    

Actual Results:  Seg faults

Expected Results:  No Seg Faults

Additional info:

I am doing this testing on an box with SELinux enabled.  Although I have turned
off the SELinux and still seen this behaviour.  The crashes do not happen in the
same place ever time.  I have started emacs had it crash and recall command and
it works.

Comment 1 Roland McGrath 2003-10-16 19:59:00 UTC
Created attachment 95234 [details]
reproducer program for kernel stack bug

This test program reproduces the bug every time run with an argument >= 2.
This happens for me even with /proc/sys/kernel/exec-shield set to 0,
on kernel-smp-2.6.0-0.test7.1.59.i686 (on dual PIII).
It does not happen with my own build of vanilla 2.6.

Comment 2 Roland McGrath 2003-10-16 20:23:16 UTC
Created attachment 95237 [details]
fix for overflow in expand_stack rlimit check

I think I got it by dead reckoning.  When the limit is set to RLIM_INFINITY,
the check in expand_stack will overflow and give a false positive.

I haven't tried this patch, but it probably fixes it.

Comment 3 Daniel Walsh 2004-09-21 18:55:33 UTC
Seems to be fixed.