[DTrace-devel] [PATCH 1/7] Do not set NONALLOCA taint on builtin array variables

Kris Van Hees kris.van.hees at oracle.com
Thu May 26 18:24:30 UTC 2022


Signed-off-by: Kris Van Hees <kris.van.hees at oracle.com>
---
 libdtrace/dt_parser.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/libdtrace/dt_parser.c b/libdtrace/dt_parser.c
index 4377bb06..7c5c30c9 100644
--- a/libdtrace/dt_parser.c
+++ b/libdtrace/dt_parser.c
@@ -4033,10 +4033,13 @@ asgn_common:
 		 * 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.
+		 * But only do this for user defined arrays.  Builtin arrays do
+		 * not need this.
 		 */
 		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)
+		else if (idp->di_id > DIF_VAR_ARRAY_MAX &&
+			 (dnp->dn_kind != DT_NODE_INT || dnp->dn_value != 0))
 			idp->di_flags |= DT_IDFLG_NONALLOCA;
 
 		dt_node_free(lp);
-- 
2.34.1




More information about the DTrace-devel mailing list