L23: Buffer Overflows & System Calls

0.0(0)
studied byStudied by 0 people
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/15

encourage image

There's no tags or description

Looks like no tags are added yet.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

16 Terms

1
New cards

Creating graphical user interfaces (GUIs) across multiple platforms.

What is GTK+ used for?

2
New cards

Opaque data structures accessed via functions.

What type of data structures does GTK+ use for GUI elements?

3
New cards

strncpy().

What function should be used instead of strcpy() to avoid buffer overflows?

4
New cards

Control can be hijacked, preventing return to main()

What happens when a buffer overflow overwrites a return address on the stack?

5
New cards

On the stack.

In a 32-bit or 64-bit program, where are local variables typically stored?

6
New cards

Dumps a section of stack memory for inspection.

What does the walk() function do in the example?

7
New cards

Address Space Layout Randomization – it randomizes memory layout each run.

What is ASLR?

8
New cards

Use setarch x86_64 -R your_binary.

How can you disable ASLR for debugging purposes?

9
New cards

-fno-stack-protector and -z execstack

What compiler flags remove stack protections for testing buffer overflows?

10
New cards

System calls, page faults, signals, and hardware interrupts.

What causes a transition from user mode to kernel mode?

11
New cards

The interface between user-space processes and the OS kernel.

What are system calls?

12
New cards

open(), read(), write(), or close().

Give an example of a file-related system call.

13
New cards

You create a file descriptor leak.

What happens if you don’t call close() on a file descriptor?

14
New cards

Via registers, though they may also be stored on the stack.

How are arguments typically passed to functions in modern systems?

15
New cards

To directly insert CPU instructions for low-level control.

What is the purpose of inline assembly in C?

16
New cards

It increments the register value by 1.

What is the result of this inline assembly: add $1, %0?