Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

draft definitions of memory safety and undefined behavior #12

Merged
merged 2 commits into from
Nov 2, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 39 additions & 0 deletions docs/definitions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Useful Definitions

The document contains some useful definitions used in this group's work.

## Memory Safe by Default

[Based off the definition in wikipedia](https://en.wikipedia.org/wiki/Memory_safety).

A memory safe by default language prevents (by default) common memory safety vulnerabilities, including:

**Access errors (invalid read/write of a pointer)**

* Buffer overflow
* Buffer over-read
* Race condition - concurrent read/writes to shared memory
* Invalid page fault
* Use after free

**Uninitialized variables (variable that has not been assigned a value is used)**

* Null pointer deference
* Wild pointers

**Memory leak (memory usage is not tracked or is tracked incorrectly)**

* Stack exhaustion
* Heap exhaustion
* Double free
* Invalid free
* Mismatched free
* Unwanted aliasing

## Undefined Behavior

[From the definition in the Stack Overflow Wiki](https://stackoverflow.com/tags/undefined-behavior/info).

"In computer programming, undefined behavior (informally "UB") refers to computer code whose behavior is not specified by the programming language standard under certain conditions.

The standards for some languages, most notably C and C++, leave certain aspects undefined, meaning the standard imposes no requirements whatsoever on the outcome. Implementations may regard such actions as erroneous, diagnosing them or not as they see fit, or may specify that they behave in some possibly-useful fashion without regard for whether the Standard requires them to do so."