Skip to content
Open
Show file tree
Hide file tree
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
12 changes: 11 additions & 1 deletion rust/ql/lib/codeql/rust/frameworks/stdlib/alloc.model.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,4 +55,14 @@ extensions:
- ["<alloc::string::String as core::ops::arith::Add>::add", "Argument[0].Reference", "ReturnValue", "taint", "manual"]
# Vec
- ["alloc::vec::from_elem", "Argument[0]", "ReturnValue.Element", "value", "manual"]
- ["<alloc::vec::Vec as core::ops::deref::Deref>::deref", "Argument[self].Reference.Element", "ReturnValue.Reference.Element", "value", "manual"]
- ["<alloc::vec::Vec as core::ops::deref::Deref>::deref", "Argument[self].Reference.Element", "ReturnValue.Reference.Element", "value", "manual"]
- addsTo:
pack: codeql/rust-all
extensible: neutralModel
data:
- ["<alloc::vec::Vec as core::convert::From>::from", "sink", "manual"]
- ["<alloc::collections::vec_deque::VecDeque as core::convert::From>::from", "sink", "manual"]
- ["<alloc::sync::Arc as core::convert::From>::from", "sink", "manual"]
- ["<alloc::rc::Rc as core::convert::From>::from", "sink", "manual"]
- ["<alloc::string::String>::split_off", "sink", "manual"]
- ["<alloc::vec::Vec>::split_off", "sink", "manual"]
4 changes: 0 additions & 4 deletions rust/ql/lib/codeql/rust/frameworks/stdlib/core.model.yml
Original file line number Diff line number Diff line change
Expand Up @@ -165,11 +165,7 @@ extensions:
extensible: neutralModel
data:
- ["<core::option::Option>::map", "sink", "manual"]
- ["<alloc::vec::Vec as core::convert::From>::from", "sink", "manual"]
- ["<alloc::collections::vec_deque::VecDeque as core::convert::From>::from", "sink", "manual"]
- ["<std::io::error::Error as core::convert::From>::from", "sink", "manual"]
- ["<alloc::sync::Arc as core::convert::From>::from", "sink", "manual"]
- ["<alloc::rc::Rc as core::convert::From>::from", "sink", "manual"]
- addsTo:
pack: codeql/rust-all
extensible: excludeFieldTaintStep
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,17 +63,4 @@ module UncontrolledAllocationSize {
branch = false
)
}

/**
* A barrier for uncontrolled allocation size flow into particular functions.
*/
private class ModeledBarrier extends Barrier {
ModeledBarrier() {
exists(MethodCall c |
c.getStaticTarget().getCanonicalPath() =
["<alloc::string::String>::split_off", "<alloc::vec::Vec>::split_off"] and
this.asExpr() = c.getAnArgument()
)
}
}
}