Fix: bytecode interpreter context_get_index() leaves byte order uninitialized
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Wed, 30 Mar 2022 16:10:53 +0000 (12:10 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Fri, 1 Apr 2022 17:52:53 +0000 (13:52 -0400)
commitf23356ae9dfbe70bda181b2e6359fb5ecdbdc832
tree2a0ed6ad6fc353dca85261e807aaecdfacd3d9d2
parent299e6bca8ec920c6e8cb9d853ad4fd7733bf33e9
Fix: bytecode interpreter context_get_index() leaves byte order uninitialized

Observed Issue
==============

When using the event notification capture feature to capture a context
field, e.g. '$ctx.cpu_id', the captured value is often observed in
reverse byte order.

Cause
=====

Within the bytecode interpreter, context_get_index() leaves the "rev_bo"
field uninitialized in the top of stack.

This only affects the event notification capture bytecode because the
BYTECODE_OP_GET_SYMBOL bytecode instruction (as of lttng-tools 2.13)
is only generated for capture bytecode in lttng-tools. Therefore, only
capture bytecode targeting contexts are affected by this issue. The
reason why lttng-tools uses the "legacy" bytecode instruction to get
context (BYTECODE_OP_GET_CONTEXT_REF) for the filter bytecode is to
preserve backward compatibility of filtering when interacting with
applications linked against LTTng-UST 2.12.

Solution
========

Initialize the rev_bo field based on the context field type
reserve_byte_order field.

Known drawbacks
===============

None.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Change-Id: I74996d501cee3c269658d98dfc0d0050b74c5ddb
src/lib/lttng-ust/lttng-bytecode-interpreter.c
This page took 0.025719 seconds and 4 git commands to generate.