netdev
[Top] [All Lists]

[PATCH] linux 2.9.10-rc1: Fix oops in unix_dgram_sendmsg when using SELi

To: netdev@xxxxxxxxxxx
Subject: [PATCH] linux 2.9.10-rc1: Fix oops in unix_dgram_sendmsg when using SELinux and SOCK_SEQPACKET
From: Ross Kendall Axe <ross.axe@xxxxxxxxxxxxxxxx>
Date: Sun, 14 Nov 2004 18:13:11 +0000
Cc: linux-kernel@xxxxxxxxxxxxxxx
Sender: netdev-bounce@xxxxxxxxxxx
User-agent: Mozilla Thunderbird 0.8 (X11/20040913)
With CONFIG_SECURITY_NETWORK=y and CONFIG_SECURITY_SELINUX=y, using
SOCK_SEQPACKET unix domain sockets causes an oops in the superfluous(?)
call to security_unix_may_send in sock_dgram_sendmsg. This patch avoids
making this call for SOCK_SEQPACKET sockets.


Signed-off-by: Ross Axe <ross.axe@xxxxxxxxxxxxxxxx>


--- linux-2.6.10-rc1/net/unix/af_unix.c.orig 2004-11-13 21:04:53.000000000 +0000 +++ linux-2.6.10-rc1/net/unix/af_unix.c 2004-11-13 21:12:23.000000000 +0000 @@ -1354,9 +1354,11 @@ restart: if (other->sk_shutdown & RCV_SHUTDOWN) goto out_unlock;

-       err = security_unix_may_send(sk->sk_socket, other->sk_socket);
-       if (err)
-               goto out_unlock;
+       if (sk->sk_type != SOCK_SEQPACKET) {
+               err = security_unix_may_send(sk->sk_socket, other->sk_socket);
+               if (err)
+                       goto out_unlock;
+       }

        if (unix_peer(other) != sk &&
            (skb_queue_len(&other->sk_receive_queue) >

Attachment: signature.asc
Description: OpenPGP digital signature

<Prev in Thread] Current Thread [Next in Thread>