Quiz 3 Flashcards

1
Q

What makes two variables aliases?

A

They reference the same memory location

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What has to decided for every pair of pointers at every program’s point?

A

Do the pointers point to the same memory location

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What are the issues that may arise when analyzing pointers?

A

Do each pair of pointers point to the same memory location?
What pointers to report that do or may alias
Which pointers are ambiguous.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What will occur with this code?
Char *p;
*p = ‘A’;

A

It may or may not result in a segmentation fault because the pointer is not initialized

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Give the alias set for the following code
int x,y;
int *p = &x;
int *q = &y;
int *r = p;
int *r = p;
int **s = &q;

A

{x, *p, *r}
{y, *q, **s}
{q, *s}

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Give the Alias for this code.
int x = 10;
int y = 20;
int *p;
if (true)
p = &x;
else
p = &y;

A

{x, *p}
{y, *p}
{p}

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is a checker?

A

A program that is defined by a state diagram with state transitions and error states

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

How does the checker runs?

A

It assigns an initial state to each program variable
States at program point depends on state at previous point, program actions
Emits an error if a error state is reached

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What are the three ways programs can be analyzed?

A

Static Analysis
Dynamic Analysis
Concolic Analysis

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What is static analysis?

A

Inspecting code or run a automated method to find errors or gain confidence about their absence

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What is dynamic analysis?

A

Running code with sample test input, possible under instrumented conditions, to see if there are likely problems

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What is concolic analysis?

A

A hybrid program verification technique that performs symbolic execution, along a concrete execution path

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What is symbolic execution?

A

A classical technique that treats program variables as symbolic variables

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What are some examples of static analysis?

A

FindBugs, Fortify, Coverity, MS Tools

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What is static analysis best used for?

A

Problem identification

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Why is static analysis best used for problem identification?

A

It checks thoroughly and consistently
Can point to the root cause of the problem
Helps find error/bugs early in development
New information can be easily incorporated to recheck a given system

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

What is program verification?

A

Checks if a given input results in a correct given output

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

What are the advantage and disadvantage of static analysis?

A

Advantage: achieves completeness
Disadvantage: suffers soundenss

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

What is the most critical component of static analysis?

A

Constructing the model using data flows, control flows and pointer analysis

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

What is static analysis used for in security?

A

Finding bugs, verifying program correctness

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

Why isn’t dynamic analysis useful on its own?

A

It doesn’t give you a good enough explanation of what went wrong when the program fails

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
22
Q

What is the leading cause of errors in C?

A

Memory corruption

23
Q

What errors does AddressSanitizer detect?

A

Out-of-bounds array accesses
Use pointer after call to free()
Use stack variables after it is out of scope
Double frees or other invalid frees
Memory leaks

24
Q

What are some issues with static analysis?

A

I can give alot of noise or unneeded information
It has both false positives and false negatives
Defects must be visible to the tool

25
Q

What is the definition of soundness in regard to static analysis?

A

Sound for reporting correctness ie if theres a bug it reports it

26
Q

What is the definition of completeness?

A

Complete for reporting correctness

27
Q

What are the properties of static analysis?

A

Considering all possible inputs
Find bugs and vulnerabilities
Could prove the absence of bugs in some cases

28
Q

What are the properties of dynamic analysis?

A

The sample test input must be chosen
Can find bug vulnerabilities but not prove their absence
Uses instrument code for testing
There is also blackbox testing for dynamic analysis: fuzzing and penetration testing

29
Q

What is valgrind?

A

A general purpose dynamic analysis tool

30
Q

What is valgrind used for?

A

Memory debugging, memory leak detection and profiling

31
Q

How does valgrind function?

A

It runs programs on a virtual machine, this gives it a large amount of arbitrary transformations on the program

32
Q

Why does valgrind have a very high overhead?

A

It shadows all program values: registers and memory, this also requires threads to be serialized

33
Q

What are two use cases where valgrind would want to be used?

A

Complex memory bugs that are not detected by simpler tools
Complex profiling tasks

34
Q

What does valgrind memcheck do?

A

Validates memory operations in a program

35
Q

How does valgrind memcheck validate mem operations in a program?

A

Each allocation is freed once
Each access is to a currently allocated space
All reads are to locations already written
this results in around 10-20x overhead

36
Q

What is the structure for instrumentation granularity?

A

Instruction
Basic Block
Trace

37
Q

What is in the basic block for instrumentation granularity?

A

A sequence of instructions
Single entry, single exit
Termination point with one control flow instruction

38
Q

What is in the trace for instrumentation granularity?

A

A sequence of executed basic block

39
Q

What is Symbolic Execution?

A

Executing the program with symbolic valued inputs

40
Q

What are some areas where symbolic execution is implemented?

A

KLEE, angr, Triton, Java PathFinder, etc

41
Q

What is the symbolic engine?

A
42
Q

What is the SMT solver?

A

A very complex mathematical solver

43
Q

What are some issues with the symbolic engine?

A

Infinite execution tree
Exponentially many paths

44
Q

What is concolic execution?

A

Combining concrete execution and symbolic execution?

45
Q

What is the intention of concolic execution?

A

To visit deep into the program execution tree

46
Q

What is Fuzzing?

A

Automated software testing

47
Q

How does fuzzing work?

A

It generates invalid unexpected or random inputs to the program

48
Q

What is dumb fuzzing?

A

Blindly mutating existing valid inputs

49
Q

What is smart fuzzing?

A

It has two principles being generation based and being guided

50
Q

What is generation based smart fuzzing?

A

Generating inputs according to protocol specification

51
Q

What is guided fuzzing?

A

Collecting feedback to guide the next round of mutations

52
Q

What is mutation based fuzing?

A

adding anomalies to existing valid inputs

53
Q

What are some examples of things changed through mutations?

A