CS503_OperatingSystems_Hw2Answers

CS503_OperatingSyste - HAMZA BIN SOHAIL HOMEWORK 2 Question 1 Issue In Xinu back-to-back layout of process stack memory implies that stack overflow

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
HAMZA BIN SOHAIL HOMEWORK 2 Question 1: Issue: In Xinu, back-to-back layout of process stack memory implies that stack overflow in one process may corrupt the process stack of another. Without MMU (memory management hardware) support, it is difficult to prevent stack overflow corruption To what extent can increased kernel vigilance such as checking of stack pointer values during context switching help avoid stack overflow? Checking of stack pointer values at context switching time would be of little use since the process stack can overflow during the time that process is executing. So if the current process stack overflows, it could corrupt the process stack next to it before the scheduler wakes up. The scheduler would know about the stack overflow AFTER the damage has been done. Therefore, checking the stack pointer values during context switching does not eliminate the possibility of stack overflow Can such a solution guarantee that stack overflow does not occur? As mentioned before, checking the stack pointer value during context switching cannot guarantee that stack overflow would not occur. An alternative approach that does not require hardware support is compiler based stack overflow prevention. Please keep in mind that the primary goal is to contain the impact that an ill-behaving (by bug or malicious intent) process can have on other processes. For example, a compiler might inject extra range checking code when compiling function calls with the aim of detecting stack overflow at run-time before it occurs. Is this approach guaranteed to work? This is a reasonable approach to ensure the stack does not overflow. However, we would want to make sure that range checking code is inserted for any instruction that manipulates the process stack. However the approach has certain pitfalls. Pros: a) No System-wide performance impact: This approach does not affect the performance of other (user and system) programs.
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Cons: a) Code Blotting: One of the obvious cons associated with this technique is that the executable code gets bloated with error checking code and the final executable can be many times slower than the speed of the program without using the error checking code b) Performance hit: The performance hit can be substantially high since range checking is done for almost every memory reference (there would be a large number of comparison operations in the executable). For programs having a large number of pointers and arrays, this can lead to a huge performance degradation. The approach is not flawless. If a malicious user somehow manages to branch execution of this process to a its malicious function, then the process has been hijacked. If the malicious function has been placed in the user space of the victim process, then even compiler-based range checking technique is defeated References: [1] http://www.patentstorm.us/patents/7181733-claims.html [2] K. Lhee and S. J. Chapin. Type-assisted dynamic buffer overflow detection. In Proceedings of the 11th USENIX Security Symposium, pages 81--90, August 2002
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 05/14/2008 for the course CS 503 taught by Professor Kihongpark during the Spring '07 term at Purdue University-West Lafayette.

Page1 / 7

CS503_OperatingSyste - HAMZA BIN SOHAIL HOMEWORK 2 Question 1 Issue In Xinu back-to-back layout of process stack memory implies that stack overflow

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online