Q:2. If we mark the stack and heap segement as non executable,
1.0 No code will execute.
2.0 return-oriented programming will also not be able to exploit it.
3.0 we can present overflow code execution.
4.0 All
of the above.
Answers
Answer:
option-3 we can prevent overflow code execution
Explanation: because overflow code execution can be prevented by marking the stack and heap segements as non-executable.
Answer: 3-We can present overflow code execution
Explanation: Memory space is needed to store the data when a program runs. For a program written in C language, the memory is segregated into five segments, namely
Text segment: this segment stores the executable code of the program.
Data segment: stores static or global variables that are given an initial value in the program.
BSS segment: this stores those static and global variables which are not initialized.
Heap: this memory segment is used to provide the space for dynamic memory allocation.
Stack: this memory segment is used for storing the local variables which are defined inside the function, and is also used for storing the data included in the function calls.
Let us discuss the various options given in the question:
Option 1 is incorrect, as even if the heap and the stack segment are non executable, the code execution will take place.
Option 2 is incorrect, as the code execution will take place with the help of return-oriented programming.
Option 3 is the correct option, as Buffer overflow functions usually put some code in a program's stack segment, and then jump to it. If all writable addresses such as stack and heap are non-executable, then the buffer overflow code execution can be prevented.
Option 4 is incorrect option.
To know more about the "Stacks" go through the following link:
https://brainly.in/question/40115239?referrer=searchResults
https://brainly.in/question/23821244?referrer=searchResults
#SPJ3