<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://homeostasis.scs.carleton.ca/wiki/index.php?action=history&amp;feed=atom&amp;title=Operating_Systems_2019F_Lecture_23</id>
	<title>Operating Systems 2019F Lecture 23 - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://homeostasis.scs.carleton.ca/wiki/index.php?action=history&amp;feed=atom&amp;title=Operating_Systems_2019F_Lecture_23"/>
	<link rel="alternate" type="text/html" href="https://homeostasis.scs.carleton.ca/wiki/index.php?title=Operating_Systems_2019F_Lecture_23&amp;action=history"/>
	<updated>2026-06-03T01:19:42Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.42.1</generator>
	<entry>
		<id>https://homeostasis.scs.carleton.ca/wiki/index.php?title=Operating_Systems_2019F_Lecture_23&amp;diff=22545&amp;oldid=prev</id>
		<title>Soma: Created page with &quot;==Video==  The video for the lecture given on November 29, 2019 [https://homeostasis.scs.carleton.ca/~soma/os-2019f/lectures/comp3000-2019f-lec23-20191129.m4v is now available...&quot;</title>
		<link rel="alternate" type="text/html" href="https://homeostasis.scs.carleton.ca/wiki/index.php?title=Operating_Systems_2019F_Lecture_23&amp;diff=22545&amp;oldid=prev"/>
		<updated>2020-03-20T02:11:30Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;==Video==  The video for the lecture given on November 29, 2019 [https://homeostasis.scs.carleton.ca/~soma/os-2019f/lectures/comp3000-2019f-lec23-20191129.m4v is now available...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;==Video==&lt;br /&gt;
&lt;br /&gt;
The video for the lecture given on November 29, 2019 [https://homeostasis.scs.carleton.ca/~soma/os-2019f/lectures/comp3000-2019f-lec23-20191129.m4v is now available].&lt;br /&gt;
&lt;br /&gt;
==Notes==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Lecture 23&lt;br /&gt;
----------&lt;br /&gt;
lecture will start at 4:05&lt;br /&gt;
&lt;br /&gt;
Review session (Q&amp;amp;A)&lt;br /&gt;
 * December 13, 3 PM?&lt;br /&gt;
 * will reserve room and annouce if time is okay&lt;br /&gt;
 * will not be recorded, but I will be available for questions on discord&lt;br /&gt;
&lt;br /&gt;
Last class, Dec. 4th: discussing Assignment 4 solutions, topics for exam&lt;br /&gt;
 - the quiz will come out on Monday, Dec. 2nd by 4 PM on cuLearn&lt;br /&gt;
 - you&amp;#039;ll have 48 hours to do the quiz&lt;br /&gt;
 - will be multiple choice&lt;br /&gt;
&lt;br /&gt;
Final exam is on Dec. 17th, 7 PM&lt;br /&gt;
 - AH, rows 12-23 (Alumni Hall)&lt;br /&gt;
 - 2 hours to do the final&lt;br /&gt;
&lt;br /&gt;
Please do course evaluations&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Security in Linux, and my research&lt;br /&gt;
&lt;br /&gt;
How do you defend yourself?&lt;br /&gt;
&lt;br /&gt;
What is your threat model?&lt;br /&gt;
 - strong encryption doesn&amp;#039;t prevent a sledgehammer attack&lt;br /&gt;
 - cryptography is not security, but it can be useful when trying to achieve&lt;br /&gt;
   security&lt;br /&gt;
&lt;br /&gt;
Malicious mobile software &amp;amp; operating systems&lt;br /&gt;
&lt;br /&gt;
Morris Worm&lt;br /&gt;
 - computer worm (program that can move between systems on its own,&lt;br /&gt;
   often malicious but not necessarily)&lt;br /&gt;
 - propagated across most of the then internet (in 1988)&lt;br /&gt;
 - was supposed to be a benign experiment, but crashed a huge number of&lt;br /&gt;
   systems&lt;br /&gt;
&lt;br /&gt;
Used multiple exploits&lt;br /&gt;
 - e.g., sendmail, finger - common services UNIX systems used to run&lt;br /&gt;
   - sendmail was for receiving email&lt;br /&gt;
   - finger answered queries about what users were active on a system,&lt;br /&gt;
     e.g. finger soma@homeostasis.scs.carleton.ca would tell you whether&lt;br /&gt;
     I was logged in, what my phone number was, and what my &amp;quot;plan&amp;quot; was&lt;br /&gt;
 - these programs were listening for connections, and the Morris worm&lt;br /&gt;
   compromised them and used them to run its own code&lt;br /&gt;
&lt;br /&gt;
How can you take over a program by sending it data?&lt;br /&gt;
 - code injection exploits&lt;br /&gt;
 - classic form: buffer overflow attacks&lt;br /&gt;
&lt;br /&gt;
Basic idea of a buffer overflow&lt;br /&gt;
 - give a program an input that is too large for a buffer that is on the stack&lt;br /&gt;
 - program is stupid, writes past end of buffer&lt;br /&gt;
 - in writing past the end of the buffer, it overwrites&lt;br /&gt;
   function return addresses&lt;br /&gt;
 - attacker sets the return address to one where they have stored&lt;br /&gt;
   their own machine code (in the buffer that was overflowed)&lt;br /&gt;
 - this machine code would do an execve of a shell or something else&lt;br /&gt;
   (hence &amp;quot;shellcode&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
To learn more about classic buffer overflows, see http://phrack.org/issues/49/14.html (Stack Smashing for Fun and Profit)&lt;br /&gt;
&lt;br /&gt;
But you should know...classic buffer overflow attacks don&amp;#039;t work anymore&lt;br /&gt;
&lt;br /&gt;
Because operating systems changed&lt;br /&gt;
 - they got built-in protections&lt;br /&gt;
&lt;br /&gt;
The real advantage of Rust is it makes memory corruption much easier to avoid&lt;br /&gt;
&lt;br /&gt;
But we have other mitigations&lt;br /&gt;
&lt;br /&gt;
Remember when we did 3000memview in Tutorial 3?  The addresses kept changing?&lt;br /&gt;
 - this was to make buffer overflow attacks break&lt;br /&gt;
 - because if you overwrite the return address, you better know where to&lt;br /&gt;
   jump - and if you don&amp;#039;t, you&amp;#039;ll just crash the process&lt;br /&gt;
&lt;br /&gt;
Another change is non-executable memory&lt;br /&gt;
 - attacker injects code into a buffer on the stack&lt;br /&gt;
 - on modern systems, this memory is not marked executable&lt;br /&gt;
 - so if an attacker tries to run code there, it won&amp;#039;t run&lt;br /&gt;
&lt;br /&gt;
Interestingly enough, x86 processors didn&amp;#039;t really allow you to do this&lt;br /&gt;
on a per-page basis&lt;br /&gt;
 - read/execute for a page was one bit, if you had one you had the other&lt;br /&gt;
 - required the processor to change to give support&lt;br /&gt;
&lt;br /&gt;
A lot of the changes nowadays to operating systems and CPUs at a low&lt;br /&gt;
level are to add security features or to remove old features that&lt;br /&gt;
caused security problems&lt;br /&gt;
&lt;br /&gt;
So classic buffer overflow attacks were broken by randomized memory layouts and no-execute memory...so what did attackers do?&lt;br /&gt;
 - they created new memory corruption attacks (e.g. return-to-libc, return&lt;br /&gt;
   oriented programming)&lt;br /&gt;
 - they adapted&lt;br /&gt;
&lt;br /&gt;
Computer security is stuck in a vicious arms race&lt;br /&gt;
 - defenders come up with defenses, attackers find ways around them&lt;br /&gt;
 - this is not inevitable&lt;br /&gt;
&lt;br /&gt;
If your defenses are very specific, they invite attackers to circumvent them&lt;br /&gt;
&lt;br /&gt;
My view: accept that systems are imperfect.  There will be ways to&lt;br /&gt;
exploit them.  How do we deal?&lt;br /&gt;
&lt;br /&gt;
Does any other system have &amp;quot;no&amp;quot; vulnerabilities?&lt;br /&gt;
 - not people, not tanks!&lt;br /&gt;
&lt;br /&gt;
Key differences&lt;br /&gt;
 - do you know when you&amp;#039;ve been hurt or at risk?&lt;br /&gt;
 - can you react meaningfully?&lt;br /&gt;
&lt;br /&gt;
Future OS-level security defenses should accept that the computer will be&lt;br /&gt;
vulnerable, and should act accordingly&lt;br /&gt;
&lt;br /&gt;
Classically, this framing of the problem has fallen under&lt;br /&gt;
anomaly-based intrusion detection&lt;br /&gt;
&lt;br /&gt;
Most intrusion detection is either&lt;br /&gt;
 - signature based (patterns of attacks, blacklist)&lt;br /&gt;
 - specification based (patterns of legal behavior, whitelist)&lt;br /&gt;
&lt;br /&gt;
These aren&amp;#039;t tenable strategies for security, because we can never have&lt;br /&gt;
perfect whitelists or blacklists&lt;br /&gt;
&lt;br /&gt;
What people do is assess risk based on past activity&lt;br /&gt;
 - can be very complex, but at base it is just &amp;quot;is this what I expect&amp;quot;&lt;br /&gt;
 - consider a guard in a large building&lt;br /&gt;
   - they get to know who belongs or not&lt;br /&gt;
&lt;br /&gt;
How could an operating system assess risk?&lt;br /&gt;
 - it should take cues from simpler living systems, not just people&lt;br /&gt;
 - can it tell when things have changed?  Can it then react?&lt;br /&gt;
&lt;br /&gt;
eBPF is really exciting to me because it allows for many potential ways&lt;br /&gt;
to assess risk&lt;br /&gt;
 - you can introspect on almost any part of the system&lt;br /&gt;
&lt;br /&gt;
I&amp;#039;ve built systems like this (see my dissertation)&lt;br /&gt;
&lt;br /&gt;
Right now, though, they aren&amp;#039;t suitable for general use because of a&lt;br /&gt;
simple problem&lt;br /&gt;
 - we don&amp;#039;t know what to do with systems that really monitor themselves or us&lt;br /&gt;
 - the &amp;quot;clippy&amp;quot; problem&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
security as a social problem, not a pure technical problem&lt;br /&gt;
 - involves providing value beyond protection&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Soma</name></author>
	</entry>
</feed>