Red Hat Bugzilla – Bug 1304426
[rfe] /bin/su should be improved to reduce stack use
Last modified: 2016-11-03 17:26:51 EDT
[+] Description of problem:
/bin/su should print a warning if stack size is a low number
[+] Version-Release number of selected component (if applicable):
[+] How reproducible:
[+] Steps to Reproduce:
1. $ ulimit -s 275
2. $ su
[+] Actual results:
[+] Expected results:
Warning - stack size is $(ulimit -s)
This may cause unwanted results
[+] Additional info:
As of ￼util-linux 2.23.2-26.el7, the tested minimal required stack size is 276. Anything lower will cause /bin/su to segfault. The /bin/su application should have an if, then (example) rule that if it matches 300 (example number) or lower, it prints a warning.
Since su is written in C, example:
if ( $(ulimit -s) < 300 )
printf( "Warning - stack size is less than 300" );
Or, a more long-term solution would be to implement a separate function that allows itself to calculate it's own stack requirement and then match that against what is available and cleanly exit if the requirement is less than available.
By "cleanly exit if the requirement is less than available" I meant "cleanly exit if the requirement is greater than available".
This bug was accidentally moved from POST to MODIFIED via an error in automation, please see email@example.com with any questions
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.
For information on the advisory, and where to find the updated
files, follow the link below.
If the solution does not work for you, open a new bug report.