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

Memory Out-Of-Bounds Access Analysis #1094

Merged
merged 41 commits into from
Sep 28, 2023
Merged
Changes from 1 commit
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
7bb5697
Add first rough (semi-working) memory OOB analysis
mrstanb Jun 27, 2023
a5c693e
Add 2 simple regression tests for memory OOB
mrstanb Jun 27, 2023
f350745
Stick with Lattice.Unit
mrstanb Jul 1, 2023
4d5e0dc
Rewrite the majority of the logic and checks performed in memOutOfBounds
mrstanb Jul 8, 2023
098501b
Remove printf calls
mrstanb Jul 8, 2023
6496c61
Improve warning messages a bit
mrstanb Jul 8, 2023
a796a0b
Add message category for memory OOB access
mrstanb Jul 8, 2023
84e80b1
Add CWE number 823 for memory OOB access warnings
mrstanb Jul 8, 2023
a07b690
Add a global variable that indicates whether an invalid pointer deref…
mrstanb Jul 8, 2023
4c09372
Add OOB memory access regression case with a loop
mrstanb Jul 26, 2023
f90770f
Merge branch 'master' into mem-oob-analysis
mrstanb Aug 12, 2023
503fb24
Remove wrongly overtaken goblintutil.ml
mrstanb Aug 12, 2023
0c53230
Move may_invalid_deref to analysisState
mrstanb Aug 12, 2023
c07d867
Use AnalysisState in place of Goblintutil
mrstanb Aug 12, 2023
434a4c1
Enable intervals for regression tests
mrstanb Aug 20, 2023
3db3d8c
Fix memOutOfBounds analysis and make it work
mrstanb Aug 20, 2023
6e7664d
Remove unused transfer funs
mrstanb Aug 20, 2023
50777a2
Merge branch 'master' into mem-oob-analysis
mrstanb Aug 20, 2023
79d4319
Move regression tests to a correctly numbered folder
mrstanb Aug 20, 2023
84bd2cc
Add comments to 77/03 test case
mrstanb Aug 20, 2023
6ed476e
Warn for function args in enter and not in combine_assign
mrstanb Aug 21, 2023
4e7b21b
Try to check and warn only upon dereferences
mrstanb Aug 24, 2023
86b7a54
Merge branch 'master' into mem-oob-analysis
mrstanb Aug 24, 2023
291d60c
Check for OOB mem access on the address level and only warn on deref
mrstanb Aug 25, 2023
2a3aaae
Adjust the OOB mem access test case with a loop
mrstanb Aug 25, 2023
46bd81f
Add test case with pointer arithmetic and subsequent derefs
mrstanb Aug 25, 2023
37fb4e8
Refactor to_int_dom_offs
mrstanb Aug 25, 2023
ff3e644
Cover bot and top cases in to_int_dom_offs
mrstanb Aug 25, 2023
aceffa8
Allow Queries.BlobSize to be asked for the size from the start address
mrstanb Aug 31, 2023
7fb6719
Use Queries.BlobSize for getting blob sizes without address offsets
mrstanb Aug 31, 2023
0e126df
Clean up unnecessary comments
mrstanb Aug 31, 2023
293d3e7
Add check for implicit pointer dereferences in special functions
mrstanb Aug 31, 2023
e4b349a
Add a test case with implicit dereferences
mrstanb Aug 31, 2023
4746eac
Merge branch 'master' into mem-oob-analysis
michael-schwarz Sep 6, 2023
2b45499
Disable Info warnings for test case 77/05 for now
mrstanb Sep 6, 2023
9241301
Remove TODO comment and add a few other explaining comments
mrstanb Sep 6, 2023
0bae455
Use a record instead of a tuple for Queries.BlobSize
mrstanb Sep 6, 2023
f06a0f5
Add check for bot and top address offsets
mrstanb Sep 26, 2023
44a3f4d
Merge branch 'master' into mem-oob-analysis
mrstanb Sep 26, 2023
a2bea7b
Fix issues after merge with master
mrstanb Sep 27, 2023
d48f232
Merge branch 'master' into mem-oob-analysis
michael-schwarz Sep 28, 2023
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
Prev Previous commit
Next Next commit
Stick with Lattice.Unit
  • Loading branch information
mrstanb committed Jul 1, 2023
commit f3507455563fa0b9e23f25fe7dfae605d53c04ca
6 changes: 3 additions & 3 deletions src/analyses/memOutOfBounds.ml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ module Spec =
struct
include Analyses.IdentitySpec

module D = Lattice.Unit(*ValueDomain.AddrSetDomain*)
module D = Lattice.Unit
module C = Lattice.Unit

(* TODO: Do this later *)
Expand Down Expand Up @@ -186,8 +186,8 @@ struct
List.iter (fun arg -> check_exp_for_oob_access ctx arg) args;
mrstanb marked this conversation as resolved.
Show resolved Hide resolved
ctx.local

let startstate v = (*D.empty*) ()
let exitstate v = (*D.empty*) ()
let startstate v = ()
let exitstate v = ()
end

let _ =
Expand Down