From: Francis Deslauriers Date: Tue, 27 Jun 2017 21:21:35 +0000 (-0400) Subject: Fix: kernel adds creds on recv with SO_PASSCRED unix socket option X-Git-Tag: v2.11.0-rc1~90 X-Git-Url: https://git.lttng.org/?a=commitdiff_plain;h=b3f35e021305afc1a40b9f3637c77595f38d6df2;hp=b3f35e021305afc1a40b9f3637c77595f38d6df2;p=lttng-tools.git 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 Signed-off-by: Jérémie Galarneau ---