-
Notifications
You must be signed in to change notification settings - Fork 84
Support stack-allocating functions when allocating heap vars #1179
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
Merged
michael-schwarz
merged 22 commits into
goblint:master
from
mrstanb:stack-allocating-functions-precision
Oct 1, 2023
Merged
Changes from 15 commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
89e0074
Make HeapVar support stack allocation, update IsHeapVar and add
mrstanb 9a06189
Implement answer for IsDynamicallyAlloced
mrstanb d8c5965
Update usage of HeapVar and IsHeapVar
mrstanb 954be03
Add "alloca" as a library function
mrstanb aa97af8
Add Alloca special function type
mrstanb 6e9bb2f
Classify __builtin_alloca as Alloca and not as Malloc
mrstanb d9df607
Implement and use IsHeapVar and IsDynamicallyAlloced right
mrstanb 4c84a10
CI run fix: remove alloca from invalidate_actions
mrstanb 55a8f1e
Remove __builtin_alloca from invalidate_actions
mrstanb 21584ee
Extend UAF analysis to support alloca()
mrstanb 05a3b98
Add alloca() UAF test case
mrstanb 2fbcdb8
Add alloca() invalid dealloc test case
mrstanb 9689c8c
Merge branch 'master' into stack-allocating-functions-precision
mrstanb 5cca543
Add forgotton base_address check in BlobSize after master merge
mrstanb 4090e74
Fix __builtin_alloca classification
mrstanb 35513d0
Move all *alloca() functions to gcc_descs_list
mrstanb 432a4e3
Simply HeapVar ask in heap_var
mrstanb 3bdc92d
Extract long query ask into own function
mrstanb 7b1d298
Rename queries:
mrstanb a317421
Merge branch 'master' into stack-allocating-functions-precision
mrstanb 5f16221
Fix wrong query usage in UAF
mrstanb b1f2f2d
Fix test numbering
mrstanb File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| //PARAM: --set ana.activated[+] useAfterFree | ||
| #include <stdlib.h> | ||
| #include <alloca.h> | ||
|
|
||
| int *f() { | ||
| int *c = alloca(sizeof(int)); | ||
| return c; | ||
| } | ||
|
|
||
| int main(int argc, char const *argv[]) { | ||
| int *ps = alloca(sizeof(int)); | ||
| int *c = f(); | ||
| int a = *ps; | ||
| int b = *c; //WARN | ||
| return 0; | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.