Skip to content

Commit

Permalink
Do not set NONALLOCA taint on VAR[IDX]
Browse files Browse the repository at this point in the history
The logic for setting a NONALLOCA taint on an identifier for stores of
non-alloca, non-literal-0 values in the DT_OP_LBRAC handling in
dt_node_op2() is incorrect.  We are removing it with this patch.
Further analysis is necessary to determine whether it can be applied to
the underlying array variable identifier and how.

Signed-off-by: Kris Van Hees <kris.van.hees@oracle.com>
Reviewed-by: Nick Alcock <nick.alcock@oracle.com>
  • Loading branch information
kvanhees committed Jun 7, 2022
1 parent 5c50bcd commit 392a444
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions libdtrace/dt_parser.c
Original file line number Diff line number Diff line change
Expand Up @@ -4029,15 +4029,9 @@ dt_cook_op2(dt_node_t *dnp, uint_t idflags)
dnp->dn_args = rp;
dnp->dn_list = NULL;

/*
* Transfer alloca taint. Stores of non-alloca, non-literal-0
* values turn on DT_IDFLG_NONALLOCA to prevent this identifier
* from being used for alloca storage anywhere in the program.
*/
/* Transfer alloca taint. */
if (dnp->dn_args->dn_flags & DT_NF_ALLOCA)
dt_cook_taint_alloca(dnp, idp, dnp->dn_args);
else if (dnp->dn_kind != DT_NODE_INT || dnp->dn_value != 0)
idp->di_flags |= DT_IDFLG_NONALLOCA;

dt_node_free(lp);
return dt_node_cook(dnp, idflags);
Expand Down

0 comments on commit 392a444

Please sign in to comment.