xenstore: remove XS_RESTRICT support
PATCH v3 1/1 xenstore: remove XS_RESTRICT support
XS_RESTRICT and the xenstore library function xs_restrict() have never been usable in all configurations and there are no known users.
This functionality was thought to limit access rights of device models to xenstore in order to avoid affecting other domains in case of a security breech. Unfortunately XS_RESTRICT won't help as current qemu is requiring access to dom0 only accessible xenstore paths to work correctly. So this command is useless and should be removed.
In order to avoid problems in the future remove all support for XS_RESTRICT from xenstore.
---
V3: remove restrict functions in ocaml as requested by Wei Liu
V2: don't replace XS_RESTRICT enum member with a dummy one as suggested
by Andrew Cooper
--- tools/ocaml/libs/xb/op.ml | 5 ++--- tools/ocaml/libs/xb/xb.mli | 1 - tools/ocaml/xenstored/connection.ml | 3 --- tools/ocaml/xenstored/logging.ml | 1 - tools/ocaml/xenstored/perms.ml | 5 ----- tools/ocaml/xenstored/process.ml | 16 ---------------- tools/xenstore/include/xenstore.h | 9 --------- tools/xenstore/xenstored_core.c | 1 - tools/xenstore/xs.c | 8 -------- xen/include/public/io/xs_wire.h | 4 ++-- 10 files changed, 4 insertions(+), 49 deletions(-)
tools/ocaml/libs/xb/op.ml +2 -3
@@ -19,7 +19,7 @@ type operation = Debug | Directory | Read | Getperms | Transaction_end | Introduce | Release | Getdomainpath | Write | Mkdir | Rm | Setperms | Watchevent | Error | Isintroduced | - Resume | Set_target | Restrict | Reset_watches | + Resume | Set_target | Reset_watches | Invalid let operation_c_mapping =
@@ -28,7 +28,7 @@ let operation_c_mapping = Transaction_end; Introduce; Release; Getdomainpath; Write; Mkdir; Rm; Setperms; Watchevent; Error; Isintroduced; - Resume; Set_target; Restrict; Reset_watches |] + Resume; Set_target; Reset_watches |] let size = Array.length operation_c_mapping let array_search el a =
@@ -68,6 +68,5 @@ let to_string ty = | Isintroduced -> "IS_INTRODUCED" | Resume -> "RESUME" | Set_target -> "SET_TARGET" - | Restrict -> "RESTRICT" | Reset_watches -> "RESET_WATCHES" | Invalid -> "INVALID"
tools/ocaml/libs/xb/xb.mli +0 -1
@@ -22,7 +22,6 @@ module Op : | Isintroduced | Resume | Set_target - | Restrict | Reset_watches | Invalid val operation_c_mapping : operation array
tools/ocaml/xenstored/connection.ml +0 -3
@@ -122,9 +122,6 @@ let close con = let get_perm con = con.perm -let restrict con domid = - con.perm <- Perms.Connection.restrict con.perm domid - let set_target con target_domid = con.perm <- Perms.Connection.set_target (get_perm con) ~perms:[Perms.READ; Perms.WRITE] target_domid
tools/ocaml/xenstored/logging.ml +0 -1
@@ -241,7 +241,6 @@ let string_of_access_type = function | Xenbus.Xb.Op.Mkdir -> "mkdir " | Xenbus.Xb.Op.Rm -> "rm " | Xenbus.Xb.Op.Setperms -> "setperms " - | Xenbus.Xb.Op.Restrict -> "restrict " | Xenbus.Xb.Op.Reset_watches -> "reset watches" | Xenbus.Xb.Op.Set_target -> "settarget"
tools/ocaml/xenstored/perms.ml +0 -5
@@ -119,11 +119,6 @@ let is_owner (connection:t) id = let is_dom0 (connection:t) = is_owner connection 0 -let restrict (connection:t) domid = - match connection.target, connection.main with - | None, (0, perms) -> { connection with main = (domid, perms) } - | _ -> raise Define.Permission_denied - let elt_to_string (i,p) = Printf.sprintf "%i%S" i (String.concat "" (List.map String.of_char (List.map char_of_permty p)))
tools/ocaml/xenstored/process.ml +0 -16
@@ -172,30 +172,16 @@ let do_isintroduced con t domains cons data = in if domid = Define.domid_self || Domains.exist domains domid then "T\000" else "F\000" -(* [restrict] is in the patch queue since xen3.2 *) -let do_restrict con t domains cons data = - if not (Connection.is_dom0 con) - then raise Define.Permission_denied; - let domid = - match (split None '\000' data) with - | [ domid; "" ] -> c_int_of_string domid - | _ -> raise Invalid_Cmd_Args - in - Connection.restrict con domid - (* only in xen >= 4.2 *) let do_reset_watches con t domains cons data = Connection.del_watches con; Connection.del_transactions con (* only in >= xen3.3 *) -(* we ensure backward compatibility with restrict by counting the number of argument of set_target ... *) -(* This is not very elegant, but it is safe as 'restrict' only restricts permission of dom0 connections *) let do_set_target con t domains cons data = if not (Connection.is_dom0 con) then raise Define.Permission_denied; match split None '\000' data with - | [ domid; "" ] -> do_restrict con t domains con data (* backward compatibility with xen3.2-pq *) | [ domid; target_domid; "" ] -> Connections.set_target cons (c_int_of_string domid) (c_int_of_string target_domid) | _ -> raise Invalid_Cmd_Args
@@ -244,7 +230,6 @@ let function_of_type_simple_op ty = | Xenbus.Xb.Op.Isintroduced | Xenbus.Xb.Op.Resume | Xenbus.Xb.Op.Set_target - | Xenbus.Xb.Op.Restrict | Xenbus.Xb.Op.Reset_watches | Xenbus.Xb.Op.Invalid -> error "called function_of_type_simple_op on operation %s" (Xenbus.Xb.Op.to_string ty); raise (Invalid_argument (Xenbus.Xb.Op.to_string ty))
@@ -428,7 +413,6 @@ let function_of_type ty = | Xenbus.Xb.Op.Isintroduced -> reply_data do_isintroduced | Xenbus.Xb.Op.Resume -> reply_ack do_resume | Xenbus.Xb.Op.Set_target -> reply_ack do_set_target - | Xenbus.Xb.Op.Restrict -> reply_ack do_restrict | Xenbus.Xb.Op.Reset_watches -> reply_ack do_reset_watches | Xenbus.Xb.Op.Invalid -> reply_ack do_error | _ -> function_of_type_simple_op ty
tools/xenstore/include/xenstore.h +0 -9
@@ -132,15 +132,6 @@ bool xs_mkdir(struct xs_handle *h, xs_transaction_t t,bool xs_rm (struct xs_handle *h,xs_transaction_t t,const char *path); -/* Restrict a xenstore handle so that it acts as if it had the -* permissions of domain @domid. The handle must currently be -* using domain 0's credentials. -* -* Returns false on failure, in which case the handle continues -* to use the old credentials, or true on success. -*/ -bool xs_restrict (struct xs_handle *h,unsigned domid); -/* Get permissions of node (first element is owner, first perms is "other"). * Returns malloced array, or NULL: call free() after use. */
tools/xenstore/xenstored_core.c +0 -1
@@ -1309,7 +1309,6 @@ static struct { { "IS_DOMAIN_INTRODUCED", do_is_domain_introduced }, [XS_RESUME] = { "RESUME", do_resume }, [XS_SET_TARGET] = { "SET_TARGET", do_set_target }, - [XS_RESTRICT] = { "RESTRICT", NULL }, [XS_RESET_WATCHES] = { "RESET_WATCHES", do_reset_watches }, [XS_DIRECTORY_PART] = { "DIRECTORY_PART", send_directory_part }, };
tools/xenstore/xs.c +0 -8
@@ -769,14 +769,6 @@ unwind:return false; } -bool xs_restrict (struct xs_handle *h,unsigned domid) -{ -char buf[16 ]; - -sprintf (buf,"%d" , domid); -return xs_bool (xs_single (h,XBT_NULL ,XS_RESTRICT , buf,NULL )); -} -/* Watch a node for changes (poll on fd to detect, or call read_watch()). * When the node (or any child) changes, fd will become readable. * Token is returned when watch is read, to allow matching.
xen/include/public/io/xs_wire.h +2 -2
@@ -48,8 +48,8 @@ enum xsd_sockmsg_typeXS_IS_DOMAIN_INTRODUCED ,XS_RESUME ,XS_SET_TARGET , -XS_RESTRICT , -XS_RESET_WATCHES , +/* XS_RESTRICT has been removed */ +XS_RESET_WATCHES =XS_SET_TARGET +2 ,XS_DIRECTORY_PART , XS_TYPE_COUNT, /* Number of valid types. */
Signature · 7 lines
2.10.2 _______________________________________________ Xen-devel mailing list [email protected] https://lists.xen.org/xen-devel
Quoted 9 lines · Juergen Gross
XS_RESTRICTand the xenstore library functionxs_restrict()have never been usable in all configurations and there are no known users.This functionality was thought to limit access rights of device models to xenstore in order to avoid affecting other domains in case of a security breech. Unfortunately
XS_RESTRICTwon't help as current qemu is requiring access to dom0 only accessible xenstore paths to work correctly. So this command is useless and should be removed.
Quoted 4 lines
In order to avoid problems in the future remove all support for
XS_RESTRICTfrom xenstore.Signed-off-by Juergen Gross <[email protected]>
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
Quoted 9 lines · Juergen Gross
XS_RESTRICTand the xenstore library functionxs_restrict()have never been usable in all configurations and there are no known users.This functionality was thought to limit access rights of device models to xenstore in order to avoid affecting other domains in case of a security breech. Unfortunately
XS_RESTRICTwon't help as current qemu is requiring access to dom0 only accessible xenstore paths to work correctly. So this command is useless and should be removed.
Quoted 4 lines
In order to avoid problems in the future remove all support for
XS_RESTRICTfrom xenstore.Signed-off-by Juergen Gross <[email protected]>
Adding Dave Scott to Cc: list.
Juergen
Quoted 209 lines
---
V3: remove restrict functions in ocaml as requested by Wei LiuV2: don't replace
XS_RESTRICTenum member with a dummy one as suggested
by Andrew Cooper--- tools/ocaml/libs/xb/op.ml | 5 ++--- tools/ocaml/libs/xb/xb.mli | 1 - tools/ocaml/xenstored/connection.ml | 3 --- tools/ocaml/xenstored/logging.ml | 1 - tools/ocaml/xenstored/perms.ml | 5 ----- tools/ocaml/xenstored/process.ml | 16 ---------------- tools/xenstore/include/xenstore.h | 9 --------- tools/xenstore/xenstored_core.c | 1 - tools/xenstore/xs.c | 8 -------- xen/include/public/io/xs_wire.h | 4 ++-- 10 files changed, 4 insertions(+), 49 deletions(-)tools/ocaml/libs/xb/op.ml +2
-3@@ -19,7 +19,7 @@ type operation = Debug | Directory | Read | Getperms | Transaction_end | Introduce | Release | Getdomainpath | Write | Mkdir | Rm | Setperms | Watchevent | Error | Isintroduced | - Resume | Set_target | Restrict | Reset_watches | + Resume | Set_target | Reset_watches | Invalid let operation_c_mapping =@@ -28,7 +28,7 @@ let operation_c_mapping = Transaction_end; Introduce; Release; Getdomainpath; Write; Mkdir; Rm; Setperms; Watchevent; Error; Isintroduced; - Resume; Set_target; Restrict; Reset_watches |] + Resume; Set_target; Reset_watches |] let size = Array.length operation_c_mapping let array_search el a =@@ -68,6 +68,5 @@ let to_string ty = | Isintroduced -> "IS_INTRODUCED" | Resume -> "RESUME" | Set_target -> "SET_TARGET" - | Restrict -> "RESTRICT" | Reset_watches -> "RESET_WATCHES" | Invalid -> "INVALID"tools/ocaml/libs/xb/xb.mli +0
-1@@ -22,7 +22,6 @@ module Op : | Isintroduced | Resume | Set_target - | Restrict | Reset_watches | Invalid val operation_c_mapping : operation arraytools/ocaml/xenstored/connection.ml +0
-3@@ -122,9 +122,6 @@ let close con = let get_perm con = con.perm -let restrict con domid = - con.perm <- Perms.Connection.restrict con.perm domid - let set_target con target_domid = con.perm <- Perms.Connection.set_target (get_perm con) ~perms:[Perms.READ; Perms.WRITE] target_domidtools/ocaml/xenstored/logging.ml +0
-1@@ -241,7 +241,6 @@ let string_of_access_type = function | Xenbus.Xb.Op.Mkdir -> "mkdir " | Xenbus.Xb.Op.Rm -> "rm " | Xenbus.Xb.Op.Setperms -> "setperms " - | Xenbus.Xb.Op.Restrict -> "restrict " | Xenbus.Xb.Op.Reset_watches -> "reset watches" | Xenbus.Xb.Op.Set_target -> "settarget"tools/ocaml/xenstored/perms.ml +0
-5@@ -119,11 +119,6 @@ let is_owner (connection:t) id = let is_dom0 (connection:t) = is_owner connection 0 -let restrict (connection:t) domid = - match connection.target, connection.main with - | None, (0, perms) -> { connection with main = (domid, perms) } - | _ -> raise Define.Permission_denied - let elt_to_string (i,p) = Printf.sprintf "%i%S" i (String.concat "" (List.map String.of_char (List.map char_of_permty p)))tools/ocaml/xenstored/process.ml +0
-16@@ -172,30 +172,16 @@ let do_isintroduced con t domains cons data = in if domid = Define.domid_self || Domains.exist domains domid then "T\000" else "F\000" -(* [restrict] is in the patch queue since xen3.2 *) -let do_restrict con t domains cons data = - if not (Connection.is_dom0 con) - then raise Define.Permission_denied; - let domid = - match (split None '\000' data) with - | [ domid; "" ] -> c_int_of_string domid - | _ -> raise Invalid_Cmd_Args - in - Connection.restrict con domid - (* only in xen >= 4.2 *) let do_reset_watches con t domains cons data = Connection.del_watches con; Connection.del_transactions con (* only in >= xen3.3 *) -(* we ensure backward compatibility with restrict by counting the number of argument of set_target ... *) -(* This is not very elegant, but it is safe as 'restrict' only restricts permission of dom0 connections *) let do_set_target con t domains cons data = if not (Connection.is_dom0 con) then raise Define.Permission_denied; match split None '\000' data with - | [ domid; "" ] -> do_restrict con t domains con data (* backward compatibility with xen3.2-pq *) | [ domid; target_domid; "" ] -> Connections.set_target cons (c_int_of_string domid) (c_int_of_string target_domid) | _ -> raise Invalid_Cmd_Args@@ -244,7 +230,6 @@ let function_of_type_simple_op ty = | Xenbus.Xb.Op.Isintroduced | Xenbus.Xb.Op.Resume | Xenbus.Xb.Op.Set_target - | Xenbus.Xb.Op.Restrict | Xenbus.Xb.Op.Reset_watches | Xenbus.Xb.Op.Invalid -> error "called function_of_type_simple_op on operation %s" (Xenbus.Xb.Op.to_string ty); raise (Invalid_argument (Xenbus.Xb.Op.to_string ty))@@ -428,7 +413,6 @@ let function_of_type ty = | Xenbus.Xb.Op.Isintroduced -> reply_data do_isintroduced | Xenbus.Xb.Op.Resume -> reply_ack do_resume | Xenbus.Xb.Op.Set_target -> reply_ack do_set_target - | Xenbus.Xb.Op.Restrict -> reply_ack do_restrict | Xenbus.Xb.Op.Reset_watches -> reply_ack do_reset_watches | Xenbus.Xb.Op.Invalid -> reply_ack do_error | _ -> function_of_type_simple_op tytools/xenstore/include/xenstore.h +0
-9@@ -132,15 +132,6 @@ bool xs_mkdir(struct xs_handle *h, xs_transaction_t t,bool xs_rm (struct xs_handle *h,xs_transaction_t t,const char *path); -/* Restrict a xenstore handle so that it acts as if it had the -* permissions of domain @domid. The handle must currently be -* using domain 0's credentials. -* -* Returns false on failure, in which case the handle continues -* to use the old credentials, or true on success. -*/ -bool xs_restrict (struct xs_handle *h,unsigned domid); -/* Get permissions of node (first element is owner, first perms is "other"). * Returns malloced array, or NULL: call free() after use. */ tools/xenstore/xenstored_core.c +0
-1@@ -1309,7 +1309,6 @@ static struct { { "IS_DOMAIN_INTRODUCED", do_is_domain_introduced }, [XS_RESUME] = { "RESUME", do_resume }, [XS_SET_TARGET] = { "SET_TARGET", do_set_target }, - [XS_RESTRICT] = { "RESTRICT", NULL }, [XS_RESET_WATCHES] = { "RESET_WATCHES", do_reset_watches }, [XS_DIRECTORY_PART] = { "DIRECTORY_PART", send_directory_part }, };tools/xenstore/xs.c +0
-8@@ -769,14 +769,6 @@ unwind:return false; } -bool xs_restrict (struct xs_handle *h,unsigned domid) -{ -char buf[16 ]; - -sprintf (buf,"%d" , domid); -return xs_bool (xs_single (h,XBT_NULL ,XS_RESTRICT , buf,NULL )); -} -/* Watch a node for changes (poll on fd to detect, or call read_watch()). * When the node (or any child) changes, fd will become readable. * Token is returned when watch is read, to allow matching. xen/include/public/io/xs_wire.h +0
-0
xen/include/public/io/xs_wire.h enum xsd_sockmsg_type · line 55
Quoted 10 lines
xen/include/public/io/xs_wire.h +2
-2@@ -48,8 +48,8 @@ enum xsd_sockmsg_typeXS_IS_DOMAIN_INTRODUCED ,XS_RESUME ,XS_SET_TARGET , -XS_RESTRICT , -XS_RESET_WATCHES , +/* XS_RESTRICT has been removed */ +XS_RESET_WATCHES =XS_SET_TARGET +2 ,XS_DIRECTORY_PART , XS_TYPE_COUNT, /* Number of valid types. */
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
David Scott
Acked-byQuoted 13 lines · Juergen Gross
Quoted 9 lines · Juergen Gross
XS_RESTRICTand the xenstore library functionxs_restrict()have never been usable in all configurations and there are no known users.This functionality was thought to limit access rights of device models to xenstore in order to avoid affecting other domains in case of a security breech. Unfortunately
XS_RESTRICTwon't help as current qemu is requiring access to dom0 only accessible xenstore paths to work correctly. So this command is useless and should be removed.
Quoted 6 lines
Quoted 4 lines
In order to avoid problems in the future remove all support for
XS_RESTRICTfrom xenstore.Signed-off-by Juergen Gross <[email protected]>Adding Dave Scott to Cc: list.
Looks fine to me:
Cheers,
Dave
Quoted 221 lines
Juergen
Quoted 217 lines
---
V3: remove restrict functions in ocaml as requested by Wei LiuV2: don't replace
XS_RESTRICTenum member with a dummy one as suggested
by Andrew Cooper
---tools/ocaml/libs/xb/op.ml | 5 ++--- tools/ocaml/libs/xb/xb.mli | 1 - tools/ocaml/xenstored/connection.ml | 3 --- tools/ocaml/xenstored/logging.ml | 1 - tools/ocaml/xenstored/perms.ml | 5 ----- tools/ocaml/xenstored/process.ml | 16 ---------------- tools/xenstore/include/xenstore.h | 9 --------- tools/xenstore/xenstored_core.c | 1 - tools/xenstore/xs.c | 8 -------- xen/include/public/io/xs_wire.h | 4 ++-- 10 files changed, 4 insertions(+), 49 deletions(-)tools/ocaml/libs/xb/op.ml +1
-1@@ -19,7 +19,7 @@ type operation = Debug | Directory | Read | Getperms | Transaction_end | Introduce | Release | Getdomainpath | Write | Mkdir | Rm | Setperms | Watchevent | Error | Isintroduced | - Resume | Set_target | Restrict | Reset_watches | + Resume | Set_target | Reset_watches | Invalidlet
operation_c_mapping=tools/ocaml/libs/xb/op.ml +1
-1@@ -28,7 +28,7 @@ let operation_c_mapping = Transaction_end; Introduce; Release; Getdomainpath; Write; Mkdir; Rm; Setperms; Watchevent; Error; Isintroduced; - Resume; Set_target; Restrict; Reset_watches |] + Resume; Set_target; Reset_watches |]let size = Array.length
operation_c_mappinglet
array_searchel a =tools/ocaml/libs/xb/op.ml +0
-1@@ -68,6 +68,5 @@ let to_string ty = | Isintroduced -> "IS_INTRODUCED" | Resume -> "RESUME" | Set_target -> "SET_TARGET" - | Restrict -> "RESTRICT" | Reset_watches -> "RESET_WATCHES" | Invalid -> "INVALID"tools/ocaml/libs/xb/xb.mli +0
-1@@ -22,7 +22,6 @@ module Op : | Isintroduced | Resume | Set_target - | Restrict | Reset_watches | Invalid val operation_c_mapping : operation arraytools/ocaml/xenstored/connection.ml +0
-0@@ -122,9 +122,6 @@ let close con =let
get_permcon =
con.permtools/ocaml/xenstored/connection.ml +0
-3-let restrict con domid = - con.perm <- Perms.Connection.restrict con.perm domid -let
set_targetcontarget_domid=
con.perm <- Perms.Connection.set_target (get_permcon) ~perms:[Perms.READ; Perms.WRITE]target_domidtools/ocaml/xenstored/logging.ml +0
-1@@ -241,7 +241,6 @@ let string_of_access_type = function | Xenbus.Xb.Op.Mkdir -> "mkdir " | Xenbus.Xb.Op.Rm -> "rm " | Xenbus.Xb.Op.Setperms -> "setperms " - | Xenbus.Xb.Op.Restrict -> "restrict " | Xenbus.Xb.Op.Reset_watches -> "reset watches" | Xenbus.Xb.Op.Set_target -> "settarget"tools/ocaml/xenstored/perms.ml +0
-0@@ -119,11 +119,6 @@ let is_owner (connection:t) id =let
is_dom0(connection:t) =
is_ownerconnection 0tools/ocaml/xenstored/perms.ml +0
-5-let restrict (connection:t) domid = - match connection.target, connection.main with - | None, (0, perms) -> { connection with main = (domid, perms) } - | _ -> raise Define.Permission_denied -let
elt_to_string(i,p) =
Printf.sprintf "%i%S" i (String.concat "" (List.map String.of_char (List.mapchar_of_permtyp)))tools/ocaml/xenstored/process.ml +0
-11@@ -172,30 +172,16 @@ let do_isintroduced con t domains cons data = in if domid = Define.domid_self || Domains.exist domains domid then "T\000" else "F\000" -(* [restrict] is in the patch queue since xen3.2 *) -let do_restrict con t domains cons data = - if not (Connection.is_dom0 con) - then raise Define.Permission_denied; - let domid = - match (split None '\000' data) with - | [ domid; "" ] -> c_int_of_string domid - | _ -> raise Invalid_Cmd_Args - in - Connection.restrict con domid - (* only in xen >= 4.2 *)let
do_reset_watchescon t domains cons data =
Connection.del_watches con;
Connection.del_transactions con(* only in >= xen3.3 *)
tools/ocaml/xenstored/process.ml +0
-2-(* we ensure backward compatibility with restrict by counting the number of argument of set_target ... *) -(* This is not very elegant, but it is safe as 'restrict' only restricts permission of dom0 connections *)let
do_set_targetcon t domains cons data =
if not (Connection.is_dom0 con)
then raise Define.Permission_denied;
match split None '\000' data withtools/ocaml/xenstored/process.ml +0
-1- | [ domid; "" ] -> do_restrict con t domains con data (* backward compatibility with xen3.2-pq *)| [ domid; target_domid; "" ] -> Connections.set_target cons (c_int_of_string domid) (c_int_of_string target_domid) | _ -> raise Invalid_Cmd_Argstools/ocaml/xenstored/process.ml +0
-2@@ -244,7 +230,6 @@ let function_of_type_simple_op ty = | Xenbus.Xb.Op.Isintroduced | Xenbus.Xb.Op.Resume | Xenbus.Xb.Op.Set_target - | Xenbus.Xb.Op.Restrict | Xenbus.Xb.Op.Reset_watches | Xenbus.Xb.Op.Invalid -> error "called function_of_type_simple_op on operation %s" (Xenbus.Xb.Op.to_string ty); raise (Invalid_argument (Xenbus.Xb.Op.to_string ty))@@ -428,7 +413,6 @@ let function_of_type ty = | Xenbus.Xb.Op.Isintroduced -> reply_data do_isintroduced | Xenbus.Xb.Op.Resume -> reply_ack do_resume | Xenbus.Xb.Op.Set_target -> reply_ack do_set_target - | Xenbus.Xb.Op.Restrict -> reply_ack do_restrict | Xenbus.Xb.Op.Reset_watches -> reply_ack do_reset_watches | Xenbus.Xb.Op.Invalid -> reply_ack do_error | _ -> function_of_type_simple_op tytools/xenstore/include/xenstore.h +0
-9@@ -132,15 +132,6 @@ bool xs_mkdir(struct xs_handle *h, xs_transaction_t t,bool xs_rm (struct xs_handle *h,xs_transaction_t t,const char *path); -/* Restrict a xenstore handle so that it acts as if it had the -* permissions of domain @domid. The handle must currently be -* using domain 0's credentials. -* -* Returns false on failure, in which case the handle continues -* to use the old credentials, or true on success. -*/ -bool xs_restrict (struct xs_handle *h,unsigned domid); -/* Get permissions of node (first element is owner, first perms is "other"). * Returns malloced array, or NULL: call free() after use. */ tools/xenstore/xenstored_core.c +0
-1@@ -1309,7 +1309,6 @@ static struct { { "IS_DOMAIN_INTRODUCED", do_is_domain_introduced }, [XS_RESUME] = { "RESUME", do_resume }, [XS_SET_TARGET] = { "SET_TARGET", do_set_target }, - [XS_RESTRICT] = { "RESTRICT", NULL }, [XS_RESET_WATCHES] = { "RESET_WATCHES", do_reset_watches }, [XS_DIRECTORY_PART] = { "DIRECTORY_PART", send_directory_part }, };tools/xenstore/xs.c +0
-8@@ -769,14 +769,6 @@ unwind:return false; } -bool xs_restrict (struct xs_handle *h,unsigned domid) -{ -char buf[16 ]; - -sprintf (buf,"%d" , domid); -return xs_bool (xs_single (h,XBT_NULL ,XS_RESTRICT , buf,NULL )); -} -/* Watch a node for changes (poll on fd to detect, or call read_watch()). * When the node (or any child) changes, fd will become readable. * Token is returned when watch is read, to allow matching. xen/include/public/io/xs_wire.h +2
-2@@ -48,8 +48,8 @@ enum xsd_sockmsg_typeXS_IS_DOMAIN_INTRODUCED ,XS_RESUME ,XS_SET_TARGET , -XS_RESTRICT , -XS_RESET_WATCHES , +/* XS_RESTRICT has been removed */ +XS_RESET_WATCHES =XS_SET_TARGET +2 , XS_DIRECTORY_PART,
Quoted 3 lines
xen/include/public/io/xs_wire.h enum xsd_sockmsg_type · line 55
Quoted 2 lines
xen/include/public/io/xs_wire.h +0
-0XS_TYPE_COUNT, /* Number of valid types. */
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
Wei Liu
AppliedQuoted 16 lines · David Scott
Quoted 16 lines · Juergen Gross
Quoted 12 lines · Juergen Gross
XS_RESTRICTand the xenstore library functionxs_restrict()have never been usable in all configurations and there are no known users.This functionality was thought to limit access rights of device models to xenstore in order to avoid affecting other domains in case of a security breech. Unfortunately
XS_RESTRICTwon't help as current qemu is requiring access to dom0 only accessible xenstore paths to work correctly. So this command is useless and should be removed.In order to avoid problems in the future remove all support for
XS_RESTRICTfrom xenstore.
Quoted 7 lines
Quoted 3 lines
Quoted 1 line
Signed-off-by Juergen Gross <[email protected]>Adding Dave Scott to Cc: list.
Looks fine to me:
Acked-by David Scott <[email protected]>
Applied.
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel