1 of 16

CS 161 Discussion 2

Discussion Worksheet on cs161.org!

Shomil Jain

2 of 16

Announcements

HW 2 is out (due Sunday) [Buffer Overflows + Basic Encryption]

Project 1 is due next Tuesday (7/7)

There’s a really good GDB walkthrough on Piazza (see Section Slides).

Come to OH if you need help!

Moving on to encryption this week :)

3 of 16

Software Vulnerabilities

4 of 16

Buffer Overflows

Occurs when attackers write to memory regions they shouldn’t be writing to.

Attackers can force crashes, insert shellcode, or manipulate parameters/flags!

5 of 16

Stack Smashing

Occurs when attackers overwrite the return instruction pointer (RIP) to point to a desired location.

Attackers can execute shellcode!

6 of 16

Integer Conversion Vulnerabilities

When we don’t pay attention to signed & unsigned integers, bad things can happen.

Attackers can bypass bounds checking and/or allocate large amounts of memory!

7 of 16

Format String Vulnerabilities

Occurs when we don’t use the printf(...) command properly.

Attackers can...

  • Learn contents of function stack frame
  • Learn contents of any other part of memory
  • Write any value to any address in victim’s memory!

8 of 16

Do Question 1 on Worksheet

Alone // Breakout Room // Discuss

9 of 16

Do Question 2

Please use the green checkmark in Zoom to indicate when you’re done!

10 of 16

tinyurl.com/161-poll

11 of 16

Do Question 3

12 of 16

The TCB

The TCB (Trusted Computing Base) is a part of a system that must operate correctly if we want the security goals of the system to be assured.

Q: Why do we want our TCB to be as small as possible?

13 of 16

Do Question 3 on Worksheet

14 of 16

Notes

Feel free to email me at shomil@berkeley.edu with any questions about the course or anything else!

My office hours are from 3 PM - 4 PM on T/Th.

See pinned Piazza posts for link to these slides!

15 of 16

Appendix: Privilege Separation v. Least Privilege

P.S. = means

L.P = goal

You achieve least privilege by separating important privileges to different people.

16 of 16

Appendix: Least Privilege v. Separation of Responsibility

L.P. = “Can you do something?”

S.o.R = “Can you do something by yourself?

ex: two officers needed to open the blast door

LP: non-officers can’t open the door

SoR: no one officer can open the door