Bug 184183

Summary: FC4 stock kernel modified "stack size"??
Product: [Fedora] Fedora Reporter: Robinson Tiemuqinke <hahaha_30k>
Component: kernelAssignee: Dave Jones <davej>
Status: CLOSED NOTABUG QA Contact: Brian Brock <bbrock>
Severity: medium Docs Contact:
Priority: medium    
Version: 4CC: pfrields, wtogami
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: 2006-05-27 04:38:13 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 Robinson Tiemuqinke 2006-03-07 00:44:25 UTC
Description of problem:

FC4 stock kernel modified "stack size" from  default "8M" to "10M"

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

kernel-2.6.15-1.1831_FC4
kernel-2.6.15-1.1831_FC4smp

How reproducible:
Every time, Just want to know the redhat patch or trick to adjust the default 
stack size.


Steps to Reproduce:
1. run "uname -a; ulimit -HSa | grep 'stack size' ", it shows 10240KB "stack 
size"
2. compile and install a 2.6.15 vanilla kernel
3. run "uname -a; ulimit -HSa | grep 'stack size' ", it shows 8192K instead. 

  
Actual results:

edhat stock kernel for FC4:

[root@testnode01 ~]# uname -a; ulimit -a | grep stack Linux 
testnode01.example.com 2.6.15-1.1831_FC4smp #1 SMP Tue Feb 7 13:51:52 EST 2006 
x86_64 x86_64 x86_64 GNU/Linux
stack size              (kbytes, -s) 10240

newly compiled vanilla 2.6.15.5 kernel:

[root@testnode01 ~]# uname -a ; ulimit -HSa | grep stack Linux 
testnode01.example.com 2.6.15.5_64GB #4 SMP Mon Mar 6 14:39:14 PST 2006 x86_64 
x86_64 x86_64 GNU/Linux
stack size              (kbytes, -s) 8192



Expected results:

either 10240KB or 8192KB are OK, but would like to know which patch, or 
compilation options|steps making the difference from vanilla kernel, and the 
reasons behind if possible.

Thanks.


Additional info:

Comment 1 Dave Jones 2006-03-07 04:28:22 UTC
it's done as part of linux-2.6-execshield.patch

--- linux.orig/include/linux/resource.h
+++ linux/include/linux/resource.h
@@ -52,8 +52,11 @@ struct rlimit {
 /*
  * Limit the stack by to some sane default: root can always
  * increase this limit if needed..  8MB seems reasonable.
+ *
+ * (2MB more to cover randomization effects.)
  */
-#define _STK_LIM   (8*1024*1024)
+#define _STK_LIM   (10*1024*1024)
+#define EXEC_STACK_BIAS    (2*1024*1024)


I forget the reasoning why, I'll try and dig up the history.


Comment 2 Dave Jones 2006-05-27 04:38:13 UTC
The randomization 'consumes' stack-space, and we randomize both the stack and
the stack top (argv/exec area), which makes the worst-case loss of stack-space 2MB.