]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
2.6.35.13 longterm review
authorChuck Ebbert <cebbert@redhat.com>
Wed, 27 Apr 2011 00:21:50 +0000 (20:21 -0400)
committerAndi Kleen <ak@linux.intel.com>
Thu, 28 Apr 2011 15:21:17 +0000 (08:21 -0700)
Also please revert the patch "fix-cred-leak-in-af_netlink" from 2.6.35.12.
The proper fix was "af_netlink-add-needed-scm_destroy-after-scm_send" which
was also added in that release. Here's a revert patch:

Signed-off-by: Andi Kleen <ak@linux.intel.com>
net/netlink/af_netlink.c

index eb16478732617f4d33f77f49cf82644b2566730e..eea6817fa9fd817198727a2cba74e9436dda007e 100644 (file)
@@ -1333,16 +1333,12 @@ static int netlink_sendmsg(struct kiocb *kiocb, struct socket *sock,
                return err;
 
        if (msg->msg_namelen) {
-               if (addr->nl_family != AF_NETLINK) {
-                       err = -EINVAL;
-                       goto out;
-               }
+               if (addr->nl_family != AF_NETLINK)
+                       return -EINVAL;
                dst_pid = addr->nl_pid;
                dst_group = ffs(addr->nl_groups);
-               if (dst_group && !netlink_capable(sock, NL_NONROOT_SEND)) {
-                       err = -EPERM;
-                       goto out;
-               }
+               if (dst_group && !netlink_capable(sock, NL_NONROOT_SEND))
+                       return -EPERM;
        } else {
                dst_pid = nlk->dst_pid;
                dst_group = nlk->dst_group;
@@ -1394,8 +1390,6 @@ static int netlink_sendmsg(struct kiocb *kiocb, struct socket *sock,
        err = netlink_unicast(sk, skb, dst_pid, msg->msg_flags&MSG_DONTWAIT);
 
 out:
-       scm_destroy(siocb->scm);
-       siocb->scm = NULL;
        return err;
 }