<?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_2020W_Lecture_22</id>
	<title>Operating Systems 2020W Lecture 22 - 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_2020W_Lecture_22"/>
	<link rel="alternate" type="text/html" href="https://homeostasis.scs.carleton.ca/wiki/index.php?title=Operating_Systems_2020W_Lecture_22&amp;action=history"/>
	<updated>2026-06-02T22:24:20Z</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_2020W_Lecture_22&amp;diff=22624&amp;oldid=prev</id>
		<title>Soma: Created page with &quot;==Video==  Video from the lecture given on April 1, 2020 [https://homeostasis.scs.carleton.ca/~soma/os-2020w/lectures/comp3000-2020w-lec22-20200401.m4v is now available].  ==N...&quot;</title>
		<link rel="alternate" type="text/html" href="https://homeostasis.scs.carleton.ca/wiki/index.php?title=Operating_Systems_2020W_Lecture_22&amp;diff=22624&amp;oldid=prev"/>
		<updated>2020-04-01T20:36:47Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;==Video==  Video from the lecture given on April 1, 2020 [https://homeostasis.scs.carleton.ca/~soma/os-2020w/lectures/comp3000-2020w-lec22-20200401.m4v is now available].  ==N...&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;
Video from the lecture given on April 1, 2020 [https://homeostasis.scs.carleton.ca/~soma/os-2020w/lectures/comp3000-2020w-lec22-20200401.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 22&lt;br /&gt;
----------&lt;br /&gt;
&lt;br /&gt;
 - scheduling&lt;br /&gt;
 - start semester review&lt;br /&gt;
 - answer questions about tutorials 8, 9, and assignment 4&lt;br /&gt;
 - final exam review session&lt;br /&gt;
&lt;br /&gt;
 - multiple choice A4 questions due before lecture on Friday&lt;br /&gt;
     - will go over them in class&lt;br /&gt;
&lt;br /&gt;
 - culearn submissions for A4 multiple choice will open this evening&lt;br /&gt;
     - just fiddling with cuLearn&lt;br /&gt;
     - note that answers may be randomized relative to those&lt;br /&gt;
       on the wiki, so make sure you select the right answers&lt;br /&gt;
     - there&amp;#039;s no time limit, but has to be completed by 2:30 PM Friday&lt;br /&gt;
     &lt;br /&gt;
 - will also open submissions to short answers for A4&lt;br /&gt;
     - completely optional, but should be also submitted by class&lt;br /&gt;
       on Friday as I will distribute solutions to them&lt;br /&gt;
     - If you mess up on the multiple choice questions but&lt;br /&gt;
       submit the short answers, we can grade them, but&lt;br /&gt;
       only on request&lt;br /&gt;
&lt;br /&gt;
 - Final exam review session&lt;br /&gt;
     - April 9th, 2:30 PM if that works for everyone?&lt;br /&gt;
        - please answer the poll, if too many people can&amp;#039;t&lt;br /&gt;
	  make it will consider other times&lt;br /&gt;
     - will livestream and record as usual, can ask questions in advance&lt;br /&gt;
       (and of course on discord)&lt;br /&gt;
     - will go through topics as before for midterm&lt;br /&gt;
&lt;br /&gt;
 - Final exam on April 13, 7 PM&lt;br /&gt;
     - will post on cuLearn at 7 PM&lt;br /&gt;
     - upload solutions as a text file by 9 PM&lt;br /&gt;
     - open book, open internet, but NO COLLABORATION&lt;br /&gt;
     - if you have PMC accommodations, submit after your extra time&lt;br /&gt;
       (i.e, with 50% more time, submit by 10 PM)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Thoughts related to Zoom&lt;br /&gt;
 - if you download and run code in Linux, normally this code has full access&lt;br /&gt;
   as whatever user runs the program&lt;br /&gt;
     - so if I run a program, it can do everything that I can do as a user&lt;br /&gt;
 - this is potentially a problem with proprietary software, because&lt;br /&gt;
   who knows what it could do?&lt;br /&gt;
&lt;br /&gt;
Linux distributions have developed ways to distribute software outside of normal packaging&lt;br /&gt;
 - big concern: limiting access of third party code&lt;br /&gt;
 - unlike software coming from the distribution, there&amp;#039;s been no&lt;br /&gt;
   third party review&lt;br /&gt;
&lt;br /&gt;
snap and flatpak are two standards for distributing software for linux systems&lt;br /&gt;
in a self-contained way&lt;br /&gt;
 - allows third party to update code separately from linux distribution&lt;br /&gt;
 - works accross linux distributions&lt;br /&gt;
 - key idea: installed software is confined in some way (generally)&lt;br /&gt;
&lt;br /&gt;
snaps are confined in multiple ways&lt;br /&gt;
 - have their own filesystem, with local resources mounted to specified locations in their filesystem&lt;br /&gt;
    - can&amp;#039;t access files outside of their filesystem by default&lt;br /&gt;
 - yes, this is a kind of container!&lt;br /&gt;
&lt;br /&gt;
This sort of confinement is standard practice on iOS&lt;br /&gt;
 - Android has per-app permissions but Android apps aren&amp;#039;t as isolated&lt;br /&gt;
   as iOS apps (but they have gotten much closer in more recent releases&lt;br /&gt;
   of both systems)&lt;br /&gt;
&lt;br /&gt;
 - Microsoft was trying to push similar tech with their app store,&lt;br /&gt;
   but that hasn&amp;#039;t had as much traction due to legacy app concerns&lt;br /&gt;
   (and protests from existing software developers, companies)&lt;br /&gt;
&lt;br /&gt;
 - Apple is trying to make 3rd party apps more confined when installed&lt;br /&gt;
   through the Mac app store, but they also have push back (but have&lt;br /&gt;
   been more successful than Microsoft)&lt;br /&gt;
&lt;br /&gt;
Classic desktop environments didn&amp;#039;t confine apps, so confinement was really developed for mobile systems and is being retrofitted onto desktops and servers.&lt;br /&gt;
&lt;br /&gt;
If I&amp;#039;m going to install software that isn&amp;#039;t part of Ubuntu, I try to do it with a snap if at all possible.  (Ubuntu -&amp;gt; snap, Red Hat -&amp;gt; flatpak)&lt;br /&gt;
&lt;br /&gt;
snaps have no performance reduction, except that snaps can take up more disk and RAM&lt;br /&gt;
  - use their own libraries for portability, can&amp;#039;t depend on what comes&lt;br /&gt;
    with the distribution&lt;br /&gt;
&lt;br /&gt;
the &amp;quot;zoom sending to facebook&amp;quot; thing seems to be them using the Facebook SDK to add &amp;quot;login with facebook&amp;quot; functionality and it phoning home by default&lt;br /&gt;
  - but when you dig deeper there are a number of other shady things,&lt;br /&gt;
    like leaving code around after an uninstall so zoom will be auto-installed&lt;br /&gt;
    when a user attempts to join a zoom call (on MacOS I believe)&lt;br /&gt;
&lt;br /&gt;
snaps are completely optional, the base ubuntu system doesn&amp;#039;t use it except for a few popular apps (e.g., chromium)&lt;br /&gt;
&lt;br /&gt;
process-control allows you to control arbitrary processes (not sure the mechanism, but I assume send signals, run ptrace, etc).  I think it is just for processes you own, but that is bad enough.  (I hope it isn&amp;#039;t for all system processes but it may be!)&lt;br /&gt;
&lt;br /&gt;
you can control privileges granted to zoom when in a snap - but you can&amp;#039;t if&lt;br /&gt;
 you install it with a .deb (the default)&lt;br /&gt;
&lt;br /&gt;
It is always safer to run apps in a browser rather than installing them&lt;br /&gt;
  - installed versions always have more privileges&lt;br /&gt;
  - code in browsers is carefully isolated (sandboxed)&lt;br /&gt;
&lt;br /&gt;
ubuntu software center installs debs and snaps&lt;br /&gt;
  - I believe it is curated, FWIW&lt;br /&gt;
  - confinement only happens with snaps&lt;br /&gt;
&lt;br /&gt;
When we talk about software in Linux distributions, all software isn&amp;#039;t equally trusted&lt;br /&gt;
 - there is always a &amp;quot;main&amp;quot; repository and then extra ones&lt;br /&gt;
 - you can trust the main one (you have to, have no choice), but&lt;br /&gt;
   the other repositories, it depends&lt;br /&gt;
&lt;br /&gt;
In ubuntu terms, main is the most trustworthy, while universe, multiverse,&lt;br /&gt;
and restricted are less trustworthy (probably okay but only install what you really use).&lt;br /&gt;
&lt;br /&gt;
Then there are snaps (confined mostly, but depends), ppa&amp;#039;s (specific repositories for apps, often put together by original developers, e.g. bcc has a ppa, no confinement).  There it depends too&lt;br /&gt;
&lt;br /&gt;
Always risks when installing software!&lt;br /&gt;
&lt;br /&gt;
A &amp;quot;jail break&amp;quot; is breaking the app-level confinement on iOS devices.  So while it lets you do more, it also fundamentally reduces your security because apps are no longer confined (jailed).&lt;br /&gt;
  - jail is an old BSD tech for confining applications,&lt;br /&gt;
    genesis of many ideas around modern containers&lt;br /&gt;
&lt;br /&gt;
This material is not covered in the assignments or tutorials&lt;br /&gt;
  - so purely optional&lt;br /&gt;
  - however, if you can&amp;#039;t follow what I&amp;#039;m saying you may be missing&lt;br /&gt;
    certain key concepts from earlier&lt;br /&gt;
&lt;br /&gt;
Browser extensions are essentially web pages with limited confinement&lt;br /&gt;
  - they have permissions, but they get much more access (by default and&lt;br /&gt;
    with commonly asked for permissions) than regular pages&lt;br /&gt;
  - it is normal for a browser extension to see every URL you type in,&lt;br /&gt;
  - it is also normal for extensions to be able to mess with the contents&lt;br /&gt;
    of any page and to access and change arbitrary files&lt;br /&gt;
    (regular web pages can&amp;#039;t do this!)&lt;br /&gt;
  - so again only install browser extensions if you really need them,&lt;br /&gt;
    and then consider ways to restrict them (limit permissions, use&lt;br /&gt;
    multiple browser profiles)&lt;br /&gt;
&lt;br /&gt;
Containers are a browser-level way to confine information&lt;br /&gt;
 - limit scope of cookies, other saved data&lt;br /&gt;
 - can limit tracking and other attacks&lt;br /&gt;
&lt;br /&gt;
Chrome has profiles (different &amp;quot;users&amp;quot;) apparently, but I don&amp;#039;t think they&lt;br /&gt;
have a container equivalent&lt;br /&gt;
&lt;br /&gt;
Note general theme: put things in boxes to improve security!&lt;br /&gt;
 - too many kinds of boxes&lt;br /&gt;
&lt;br /&gt;
The actual memory allocators in the Linux kernel are outside the scope&lt;br /&gt;
of this class&lt;br /&gt;
 - tutorial 8 shows a bit of what is going on under the hood, but&lt;br /&gt;
   that is just a start&lt;br /&gt;
 - is not in the assignments and thus won&amp;#039;t be on the final&lt;br /&gt;
&lt;br /&gt;
#define headers&lt;br /&gt;
&lt;br /&gt;
remeber in C we have the C compiler and the C pre-processor&lt;br /&gt;
 - everything starting with # is a pre-processor directive&lt;br /&gt;
 - can define and run macros that change C code in lots of ways&lt;br /&gt;
     - people have used it to turn C into almost a completely&lt;br /&gt;
       different language&lt;br /&gt;
 - pre-processor directives can be added at compile time with -D&lt;br /&gt;
    - equivalent to #define in the source code&lt;br /&gt;
    - allows a way to change how code is compiled without&lt;br /&gt;
      changing the code itself (just change a #define on the command line&lt;br /&gt;
      using -D)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
When you see a variable starting with __ in C source code, it normally&lt;br /&gt;
means it is private in some way&lt;br /&gt;
 - this isn&amp;#039;t part of the API&lt;br /&gt;
 - this isn&amp;#039;t the function or variable you are looking for,&lt;br /&gt;
   move along!&lt;br /&gt;
 - (note that C doesn&amp;#039;t restrict the scope of functions so need&lt;br /&gt;
    conventions to say what is internal and what isn&amp;#039;t)&lt;br /&gt;
&lt;br /&gt;
Remember system calls are a different thing than function calls&lt;br /&gt;
 - invoked directly from userspace using a special assembly language instruction&lt;br /&gt;
 - as a result, when you get into the kernel, system call code isn&amp;#039;t&lt;br /&gt;
   called like a normal C function.  We need assembly glue code&lt;br /&gt;
 - special declaration of system call entry functions takes care of the&lt;br /&gt;
   glue code.  Once we&amp;#039;re past it, we can just call normal C functions&lt;br /&gt;
&lt;br /&gt;
Don&amp;#039;t think about weird things like drop_caches for Q1 on A4&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Soma</name></author>
	</entry>
</feed>