Fix: kernel adds creds on recv with SO_PASSCRED unix socket option
authorFrancis Deslauriers <francis.deslauriers@efficios.com>
Tue, 27 Jun 2017 21:21:35 +0000 (17:21 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Fri, 24 Aug 2018 19:29:15 +0000 (15:29 -0400)
commitb3f35e021305afc1a40b9f3637c77595f38d6df2
tree599192e8f0dac3e8e382e37e16218d43b20a3a6a
parent56f0bc67599b5438a4b68bdbec596aaaa39b2e7e
Fix: kernel adds creds on recv with SO_PASSCRED unix socket option

When a Unix socket is configured with the SO_PASSCRED option, the caller
of recv() will receive a credential control message even if the sender
did not manually include it.
This caused problem with the old implementation of the
lttcomm_recv_fds_unix_sock function since it was expecting only one
control message for the fd passing. With the SO_PASSCRED, the kernel
will add a credential(SCM_CREDENTIALS) control message before the fd
passing(SCM_RIGHTS) control message (function scm_recv() [1]).

As a fix, make the receiver have a large enough before to include both
types of message and ignore the credential control message.

[1]: include/net/scm.h:111

Signed-off-by: Francis Deslauriers <francis.deslauriers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
configure.ac
src/common/Makefile.am
src/common/unix-stub.c [new file with mode: 0644]
src/common/unix.c
This page took 0.032445 seconds and 4 git commands to generate.