Merge branch 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/avi/kvm
authorLinus Torvalds <torvalds@woody.linux-foundation.org>
Thu, 19 Apr 2007 16:49:59 +0000 (09:49 -0700)
committerLinus Torvalds <torvalds@woody.linux-foundation.org>
Thu, 19 Apr 2007 16:49:59 +0000 (09:49 -0700)
* 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/avi/kvm:
  KVM: Fix off-by-one when writing to a nonpae guest pde

net/irda/af_irda.c
net/key/af_key.c
net/netlink/af_netlink.c
net/sctp/ulpqueue.c

index eabd683..0eb7d59 100644 (file)
@@ -138,7 +138,6 @@ static void irda_disconnect_indication(void *instance, void *sap,
                sk->sk_shutdown |= SEND_SHUTDOWN;
 
                sk->sk_state_change(sk);
-               sock_orphan(sk);
                release_sock(sk);
 
                /* Close our TSAP.
@@ -1446,7 +1445,7 @@ static int irda_recvmsg_stream(struct kiocb *iocb, struct socket *sock,
                         */
                        ret = sock_error(sk);
                        if (ret)
-                               break;
+                               ;
                        else if (sk->sk_shutdown & RCV_SHUTDOWN)
                                ;
                        else if (noblock)
index cf77930..3450193 100644 (file)
@@ -2072,7 +2072,7 @@ static int pfkey_xfrm_policy2msg(struct sk_buff *skb, struct xfrm_policy *xp, in
                rq->sadb_x_ipsecrequest_proto = t->id.proto;
                if ((mode = pfkey_mode_from_xfrm(t->mode)) < 0)
                        return -EINVAL;
-               mode = pfkey_mode_from_xfrm(t->mode);
+               rq->sadb_x_ipsecrequest_mode = mode;
                rq->sadb_x_ipsecrequest_level = IPSEC_LEVEL_REQUIRE;
                if (t->reqid)
                        rq->sadb_x_ipsecrequest_level = IPSEC_LEVEL_UNIQUE;
index e73d8f5..c48b0f4 100644 (file)
@@ -443,6 +443,7 @@ static int netlink_release(struct socket *sock)
                return 0;
 
        netlink_remove(sk);
+       sock_orphan(sk);
        nlk = nlk_sk(sk);
 
        spin_lock(&nlk->cb_lock);
@@ -457,7 +458,6 @@ static int netlink_release(struct socket *sock)
        /* OK. Socket is unlinked, and, therefore,
           no new packets will arrive */
 
-       sock_orphan(sk);
        sock->sk = NULL;
        wake_up_interruptible_all(&nlk->wait);
 
@@ -1412,9 +1412,9 @@ int netlink_dump_start(struct sock *ssk, struct sk_buff *skb,
                return -ECONNREFUSED;
        }
        nlk = nlk_sk(sk);
-       /* A dump is in progress... */
+       /* A dump or destruction is in progress... */
        spin_lock(&nlk->cb_lock);
-       if (nlk->cb) {
+       if (nlk->cb || sock_flag(sk, SOCK_DEAD)) {
                spin_unlock(&nlk->cb_lock);
                netlink_destroy_callback(cb);
                sock_put(sk);
index bfb197e..b29e3e4 100644 (file)
@@ -190,7 +190,14 @@ int sctp_ulpq_tail_event(struct sctp_ulpq *ulpq, struct sctp_ulpevent *event)
        if (!sctp_sk(sk)->pd_mode) {
                queue = &sk->sk_receive_queue;
        } else if (ulpq->pd_mode) {
-               if (event->msg_flags & MSG_NOTIFICATION)
+               /* If the association is in partial delivery, we
+                * need to finish delivering the partially processed
+                * packet before passing any other data.  This is
+                * because we don't truly support stream interleaving.
+                */
+               if ((event->msg_flags & MSG_NOTIFICATION) ||
+                   (SCTP_DATA_NOT_FRAG ==
+                           (event->msg_flags & SCTP_DATA_FRAG_MASK)))
                        queue = &sctp_sk(sk)->pd_lobby;
                else {
                        clear_pd = event->msg_flags & MSG_EOR;