<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://homeostasis.scs.carleton.ca/wiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Luc</id>
	<title>Soma-notes - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://homeostasis.scs.carleton.ca/wiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Luc"/>
	<link rel="alternate" type="text/html" href="https://homeostasis.scs.carleton.ca/wiki/index.php/Special:Contributions/Luc"/>
	<updated>2026-06-02T22:42:08Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.42.1</generator>
	<entry>
		<id>https://homeostasis.scs.carleton.ca/wiki/index.php?title=SystemsSec_2018W_Lecture_20&amp;diff=21602</id>
		<title>SystemsSec 2018W Lecture 20</title>
		<link rel="alternate" type="text/html" href="https://homeostasis.scs.carleton.ca/wiki/index.php?title=SystemsSec_2018W_Lecture_20&amp;diff=21602"/>
		<updated>2018-03-31T05:36:42Z</updated>

		<summary type="html">&lt;p&gt;Luc: /* Notes */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Audio==&lt;br /&gt;
&lt;br /&gt;
[https://homeostasis.scs.carleton.ca/~soma/systemssec-2018w/lectures/comp4108-2018w-lec20-26Mar2018.m4a Lecture 20 Audio]&lt;br /&gt;
&lt;br /&gt;
==Notes==&lt;br /&gt;
Senses of Virtual:&lt;br /&gt;
	JVM/CLR&lt;br /&gt;
	Hardware virtual machines&lt;br /&gt;
	--&amp;gt; Hypervisors&lt;br /&gt;
	Virtual Memory&lt;br /&gt;
	Virtual Reality&lt;br /&gt;
	Virtual Functions&lt;br /&gt;
	VFS Layer (Virtual File System)&lt;br /&gt;
	&lt;br /&gt;
What is really meant by virtual in this context?&lt;br /&gt;
-Portability&lt;br /&gt;
-Hardware -&amp;gt; Software (Made into)&lt;br /&gt;
-Level of abstraction&lt;br /&gt;
--Resource Abstraction&lt;br /&gt;
&lt;br /&gt;
  Subject ---&amp;gt; Resource&lt;br /&gt;
	^Virtualization breaks this connection, becoming:&lt;br /&gt;
&lt;br /&gt;
  Subject		---&amp;gt;Resource&lt;br /&gt;
    |-----&amp;gt; Abstraction |&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
File containing digits of pi, is really just a function that generates digits&lt;br /&gt;
From the perspective of the Subject the Abstraction is the resource, it&#039;s the same thing as having an actual file&lt;br /&gt;
&lt;br /&gt;
Why is this a general strategy for security?&lt;br /&gt;
	Abstraction is a means of control&lt;br /&gt;
	Controlling the abstraction controls what the subject perceives. It&#039;s not what is actual there, it&#039;s keeping the subject &amp;quot;safe&amp;quot;&lt;br /&gt;
	Social control?&lt;br /&gt;
		Buy into an abstraction of reality&lt;br /&gt;
	Abstraction&lt;br /&gt;
		Tool for how people perceive reality&lt;br /&gt;
		Civil instutions, money, politics&lt;br /&gt;
		Live in the real world, but abstraction within out minds&lt;br /&gt;
		Lots of power in abstractions&lt;br /&gt;
		Abstraction is a method of control&lt;br /&gt;
		&lt;br /&gt;
Note: By controlling the abstraction we can enforce security properties that would otherwise be very difficult.&lt;br /&gt;
&lt;br /&gt;
Virtual Memory&lt;br /&gt;
	Each program gets it&#039;s own memory&lt;br /&gt;
	You can escape the box when you can&#039;t see the box&lt;br /&gt;
	All the memory they see, is their&#039;s&lt;br /&gt;
	It thinks it has its whole address range&lt;br /&gt;
	Enforces memory safety in allocation, but also prevents programs of messing with eachother&lt;br /&gt;
&lt;br /&gt;
Virtual Functions&lt;br /&gt;
	A place you can excicibit control&lt;br /&gt;
	Basically a direction table&lt;br /&gt;
	But also leads to less to security in the sense that the table can be manipulated&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Hardware Virtual Machines&lt;br /&gt;
	OS is running, thinks it&#039;s accessing the hardware, but it is accessing the hypervisor. THis allows for &amp;quot;windows in a window&amp;quot;, multiple os running&lt;br /&gt;
	Unfortunately&lt;br /&gt;
		Somethings go to the abstraction, some go to resources&lt;br /&gt;
		Running directly on the CPU/Memory, go straight to cpu, why? faster/simpler&lt;br /&gt;
	When does hypervisor come in?&lt;br /&gt;
		When you want to anything that normally requires privileges&lt;br /&gt;
			Change page tables&lt;br /&gt;
			Allocate memory&lt;br /&gt;
			Access the disk&lt;br /&gt;
		These get routed through the hypervisor&lt;br /&gt;
		How?&lt;br /&gt;
			Classic OS:&lt;br /&gt;
				Processes&lt;br /&gt;
				[System calls]&lt;br /&gt;
				OS - Kernel&lt;br /&gt;
				[Hypervisor (Provides a hardware-like interface to the Kernel)]&lt;br /&gt;
				Hardware&lt;br /&gt;
&lt;br /&gt;
Process interacts with the Kernel through System calls&lt;br /&gt;
Function Call vs System&lt;br /&gt;
	Function is a jump to another bit of code in the address space&lt;br /&gt;
		Access space of the process&lt;br /&gt;
	System call&lt;br /&gt;
		Access something out of the address space&lt;br /&gt;
		Special CPU instruction / Software interrupt&lt;br /&gt;
		What is an interrupt?&lt;br /&gt;
			Are CPU mechanism which allows the CPU to be interrupted&lt;br /&gt;
			Logical equivalent to office talking to student. Someone knocks on the door. Hold on let me talk to him. (Interrupt)&lt;br /&gt;
			Not part of the normal execution path&lt;br /&gt;
			External signal &lt;br /&gt;
			Interrupt Table&lt;br /&gt;
				List of: Interrupt -&amp;gt; address&lt;br /&gt;
			Addresses here are the addresses in the Kernel Memory&lt;br /&gt;
			Normal CPU runs in usermode&lt;br /&gt;
			Usermode doesn&#039;t have access to all resources, CPU has supervisor mode, which see&#039;s everything&lt;br /&gt;
			**Code for interrupt runs in supervisor mode&lt;br /&gt;
			Keyboard presses, calls interrupt&lt;br /&gt;
		What is hardware virtualization?&lt;br /&gt;
			You give the Kernel a fake interrupt table&lt;br /&gt;
			Modern CPU support Hypervisor&lt;br /&gt;
			Whenever a privileged operation is run, it goes through the hypervisors Interrupt table. &lt;br /&gt;
			System call:&lt;br /&gt;
				Normally&lt;br /&gt;
					Userspace (proc)-&amp;gt; System call  -&amp;gt; Kernel&lt;br /&gt;
					(Special Instruction, cpu changes to supervisor code)&lt;br /&gt;
				Hypervisor&lt;br /&gt;
					Userspace (proc) -&amp;gt; Hypervisor -&amp;gt; Kernel&lt;br /&gt;
					(Same as normal, but with middleman. &lt;br /&gt;
					&lt;br /&gt;
				Ring 0 - 3 Privledge levels on CPU&lt;br /&gt;
				Modern system has Ring -1 -&amp;gt; 3&lt;br /&gt;
				Ring -1 is the Hypervisor&lt;br /&gt;
				Allows the hypervisor to choose with Kerne gets the operation&lt;br /&gt;
				&lt;br /&gt;
				&lt;br /&gt;
			Guest knowing about the hypervisor is dangerou sin a secuirty sense&lt;br /&gt;
				Expanded interface, lines of communication that you didn&#039;t have before&lt;br /&gt;
				What prevents the guest from compromising the hypervisor?&lt;br /&gt;
				Information leakage&lt;br /&gt;
				Possible or prcoess to see the other kernels (Same physical memory / cpu)&lt;br /&gt;
			Language run times mostly just go through the abstraction and never have a direct connection to the resources&lt;br /&gt;
			&lt;br /&gt;
			JVM call some methods that have more provledgess that you do. Equivalents of sudo / setuid. All inside the same address space, enforce permission boundaries inside one address space, have to use software for midigation.&lt;/div&gt;</summary>
		<author><name>Luc</name></author>
	</entry>
</feed>