Chapter 7. Walking the Stack

for RuBoard

By Rudi Martin

IN THIS CHAPTER

  • A Review of Stacks and Their Uses

  • The Security Stack Walk

  • Modifying a Stack Walk

  • The Interaction of App Domains with Stack Walks

Walking the stack ”the act of determining at runtime which methods are calling you ”is a fundamental part of the .NET Framework runtime. In particular, this technique is absolutely essential to the operation of the security system. Understanding the techniques and algorithms used is vital when considering the design and implementation of secure code.

One of the advantages that a managed environment, such as the .NET Framework, enjoys is that information that would typically be discarded under a traditional, statically compiled model is still available at runtime. This includes high-level metadata detailing classes and methods that is deployed with the code itself. Such information is vital to the runtime, but would be reduced to hardwired, raw assembly code by traditional compilers (and, in a fashion, such that the original high-level structure is no longer directly derivable).

The .NET Framework uses this knowledge of the high-level structure of client code in many ways. In this chapter, we'll talk about one specific use ”tracking the execution of code via examination of a stack trace. This technique is vital to the operation of the .NET Framework runtime. It is used in such varied areas as garbage collection and exception handling, but we'll concentrate on its use as a means of enforcing security policy.

This chapter aims to provide a quick refresher on the subject of stacks in general before moving on to how they can be employed for use enforcing code access security. Specifically, the goals of this chapter are as follows :

  • Review the terminology and use of stacks in the execution environment.

  • Show how a stack walk is performed in the .NET Framework runtime.

  • Explain the use of stack walks by the security system in the .NET Framework runtime.

  • Describe the advanced stack walk modification methods offered by the .NET Framework runtime security system.

for RuBoard


. NET Framework Security
.NET Framework Security
ISBN: 067232184X
EAN: 2147483647
Year: 2000
Pages: 235

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net