diff options
author | Soheil Hassas Yeganeh <soheil@google.com> | 2016-07-11 16:51:26 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2016-07-11 17:32:44 -0400 |
commit | 779f1edec664a7b32b71f7b4702e085a08d60592 (patch) | |
tree | ce41ff39e7f4ae46de19e66ed759cd9ae426e595 /net/core/sock.c | |
parent | 80610229ef7b26615dbb6cb6e873709a60bacc9f (diff) |
sock: ignore SCM_RIGHTS and SCM_CREDENTIALS in __sock_cmsg_send
Sergei Trofimovich reported that pulse audio sends SCM_CREDENTIALS
as a control message to TCP. Since __sock_cmsg_send does not
support SCM_RIGHTS and SCM_CREDENTIALS, it returns an error and
hence breaks pulse audio over TCP.
SCM_RIGHTS and SCM_CREDENTIALS are sent on the SOL_SOCKET layer
but they semantically belong to SOL_UNIX. Since all
cmsg-processing functions including sock_cmsg_send ignore control
messages of other layers, it is best to ignore SCM_RIGHTS
and SCM_CREDENTIALS for consistency (and also for fixing pulse
audio over TCP).
Fixes: c14ac9451c34 ("sock: enable timestamping using control messages")
Signed-off-by: Soheil Hassas Yeganeh <soheil@google.com>
Reported-by: Sergei Trofimovich <slyfox@gentoo.org>
Tested-by: Sergei Trofimovich <slyfox@gentoo.org>
Cc: Eric Dumazet <edumazet@google.com>
Cc: Willem de Bruijn <willemb@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core/sock.c')
-rw-r--r-- | net/core/sock.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/net/core/sock.c b/net/core/sock.c index 08bf97eceeb3..b7f12639c26a 100644 --- a/net/core/sock.c +++ b/net/core/sock.c | |||
@@ -1938,6 +1938,10 @@ int __sock_cmsg_send(struct sock *sk, struct msghdr *msg, struct cmsghdr *cmsg, | |||
1938 | sockc->tsflags &= ~SOF_TIMESTAMPING_TX_RECORD_MASK; | 1938 | sockc->tsflags &= ~SOF_TIMESTAMPING_TX_RECORD_MASK; |
1939 | sockc->tsflags |= tsflags; | 1939 | sockc->tsflags |= tsflags; |
1940 | break; | 1940 | break; |
1941 | /* SCM_RIGHTS and SCM_CREDENTIALS are semantically in SOL_UNIX. */ | ||
1942 | case SCM_RIGHTS: | ||
1943 | case SCM_CREDENTIALS: | ||
1944 | break; | ||
1941 | default: | 1945 | default: |
1942 | return -EINVAL; | 1946 | return -EINVAL; |
1943 | } | 1947 | } |