xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* Xenstore domains and XS_RESTRICT
@ 2016-12-07  7:44 Juergen Gross
  2016-12-07 14:15 ` Konrad Rzeszutek Wilk
                   ` (3 more replies)
  0 siblings, 4 replies; 27+ messages in thread
From: Juergen Gross @ 2016-12-07  7:44 UTC (permalink / raw)
  To: xen-devel
  Cc: Stefano Stabellini, Wei Liu, George.Dunlap@eu.citrix.com,
	Jennifer Herbert, Ian Jackson, Tim Deegan, Jan Beulich,
	Andrew Cooper

Hi,

today the XS_RESTRICT wire command of Xenstore is supported by
oxenstored only to drop the privilege of a connection to that of the
domid given as a parameter to the command.

Using this mechanism with Xenstore running in a stubdom will lead to
problems as instead of only a dom0 process dropping its privileges
the privileges of dom0 will be dropped (all dom0 Xenstore requests
share the same connection).

In order to solve the problem I suggest the following change to the
Xenstore wire protocol:

 struct xsd_sockmsg
 {
-    uint32_t type;  /* XS_??? */
+    uint16_t type;  /* XS_??? */
+    uint16_t domid; /* Use privileges of this domain */
     uint32_t req_id;/* Request identifier, echoed in daemon's response.  */
     uint32_t tx_id; /* Transaction id (0 if not related to a
transaction). */
     uint32_t len;   /* Length of data following this. */

     /* Generally followed by nul-terminated string(s). */
 };

domid will normally be zero having the same effect as today.

Using XS_RESTRICT via a socket connection will run as today by dropping
the privileges of that connection.

Using XS_RESTRICT via the kernel (Xenstore domain case) will save the
domid given as parameter in the connection specific private kernel
structure. All future Xenstore commands of the connection will have
this domid set in xsd_sockmsg. The kernel will never forward the
XS_RESTRICT command to Xenstore.

A domid other than 0 in xsd_sockmsg will be handled by Xenstore to use
the privileges of that domain. Specifying a domid in xsd_sockmsg is
allowed for privileged domain only, of course. XS_RESTRICT via a
non-socket connection will be rejected in all cases.

The needed modifications for Xenstore and the kernel are rather small.
As there is currently no Xenstore domain available supporting
XS_RESTRICT there are no compatibility issues to expect.

Thoughts?


Juergen

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 27+ messages in thread

end of thread, other threads:[~2017-01-18 18:31 UTC | newest]

Thread overview: 27+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-12-07  7:44 Xenstore domains and XS_RESTRICT Juergen Gross
2016-12-07 14:15 ` Konrad Rzeszutek Wilk
2016-12-07 14:26   ` Juergen Gross
2016-12-07 15:40     ` Konrad Rzeszutek Wilk
2016-12-07 15:55       ` Juergen Gross
2016-12-07 17:00       ` Ian Jackson
2016-12-08  7:11         ` Juergen Gross
2016-12-07 17:10 ` Ian Jackson
2016-12-08  7:55   ` Juergen Gross
2017-01-02  6:04     ` Juergen Gross
2017-01-04 14:59 ` Wei Liu
2017-01-04 15:05   ` Juergen Gross
2017-01-04 15:21     ` Wei Liu
2017-01-05  7:20       ` Juergen Gross
2017-01-04 16:54     ` Ian Jackson
2017-01-05  6:56       ` Juergen Gross
2017-01-16 16:47 ` Juergen Gross
2017-01-18 11:03   ` Wei Liu
2017-01-18 11:21     ` Juergen Gross
2017-01-18 11:39       ` Wei Liu
2017-01-18 12:08         ` Juergen Gross
2017-01-18 12:37           ` Andrew Cooper
2017-01-18 12:39             ` George Dunlap
2017-01-18 12:42               ` Juergen Gross
2017-01-18 12:44                 ` Wei Liu
2017-01-18 18:26       ` Stefano Stabellini
2017-01-18 18:31         ` Juergen Gross

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).