Fix: list_lttng_agent_events: unbalanced RCU read-side lock on error
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Thu, 27 May 2021 21:11:22 +0000 (17:11 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Thu, 27 May 2021 21:32:28 +0000 (17:32 -0400)
commitca8331f78e8c57d8d699926c7b4948cad9905b2e
tree4dab97ba966a15aaba5593de500bbbd03a03090c
parent220632671d6899a057afadd7b45826046af56985
Fix: list_lttng_agent_events: unbalanced RCU read-side lock on error

The error label jumps to the end label which releases the RCU read-side
lock. There are many error paths in this function which goto error
without holding the RCU read-side lock, thus causing unbalanced RCU
read-side lock.

There is no point in keeping so short RCU read-side critical sections,
so cover the entire function with a single read-side critical section.

[ Applies to stable-2.12 and possibly prior versions. Does _not_ apply
  to stable-2.13+. ]

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Change-Id: I5b20c229a5df22d22ecfdc64dbbb87ee118649d2
src/bin/lttng-sessiond/cmd.c
This page took 0.02769 seconds and 5 git commands to generate.