Computer Science, asked by zebasiddiqui952, 5 months ago

If we mark the stack and heap segement as non executable,
1.No code will execute.
2.return-oriented programming will also not be able to exploit it.
3.we can prevent overflow code execution.
4.All of the above.​

Answers

Answered by Anonymous
12

Answer:

execution occurs in the code section, which is neither stack nor heap. In a typical paged memory system, the code from a program file (e.g., a.exe in Windows) is loaded into executable but read-only pages. Additional writable (and executable) pages are allocated to the process for the stack and heap.

The suggestion here is that the operating system and hardware should cooperate to mark those pages writable but not executable.

Explanation:

Answered by aman14051986
0

If we mark stack and heap segment as non executable, then we can prevent overflow code execution.

When a program runs, memory space is needed to store the data. 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.

For more related questions:

https://brainly.in/question/24893592

#SPJ6

Similar questions