Skip to content

Commit

Permalink
Rename MayBeTaintedA -> MayBeTainted
Browse files Browse the repository at this point in the history
  • Loading branch information
karoliineh committed Aug 29, 2023
1 parent 26151ef commit 0d3af6c
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/analyses/apron/relationAnalysis.apron.ml
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,7 @@ struct
let arg_vars = f.sformals |> List.filter (RD.Tracked.varinfo_tracked) |> List.map RV.arg in
if M.tracing then M.tracel "combine" "relation remove vars: %a\n" (docList (fun v -> Pretty.text (RD.Var.to_string v))) arg_vars;
RD.remove_vars_with new_fun_rel arg_vars; (* fine to remove arg vars that also exist in caller because unify from new_rel adds them back with proper constraints *)
let tainted = f_ask.f Queries.MayBeTaintedA in
let tainted = f_ask.f Queries.MayBeTainted in
let tainted_vars = TaintPartialContexts.conv_varset tainted in
let new_rel = RD.keep_filter st.rel (fun var ->
match RV.find_metadata var with
Expand Down
2 changes: 1 addition & 1 deletion src/analyses/base.ml
Original file line number Diff line number Diff line change
Expand Up @@ -2431,7 +2431,7 @@ struct
(* Remove the return value as this is dealt with separately. *)
let cpa_noreturn = CPA.remove (return_varinfo ()) fun_st.cpa in
let ask = (Analyses.ask_of_ctx ctx) in
let tainted = f_ask.f Q.MayBeTaintedA in
let tainted = f_ask.f Q.MayBeTainted in
if M.tracing then M.trace "taintPC" "combine for %s in base: tainted: %a\n" f.svar.vname AD.pretty tainted;
if M.tracing then M.trace "taintPC" "combine base:\ncaller: %a\ncallee: %a\n" CPA.pretty st.cpa CPA.pretty fun_st.cpa;
if AD.is_top tainted then
Expand Down
2 changes: 1 addition & 1 deletion src/analyses/condVars.ml
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ struct
(* combine caller's state with globals from callee *)
(* TODO (precision): globals with only global vars are kept, the rest is lost -> collect which globals are assigned to *)
(* D.merge (fun k s1 s2 -> match s2 with Some ss2 when (fst k).vglob && D.only_global_exprs ss2 -> s2 | _ when (fst k).vglob -> None | _ -> s1) ctx.local au *)
let tainted = TaintPartialContexts.conv_varset (f_ask.f Queries.MayBeTaintedA) in
let tainted = TaintPartialContexts.conv_varset (f_ask.f Queries.MayBeTainted) in
D.only_untainted ctx.local tainted (* tainted globals might have changed... *)

let combine_assign ctx (lval:lval option) fexp (f:fundec) (args:exp list) fc (au:D.t) (f_ask: Queries.ask) : D.t =
Expand Down
2 changes: 1 addition & 1 deletion src/analyses/modifiedSinceLongjmp.ml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ struct
[ctx.local, D.bot ()] (* enter with bot as opposed to IdentitySpec *)

let combine_env ctx lval fexp f args fc au (f_ask: Queries.ask) =
let taintedcallee = relevants_from_ls (f_ask.f Queries.MayBeTaintedA) in
let taintedcallee = relevants_from_ls (f_ask.f Queries.MayBeTainted) in
add_to_all_defined taintedcallee ctx.local

let combine_assign ctx (lval:lval option) fexp (f:fundec) (args:exp list) fc (au:D.t) (f_ask:Queries.ask) : D.t =
Expand Down
2 changes: 1 addition & 1 deletion src/analyses/taintPartialContexts.ml
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ struct

let query ctx (type a) (q: a Queries.t) : a Queries.result =
match q with
| MayBeTaintedA -> (ctx.local : Queries.AD.t)
| MayBeTainted -> (ctx.local : Queries.AD.t)
| _ -> Queries.Result.top q

end
Expand Down
2 changes: 1 addition & 1 deletion src/analyses/varEq.ml
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,7 @@ struct
| false -> [ctx.local,nst]

let combine_env ctx lval fexp f args fc au (f_ask: Queries.ask) =
let tainted = f_ask.f Queries.MayBeTaintedA in
let tainted = f_ask.f Queries.MayBeTainted in
let d_local =
(* if we are multithreaded, we run the risk, that some mutex protected variables got unlocked, so in this case caller state goes to top
TODO: !!Unsound, this analysis does not handle this case -> regtest 63 08!! *)
Expand Down
10 changes: 5 additions & 5 deletions src/domains/queries.ml
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ type _ t =
| WarnGlobal: Obj.t -> Unit.t t (** Argument must be of corresponding [Spec.V.t]. *)
| IterSysVars: VarQuery.t * Obj.t VarQuery.f -> Unit.t t (** [iter_vars] for [Constraints.FromSpec]. [Obj.t] represents [Spec.V.t]. *)
| MayAccessed: AccessDomain.EventSet.t t
| MayBeTaintedA: AD.t t
| MayBeTainted: AD.t t
| MayBeModifiedSinceSetjmp: JmpBufDomain.BufferEntry.t -> VS.t t
| TmpSpecial: Mval.Exp.t -> ML.t t

Expand Down Expand Up @@ -185,7 +185,7 @@ struct
| WarnGlobal _ -> (module Unit)
| IterSysVars _ -> (module Unit)
| MayAccessed -> (module AccessDomain.EventSet)
| MayBeTaintedA -> (module AD)
| MayBeTainted -> (module AD)
| MayBeModifiedSinceSetjmp _ -> (module VS)
| TmpSpecial _ -> (module ML)

Expand Down Expand Up @@ -249,7 +249,7 @@ struct
| WarnGlobal _ -> Unit.top ()
| IterSysVars _ -> Unit.top ()
| MayAccessed -> AccessDomain.EventSet.top ()
| MayBeTaintedA -> AD.top ()
| MayBeTainted -> AD.top ()
| MayBeModifiedSinceSetjmp _ -> VS.top ()
| TmpSpecial _ -> ML.top ()
end
Expand Down Expand Up @@ -300,7 +300,7 @@ struct
| Any (InvariantGlobal _) -> 38
| Any (MustProtectedVars _) -> 39
| Any MayAccessed -> 40
| Any MayBeTaintedA -> 41
| Any MayBeTainted -> 41
| Any (PathQuery _) -> 42
| Any DYojson -> 43
| Any (EvalValue _) -> 44
Expand Down Expand Up @@ -452,7 +452,7 @@ struct
| Any (MutexType (v,o)) -> Pretty.dprintf "MutexType _"
| Any (EvalMutexAttr a) -> Pretty.dprintf "EvalMutexAttr _"
| Any MayAccessed -> Pretty.dprintf "MayAccessed"
| Any MayBeTaintedA -> Pretty.dprintf "MayBeTaintedA"
| Any MayBeTainted -> Pretty.dprintf "MayBeTainted"
| Any DYojson -> Pretty.dprintf "DYojson"
| Any MayBeModifiedSinceSetjmp buf -> Pretty.dprintf "MayBeModifiedSinceSetjmp %a" JmpBufDomain.BufferEntry.pretty buf
| Any (TmpSpecial lv) -> Pretty.dprintf "TmpSpecial %a" Mval.Exp.pretty lv
Expand Down

0 comments on commit 0d3af6c

Please sign in to comment.