
Secure Systems Engineering Basics
Explore the fundamentals of secure systems engineering, touching on topics such as architectural aid, function calls, and stacks. Learn about security issues like buffer overflows, system components involved, and the impact of such vulnerabilities. Dive into examples of function calls in software development and understand the importance of stack usage for efficient function execution.
Download Presentation

Please find below an Image/Link to download the presentation.
The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author. If you encounter any issues during the download, it is possible that the publisher has removed the file from their server.
You are allowed to download the files provided on this website for personal or commercial use, subject to the condition that they are used lawfully. All files are the property of their respective owners.
The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author.
E N D
Presentation Transcript
Information Security - 2 Topic: Architectural Aid to Secure Systems Engineering V. Kamakoti RISE LAB, Department of Computer Science and Engineering IIT Madras SESSION 3: FUNCTION CALLS AND STACKS
Topic A sample of well-studied security issues Buffer Overflow What is this? Which system component causes it? What happens due to the same?
Function Calls Very important for Software Development Calling function and called function Call by Reference scanf( %d , &my_var) Call by Value printf( %d ,my_var) Function returns results Context of Calling function to be retained for continuation after called function returns. Use of Stack First-in Last-Out suits function execution model
main() { int am,bm,cm; //am = 2, bm = cm = 1 bm = my_proc(am,bm); //am=2, bm=21, cm=1 L1: .. } Operating Systems Stack Smashing!!! int my_proc(int em,int fm) { int am,bm,cm; //em=2, fm=1, am=3, cm=6 bm = next_sk1(am,cm); //em=2,fm=1,am=3,bm=18,cm=6 L2: cm = bm + am; return(cm); //cm = 21; } int next_sk1(int gm, int hm) {int am; //gm=3,hm=6 am = gm* hm; return(am); //am = 18;} Initial State
main() { int am,bm,cm; //am = 2, bm = cm = 1 bm = my_proc(am,bm); //am=2, bm=21, cm=1 L1: .. } 2 am of main() bm of main() cm of main() 1 1 Ret. Addr Arg1 for my_proc() L1 2 FP 1 Arg2 for my_proc() int my_proc(int em,int fm) { int am,bm,cm; //em=2, fm=1, am=3, cm=6 bm = next_sk1(am,cm); //em=2,fm=1,am=3,bm=18,cm=6 L2: cm = bm + am; return(cm); //cm = 21; } SP int next_sk1(int gm, int hm) {int am; //gm=3,hm=6 am = gm* hm; return(am); //am = 18;} my_proc() is called by main()
main() { int am,bm,cm; //am = 2, bm = cm = 1 bm = my_proc(am,bm); //am=2, bm=21, cm=1 L1: .. } 2 am of main() bm of main() cm of main() 1 1 Ret. Addr em of my_proc() L1 2 1 fm of my_proc() am of my_proc() int my_proc(int em,int fm) { int am,bm,cm; //em=2, fm=1, am=3, cm=6 bm = next_sk1(am,cm); //em=2,fm=1,am=3,bm=18,cm=6 L2: cm = bm + am; return(cm); //cm = 21; } 3 J bm of my_proc() cm of my_proc() Ret. Addr 6 L2 3 arg1 for next_sk1() arg2 for next_sk1() 6 int next_sk1(int gm, int hm) {int am; //gm=3,hm=6 am = gm* hm; return(am); //am = 18;} next_sk1() is called by my_proc()
main() { int am,bm,cm; //am = 2, bm = cm = 1 bm = my_proc(am,bm); //am=2, bm=21, cm=1 L1: .. } 2 am of main() bm of main() cm of main() 1 1 Ret. Addr em of my_proc() L1 2 FP 1 fm of my_proc() am of my_proc() int my_proc(int em,int fm) { int am,bm,cm; //em=2, fm=1, am=3, cm=6 bm = next_sk1(am,cm); //em=2,fm=1,am=3,bm=18,cm=6 L2: cm = bm + am; return(cm); //cm = 21; } 3 18 bm of my_proc() cm of my_proc() Ret. Addr SP 6 L2 18 Ret val next_sk1() 6 int next_sk1(int gm, int hm) {int am; //gm=3,hm=6 am = gm* hm; return(am); //am = 18;} next_sk1() Finishes - Pop out
main() { int am,bm,cm; //am = 2, bm = cm = 1 bm = my_proc(am,bm); //am=2, bm=21, cm=1 L1: .. } 2 am of main() bm of main() cm of main() FP 21 SP 1 Ret. Addr Ret val my_proc() L1 21 1 fm of my_proc() am of my_proc() int my_proc(int em,int fm) { int am,bm,cm; //em=2, fm=1, am=3, cm=6 bm = next_sk1(am,cm); //em=2,fm=1,am=3,bm=18,cm=6 L2: cm = bm + am; return(cm); //cm = 21; } 3 18 bm of my_proc() cm of my_proc() Ret. Addr 6 L2 18 Ret val next_sk1() 6 int next_sk1(int gm, int hm) {int am; //gm=3,hm=6 am = gm* hm; return(am); //am = 18;} my_proc() finishes
End of Session-3 Thank You