Skip to content

Commit

Permalink
sock: ignore SCM_RIGHTS and SCM_CREDENTIALS in __sock_cmsg_send
Browse files Browse the repository at this point in the history
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: c14ac94 ("sock: enable timestamping using control messages")
Signed-off-by: Soheil Hassas Yeganeh <[email protected]>
Reported-by: Sergei Trofimovich <[email protected]>
Tested-by: Sergei Trofimovich <[email protected]>
Cc: Eric Dumazet <[email protected]>
Cc: Willem de Bruijn <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
soheilhy authored and davem330 committed Jul 11, 2016
1 parent 8061022 commit 779f1ed
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions net/core/sock.c
Original file line number Diff line number Diff line change
Expand Up @@ -1938,6 +1938,10 @@ int __sock_cmsg_send(struct sock *sk, struct msghdr *msg, struct cmsghdr *cmsg,
sockc->tsflags &= ~SOF_TIMESTAMPING_TX_RECORD_MASK;
sockc->tsflags |= tsflags;
break;
/* SCM_RIGHTS and SCM_CREDENTIALS are semantically in SOL_UNIX. */
case SCM_RIGHTS:
case SCM_CREDENTIALS:
break;
default:
return -EINVAL;
}
Expand Down

0 comments on commit 779f1ed

Please sign in to comment.