Fix: Handle SIGBUS in sessiond and consumerd
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Wed, 7 Oct 2020 20:42:05 +0000 (16:42 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Fri, 14 May 2021 17:55:06 +0000 (13:55 -0400)
commit881fc67f7002469477a5ad00e67a8077db6c0514
treee91777c64559c67131125c26f8d61131d57e75e7
parent4243641037bcc27e6338674a5c39699a22347654
Fix: Handle SIGBUS in sessiond and consumerd

There is an issue with the security model of lib ring buffer (lttng-ust)
vs SIGBUS handling by consumer daemon. We do not handle SIGBUS in the
consumer daemon. An application using ftruncate on a ring buffer shm
could cause the consumer to be killed with SIGBUS.

Wire up SIGBUS handling in the session daemon as well given that it also
uses liblttng-ust-ctl.

This depends on "liblttng-ust-ctl: Implement SIGBUS handling" in
lttng-ust, which extends the API of liblttng-ust-ctl, which requires
the user application to define the TLS sigbus state with
DEFINE_LTTNG_UST_SIGBUS_STATE(). It therefore needs to be introduced in
locked-step between lttng-ust and lttng-tools.

Considering that this change in liblttng-ust-ctl modifies the ABI, it is
done with a major soname version bump of the library, so it is allowed
to break the API.

Depends-on: lttng-ust: I7ade988e3e68a87930fbcee3e14e59c3fb66e755

Fixes: #1284
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Change-Id: I76a91616bd35b21c5e891c8306c73ed5e8725ebb
17 files changed:
include/lttng/lttng-error.h
src/bin/lttng-consumerd/lttng-consumerd.c
src/bin/lttng-sessiond/Makefile.am
src/bin/lttng-sessiond/main.c
src/bin/lttng-sessiond/ust-ctl-internal.h
src/bin/lttng-sessiond/ust-sigbus.c [new file with mode: 0644]
src/bin/lttng-sessiond/ust-sigbus.h [new file with mode: 0644]
src/common/consumer/consumer-stream.c
src/common/consumer/consumer-timer.c
src/common/consumer/consumer.c
src/common/consumer/consumer.h
src/common/error.c
src/common/ust-consumer/ust-consumer.c
src/common/ust-consumer/ust-consumer.h
tests/unit/Makefile.am
tests/unit/test_ust_data.c
tests/unit/ust-sigbus.c [new file with mode: 0644]
This page took 0.026761 seconds and 4 git commands to generate.