Fix: unprivilieged sessiond agent port clashes with root sessiond
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Tue, 24 Apr 2018 19:58:41 +0000 (15:58 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Wed, 25 Apr 2018 15:11:00 +0000 (11:11 -0400)
commit2288467f63826a06d25ac361fa04ea92ec7ddfa3
tree6b816fe93a9dc26e25e44a19220eb03ed9cf9fdf
parent79445cf0e236eb0f9c08ed535f719994b68632aa
Fix: unprivilieged sessiond agent port clashes with root sessiond

This fix addresses the same problem as reported in f28f9e44.

The session daemon now tries to bind the agent TCP socket to a
port within a range (10 ports by default). The session daemon
will use the first available TCP port within that range when
binding to "localhost". It is still possible to restrict the
session daemon to the broken behaviour by specifying an agent
port using the --agent-tcp-port PORT. If that option is used,
the session daemon will attempt to bind to that part. If it
fails, agent tracing will be marked as disabled.

This fix is backported since the current logic of binding to a
set port means that the default configuration on Ubuntu, Debian,
and other distributions that launch an lttng-sessiond on boot does
not allow the tracing of agent domains (Java Util Logging, log4j,
and Python logging back-ends).

By default, users are not part of the tracing group and it is
not reasonable to expect users to be part of that group for
userspace tracing.

The behaviour of the "system" lttng-sessiond does not change
as it will bind on the first available port within the range.
The non-privilieged session daemons that will be launched after
will be able to bind on other ports available within the range.

Reported-by: Deborah Barnard <starfallprojects@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
14 files changed:
configure.ac
doc/man/asciidoc-attrs.conf.in
doc/man/lttng-sessiond.8.txt
src/bin/lttng-relayd/live.c
src/bin/lttng-relayd/main.c
src/bin/lttng-sessiond/agent-thread.c
src/bin/lttng-sessiond/main.c
src/bin/lttng-sessiond/sessiond-config.c
src/bin/lttng-sessiond/sessiond-config.h
src/common/defaults.h
src/common/sessiond-comm/inet.c
src/common/sessiond-comm/inet6.c
src/common/sessiond-comm/sessiond-comm.c
src/common/sessiond-comm/sessiond-comm.h
This page took 0.027483 seconds and 4 git commands to generate.