Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1546209 > unrolled thread

[PATCH 0/3] xen: fix some minor bugs and cleanup of xenbus

Started byJuergen Gross <jgross@suse.com>
First post2016-12-22 08:30 +0100
Last post2016-12-22 17:00 +0100
Articles 6 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH 0/3] xen: fix some minor bugs and cleanup of xenbus Juergen Gross <jgross@suse.com> - 2016-12-22 08:30 +0100
    [PATCH 3/3] xen: remove stale xs_input_avail() from header Juergen Gross <jgross@suse.com> - 2016-12-22 08:30 +0100
      Re: [PATCH 3/3] xen: remove stale xs_input_avail() from header Boris Ostrovsky <boris.ostrovsky@oracle.com> - 2016-12-22 17:00 +0100
    [PATCH 1/3] xen: xenbus driver must not accept invalid transaction ids Juergen Gross <jgross@suse.com> - 2016-12-22 08:30 +0100
      Re: [PATCH 1/3] xen: xenbus driver must not accept invalid  transaction ids Boris Ostrovsky <boris.ostrovsky@oracle.com> - 2016-12-22 16:40 +0100
        Re: [PATCH 1/3] xen: xenbus driver must not accept invalid  transaction ids Juergen Gross <jgross@suse.com> - 2016-12-22 17:00 +0100

#1546209 — [PATCH 0/3] xen: fix some minor bugs and cleanup of xenbus

FromJuergen Gross <jgross@suse.com>
Date2016-12-22 08:30 +0100
Subject[PATCH 0/3] xen: fix some minor bugs and cleanup of xenbus
Message-ID<sR5Z8-6ip-13@gated-at.bofh.it>
Do some minor bug fixes and cleanup of xenbus driver.

Juergen Gross (3):
  xen: xenbus driver must not accept invalid transaction ids
  xen: return xenstore command failures via response instead of rc
  xen: remove stale xs_input_avail() from header

 drivers/xen/xenbus/xenbus_comms.h        |  1 -
 drivers/xen/xenbus/xenbus_dev_frontend.c | 49 ++++++++++++++++++--------------
 2 files changed, 28 insertions(+), 22 deletions(-)

-- 
2.10.2

[toc] | [next] | [standalone]


#1546210 — [PATCH 3/3] xen: remove stale xs_input_avail() from header

FromJuergen Gross <jgross@suse.com>
Date2016-12-22 08:30 +0100
Subject[PATCH 3/3] xen: remove stale xs_input_avail() from header
Message-ID<sR5Z8-6ip-23@gated-at.bofh.it>
In reply to#1546209
In drivers/xen/xenbus/xenbus_comms.h there is a stale declaration of
xs_input_avail(). Remove it.

Signed-off-by: Juergen Gross <jgross@suse.com>
---
 drivers/xen/xenbus/xenbus_comms.h | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/xen/xenbus/xenbus_comms.h b/drivers/xen/xenbus/xenbus_comms.h
index e74f9c1..867a2e4 100644
--- a/drivers/xen/xenbus/xenbus_comms.h
+++ b/drivers/xen/xenbus/xenbus_comms.h
@@ -42,7 +42,6 @@ int xb_write(const void *data, unsigned len);
 int xb_read(void *data, unsigned len);
 int xb_data_to_read(void);
 int xb_wait_for_data_to_read(void);
-int xs_input_avail(void);
 extern struct xenstore_domain_interface *xen_store_interface;
 extern int xen_store_evtchn;
 extern enum xenstore_init xen_store_domain_type;
-- 
2.10.2

[toc] | [prev] | [next] | [standalone]


#1546431 — Re: [PATCH 3/3] xen: remove stale xs_input_avail() from header

FromBoris Ostrovsky <boris.ostrovsky@oracle.com>
Date2016-12-22 17:00 +0100
SubjectRe: [PATCH 3/3] xen: remove stale xs_input_avail() from header
Message-ID<sRdWG-2Tv-15@gated-at.bofh.it>
In reply to#1546210
On 12/22/2016 02:19 AM, Juergen Gross wrote:
> In drivers/xen/xenbus/xenbus_comms.h there is a stale declaration of
> xs_input_avail(). Remove it.
>
> Signed-off-by: Juergen Gross <jgross@suse.com>
>


Reviewed-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>

[toc] | [prev] | [next] | [standalone]


#1546211 — [PATCH 1/3] xen: xenbus driver must not accept invalid transaction ids

FromJuergen Gross <jgross@suse.com>
Date2016-12-22 08:30 +0100
Subject[PATCH 1/3] xen: xenbus driver must not accept invalid transaction ids
Message-ID<sR5Z8-6ip-25@gated-at.bofh.it>
In reply to#1546209
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@suse.com>
---
 drivers/xen/xenbus/xenbus_dev_frontend.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/xen/xenbus/xenbus_dev_frontend.c b/drivers/xen/xenbus/xenbus_dev_frontend.c
index 6c0ead4..a068281 100644
--- a/drivers/xen/xenbus/xenbus_dev_frontend.c
+++ b/drivers/xen/xenbus/xenbus_dev_frontend.c
@@ -316,7 +316,7 @@ static int xenbus_write_transaction(unsigned msg_type,
 			rc = -ENOMEM;
 			goto out;
 		}
-	} else if (msg_type == XS_TRANSACTION_END) {
+	} else if (u->u.msg.tx_id != 0) {
 		list_for_each_entry(trans, &u->transactions, list)
 			if (trans->handle.id == u->u.msg.tx_id)
 				break;
-- 
2.10.2

[toc] | [prev] | [next] | [standalone]


#1546419 — Re: [PATCH 1/3] xen: xenbus driver must not accept invalid transaction ids

FromBoris Ostrovsky <boris.ostrovsky@oracle.com>
Date2016-12-22 16:40 +0100
SubjectRe: [PATCH 1/3] xen: xenbus driver must not accept invalid transaction ids
Message-ID<sRdDk-2MH-9@gated-at.bofh.it>
In reply to#1546211
On 12/22/2016 02:19 AM, Juergen Gross wrote:
> 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@suse.com>


Should this go to stable trees as well?


Reviewed-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>

[toc] | [prev] | [next] | [standalone]


#1546429 — Re: [PATCH 1/3] xen: xenbus driver must not accept invalid transaction ids

FromJuergen Gross <jgross@suse.com>
Date2016-12-22 17:00 +0100
SubjectRe: [PATCH 1/3] xen: xenbus driver must not accept invalid transaction ids
Message-ID<sRdWF-2Tv-5@gated-at.bofh.it>
In reply to#1546419
On 22/12/16 16:38, Boris Ostrovsky wrote:
> On 12/22/2016 02:19 AM, Juergen Gross wrote:
>> 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@suse.com>
> 
> 
> Should this go to stable trees as well?

I don't think it is necessary. First I thought this could be a security
problem, but any user who could make use of that problem could easily
trash complete Xenstore, so there are no additional security concerns
with this "bug" not being handled.

After all it is just a matter of avoiding problems due to buggy Xenstore
users which are probably not existing at all. :-)

> Reviewed-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>

Thanks,

Juergen

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web