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 23:30:01 +0000 (19:30 -0400)
commita10984f577a5b43d15bd176d5e35bab58c3049d3
tree9e27f62b2a9fb2da23c84cdd509ff0b58d69ae59
parent78f68974c9413446fc8d0bed45345079bbf4a04b
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.025386 seconds and 4 git commands to generate.