Skip to content

Commit

Permalink
Merge pull request #8 from trailofbits/find_similar_funcs
Browse files Browse the repository at this point in the history
match functions that are similar to signal
  • Loading branch information
mschwager authored Jul 2, 2024
2 parents 04cae50 + 2b5d0a3 commit 6763c4f
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,12 @@ predicate isSignalHandlerField(FieldAccess fa) {
fa.getTarget().getName() in ["__sa_handler", "__sa_sigaction", "sa_handler", "sa_sigaction"]
}


from FunctionCall fc, Function signalHandler, FieldAccess fa
where
fc.getTarget().getName() = "signal" and
(
fc.getTarget().getName().matches("%_signal") or
fc.getTarget().getName() = "signal"
) and
signalHandler.getName() = fc.getArgument(1).toString() and
isAsyncUnsafe(signalHandler)
or
Expand All @@ -62,4 +64,4 @@ where
signalHandler = fa.getTarget().getAnAssignedValue().(AddressOfExpr).getAddressable() and
isAsyncUnsafe(signalHandler)
select signalHandler,
"is a non-trivial signal handler that may be using functions that are not async-safe."
"is a non-trivial signal handler that may be using functions that are not async-safe."

0 comments on commit 6763c4f

Please sign in to comment.