ISC2 Certified Secure Software Lifecycle Professional (CSSLP) Practice Question
During a security hardening review, you must compile a legacy C service with a GCC option that inserts stack canaries into every function, aborting execution if a buffer overflow corrupts the canary. Which compiler switch should you enable?
The GCC switch -fstack-protector-all emits additional prologue and epilogue code for every function, placing a random guard (canary) value on the stack and verifying it before returning. If the canary is altered-typically by a stack-based buffer overflow-the generated check calls __stack_chk_fail, which terminates the process. The basic -fstack-protector variant protects only functions judged at risk (those with certain stack objects), -fPIC merely produces position-independent code, -O3 selects aggressive optimization settings, and -fomit-frame-pointer omits the frame pointer to free a register; none of these latter options ensure canary insertion for all functions.
Ask Bash
Bash is our AI bot, trained to help you pass your exam. AI Generated Content may display inaccurate information, always double-check anything important.
What is a stack canary, and how does it prevent vulnerabilities?
Open an interactive chat with Bash
What is the difference between -fstack-protector and -fstack-protector-all?
Open an interactive chat with Bash
Why is -fPIC or -O3 not suitable for stack canary insertion?
Open an interactive chat with Bash
What is a stack canary in programming?
Open an interactive chat with Bash
How is the -fstack-protector-all GCC option different from -fstack-protector?
Open an interactive chat with Bash
What are buffer overflow attacks and how do stack canaries defend against them?
Open an interactive chat with Bash
ISC2 Certified Secure Software Lifecycle Professional (CSSLP)
Secure Software Implementation
Your Score:
Report Issue
Bash, the Crucial Exams Chat Bot
AI Bot
Loading...
Loading...
Loading...
Pass with Confidence.
IT & Cybersecurity Package
You have hit the limits of our free tier, become a Premium Member today for unlimited access.
Military, Healthcare worker, Gov. employee or Teacher? See if you qualify for a Community Discount.
Monthly
$19.99
$19.99/mo
Billed monthly, Cancel any time.
3 Month Pass
$44.99
$14.99/mo
One time purchase of $44.99, Does not auto-renew.
MOST POPULAR
Annual Pass
$119.99
$9.99/mo
One time purchase of $119.99, Does not auto-renew.
BEST DEAL
Lifetime Pass
$189.99
One time purchase, Good for life.
What You Get
All IT & Cybersecurity Package plans include the following perks and exams .