Fix: bytecode validator: reject specialized load field/context ref instructions
[lttng-modules.git] / lttng-filter.c
index ec6fd576097af828dbe3dfa064691ca3545119b4..4c053fbbfb1208bb94b00bb279bf463b49226ce0 100644 (file)
@@ -455,6 +455,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.024098 seconds and 4 git commands to generate.