Fix: bytecode validator: reject specialized load field/context ref instructions
[lttng-ust.git] / liblttng-ust / lttng-filter.c
index 947ed843917579fcee828f6e9aba95a88504e238..c5a2db1e9cc0e346e45a95d2e81667b9440ea4d4 100644 (file)
@@ -468,6 +468,11 @@ int _lttng_filter_event_link_bytecode(struct lttng_event *event,
        runtime->len = filter_bytecode->bc.reloc_offset;
        /* copy original bytecode */
        memcpy(runtime->code, filter_bytecode->bc.data, runtime->len);
+       /* Validate bytecode load instructions before relocs. */
+       ret = lttng_filter_validate_bytecode_load(runtime);
+       if (ret) {
+               goto link_error;
+       }
        /*
         * apply relocs. Those are a uint16_t (offset in bytecode)
         * followed by a string (field name).
This page took 0.025261 seconds and 4 git commands to generate.