lkml.org 
[lkml]   [2013]   [Apr]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [ 105/124] af_unix: dont send SCM_CREDENTIAL when dest socket is NULL
Date
On 2013-04-03 00:11 +0200, Greg Kroah-Hartman wrote:

> 3.8-stable review patch. If anyone has any objections, please let me know.

I'm seeing several complaints from udevd at boot in both 3.8.6-rc1 and
3.9-rc5: "udevd[56]: sender uid=65534, message ignored". Reverting the
patch below on top of 3.8.6-rc1 fixes that. I'm using udev version 175
here, and 65534 is the uid of user "nobody".

Cheers,
Sven


> From: dingtianhong <dingtianhong@huawei.com>
>
> [ Upstream commit 14134f6584212d585b310ce95428014b653dfaf6 ]
>
> SCM_SCREDENTIALS should apply to write() syscalls only either source or destination
> socket asserted SOCK_PASSCRED. The original implememtation in maybe_add_creds is wrong,
> and breaks several LSB testcases ( i.e. /tset/LSB.os/netowkr/recvfrom/T.recvfrom).
>
> Origionally-authored-by: Karel Srot <ksrot@redhat.com>
> Signed-off-by: Ding Tianhong <dingtianhong@huawei.com>
> Acked-by: Eric Dumazet <edumazet@google.com>
> Signed-off-by: David S. Miller <davem@davemloft.net>
> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> ---
> net/unix/af_unix.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> --- a/net/unix/af_unix.c
> +++ b/net/unix/af_unix.c
> @@ -1414,8 +1414,8 @@ static void maybe_add_creds(struct sk_bu
> if (UNIXCB(skb).cred)
> return;
> if (test_bit(SOCK_PASSCRED, &sock->flags) ||
> - !other->sk_socket ||
> - test_bit(SOCK_PASSCRED, &other->sk_socket->flags)) {
> + (other->sk_socket &&
> + test_bit(SOCK_PASSCRED, &other->sk_socket->flags))) {
> UNIXCB(skb).pid = get_pid(task_tgid(current));
> UNIXCB(skb).cred = get_current_cred();
> }


\
 
 \ /
  Last update: 2013-04-03 14:21    [W:0.389 / U:2.360 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site