ABI refactoring: sequence and array of text: copy input as string
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mon, 22 Mar 2021 20:59:38 +0000 (16:59 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Tue, 23 Mar 2021 15:19:50 +0000 (11:19 -0400)
commit2792781482a58865c7504100d8c1ba6db41193d1
tree96cf0e66cf898d347567c91cfad3f09aad711741
parent7433d32d5a8f0e8833461b586a8c8b2274da0141
ABI refactoring: sequence and array of text: copy input as string

Within the lttng-modules writeback instrumentation, which exposes a
tracepoint probe API similar to LTTng-UST, we had a long standing issue
where a fixed-size array of text was used to copy a string input into
the trace.

This is fine as long as the input string is actually backed by a
fixed-size array, but if the input string is variable-size, and may be
smaller than the array size, this led to out-of-bound memory reads
beyond the input string NULL terminating character.

Change the behavior of the array/sequence of text to stop copying the
input as soon as the array/sequence size limit (-1) or the input's NULL
terminating character is found, and add zeroed padding for the rest of
the array/sequence within the ring buffer.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Change-Id: Icc3f31c12bdd8018e5e4b7ea146fe842371054d6
include/lttng/ust-events.h
include/lttng/ust-tracepoint-event.h
liblttng-ust/lttng-ring-buffer-client.h
This page took 0.033061 seconds and 4 git commands to generate.