[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [linux-2.6.18-xen] xenbus driver must not accept invalid transaction ids


  • To: xen-changelog@xxxxxxxxxxxxxxxxxxx
  • From: Xen patchbot-linux-2.6.18-xen <patchbot@xxxxxxx>
  • Date: Mon, 09 Jan 2017 11:33:01 +0000
  • Delivery-date: Mon, 09 Jan 2017 11:33:08 +0000
  • List-id: "Change log for Mercurial \(receive only\)" <xen-changelog.lists.xen.org>

# HG changeset patch
# User Juergen Gross <jgross@xxxxxxxx>
# Date 1483959238 -3600
#      Mon Jan 09 11:53:58 2017 +0100
# Node ID de7a5d5195f8c07f66ae6bdcdc16e9ed3e47ae6e
# Parent  87faef7f0177ac77227628d430c8c7c7e2444dae
xenbus driver must not accept invalid transaction ids

When accessing Xenstore in a transaction the user is specifying a
transaction id which he normally obtained from Xenstore when starting
the transaction. Xenstore is validating a transaction id against all
known transaction ids of the connection the request came in. As all
requests of a domain not being the one where Xenstore lives share
one connection, validation of transaction ids of different users of
Xenstore in that domain should be done by the kernel of that domain
being the multiplexer between the Xenstore users in that domain and
Xenstore.

In order to prohibit one Xenstore user to be able to "hijack" a
transaction from another user the xenbus driver has to verify a
given transaction id against all known transaction ids of the user
before forwarding it to Xenstore.

Signed-off-by: Juergen Gross <jgross@xxxxxxxx>

Make apply to the old driver code, which is substantially different in
structure.

Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
Committed-by: Jan Beulich <jbeulich@xxxxxxxx>
---


diff -r 87faef7f0177 -r de7a5d5195f8 drivers/xen/xenbus/xenbus_dev.c
--- a/drivers/xen/xenbus/xenbus_dev.c   Thu Nov 03 16:51:54 2016 +0100
+++ b/drivers/xen/xenbus/xenbus_dev.c   Mon Jan 09 11:53:58 2017 +0100
@@ -323,7 +323,9 @@ static ssize_t xenbus_dev_write(struct f
                }
                goto common;
 
-       case XS_TRANSACTION_END:
+       default:
+               if (!u->u.msg.tx_id)
+                       goto common;
                list_for_each_entry(trans, &u->transactions, list)
                        if (trans->handle.id == u->u.msg.tx_id)
                                break;
@@ -331,9 +333,7 @@ static ssize_t xenbus_dev_write(struct f
                        rc = -ESRCH;
                        goto out;
                }
-               /* fall through */
        common:
-       default:
                reply = xenbus_dev_request_and_reply(&u->u.msg);
                if (IS_ERR(reply)) {
                        if (msg_type == XS_TRANSACTION_START)

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxx
https://lists.xenproject.org/xen-changelog

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.