Quiz 3 Flashcards

(53 cards)

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
What is the definition of soundness in regard to static analysis?
Sound for reporting correctness ie if theres a bug it reports it
26
What is the definition of completeness?
Complete for reporting correctness
27
What are the properties of static analysis?
Considering all possible inputs Find bugs and vulnerabilities Could prove the absence of bugs in some cases
28
What are the properties of dynamic analysis?
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
What is valgrind?
A general purpose dynamic analysis tool
30
What is valgrind used for?
Memory debugging, memory leak detection and profiling
31
How does valgrind function?
It runs programs on a virtual machine, this gives it a large amount of arbitrary transformations on the program
32
Why does valgrind have a very high overhead?
It shadows all program values: registers and memory, this also requires threads to be serialized
33
What are two use cases where valgrind would want to be used?
Complex memory bugs that are not detected by simpler tools Complex profiling tasks
34
What does valgrind memcheck do?
Validates memory operations in a program
35
How does valgrind memcheck validate mem operations in a program?
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
What is the structure for instrumentation granularity?
Instruction Basic Block Trace
37
What is in the basic block for instrumentation granularity?
A sequence of instructions Single entry, single exit Termination point with one control flow instruction
38
What is in the trace for instrumentation granularity?
A sequence of executed basic block
39
What is Symbolic Execution?
Executing the program with symbolic valued inputs
40
What are some areas where symbolic execution is implemented?
KLEE, angr, Triton, Java PathFinder, etc
41
What is the symbolic engine?
42
What is the SMT solver?
A very complex mathematical solver
43
What are some issues with the symbolic engine?
Infinite execution tree Exponentially many paths
44
What is concolic execution?
Combining concrete execution and symbolic execution?
45
What is the intention of concolic execution?
To visit deep into the program execution tree
46
What is Fuzzing?
Automated software testing
47
How does fuzzing work?
It generates invalid unexpected or random inputs to the program
48
What is dumb fuzzing?
Blindly mutating existing valid inputs
49
What is smart fuzzing?
It has two principles being generation based and being guided
50
What is generation based smart fuzzing?
Generating inputs according to protocol specification
51
What is guided fuzzing?
Collecting feedback to guide the next round of mutations
52
What is mutation based fuzing?
adding anomalies to existing valid inputs
53
What are some examples of things changed through mutations?