Bug 164945

Summary: exec-shield sometimes fails to protect bss and data segments when executables are compiled with -pie
Product: [Fedora] Fedora Reporter: João Pedro <secml>
Component: kernelAssignee: Ingo Molnar <mingo>
Status: CLOSED RAWHIDE QA Contact: Brian Brock <bbrock>
Severity: medium Docs Contact:
Priority: medium    
Version: 4CC: davej, wtogami
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2005-09-15 22:24:58 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:

Description João Pedro 2005-08-02 23:13:10 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.10) Gecko/20050719 Epiphany/1.6.3

Description of problem:
While using paxtest  - http://pax.grsecurity.net/paxtest-0.9.7-pre4.tar.gz - I noticed some issues with executables compiled with the -pie option.
If the binaries are compiled normally - without -pie - the tests run as expected, instead if we activate it, the bss and data tests sometimes fail, indicating that exec-shield is not protecting those areas.

Version-Release number of selected component (if applicable):
kernel-2.6.12-1.1398_FC4

How reproducible:
Sometimes

Steps to Reproduce:
1. wget http://pax.grsecurity.net/paxtest-0.9.7-pre4.tar.gz
2. tar -zxf paxtest-0.9.7-pre4.tar.gz
3. cd paxtest-0.9.7-pre4
4. gcc -pie body.c execbss.c -o execbss -lpthread
5. gcc -pie body.c execdata.c -o execdata -lpthread
6. ./execbss
7. ./execdata
  

Actual Results:  Executable bss                           : Vulnerable
Executable data                          : Vulnerable


Expected Results:  Executable bss                           : Killed
Executable data                          : Killed


Additional info:

$ cat /proc/sys/kernel/exec-shield
1
$ cat /proc/sys/kernel/randomize_va_space
1

Comment 1 Ingo Molnar 2005-09-15 22:24:58 UTC
this is fixed in the latest update kernel.