diff options
author | Ian Jackson <ian.jackson@eu.citrix.com> | 2013-09-03 11:55:48 +0100 |
---|---|---|
committer | Ian Jackson <Ian.Jackson@eu.citrix.com> | 2013-09-03 12:03:39 +0100 |
commit | 070ab4c505934951f86f42dd8403cf62bc5822f0 (patch) | |
tree | 31b43a4b93625479f1d3327fd558ac75339c1d71 /tools/ocaml/xenstored/connection.ml | |
parent | 5b06843aa764012b9ace06ebac01c1fcf76e3fb7 (diff) | |
download | xen-070ab4c505934951f86f42dd8403cf62bc5822f0.tar.gz xen-070ab4c505934951f86f42dd8403cf62bc5822f0.tar.bz2 xen-070ab4c505934951f86f42dd8403cf62bc5822f0.zip |
oxenstored: Protect oxenstored from malicious domains.
add check logic when read from IO ring, and if error happens,
then mark the reading connection as "bad", Unless vm reboot,
oxenstored will not handle message from this connection any more.
xs_ring_stubs.c: add a more strict check on ring reading
connection.ml, domain.ml: add getter and setter for bad flag
process.ml: if exception raised when reading from domain's ring,
mark this domain as "bad"
xenstored.ml: if a domain is marked as "bad", do not handle it.
Signed-off-by: John Liu <john.liuqiming@huawei.com>
Acked-by: David Scott <dave.scott@eu.citrix.com>
(cherry picked from commit 704302ce9404c73cfb687d31adcf67094ab5bb53)
(cherry picked from commit a978634bee4db6c5e0ceeb66adcc5114f3f9bc48)
Conflicts:
tools/ocaml/xenstored/domain.ml
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
(cherry picked from commit 9f93027afd796a98d7b92898f4ccc772796a4874)
Diffstat (limited to 'tools/ocaml/xenstored/connection.ml')
-rw-r--r-- | tools/ocaml/xenstored/connection.ml | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/tools/ocaml/xenstored/connection.ml b/tools/ocaml/xenstored/connection.ml index 70cdbbfa91..c15595b4da 100644 --- a/tools/ocaml/xenstored/connection.ml +++ b/tools/ocaml/xenstored/connection.ml @@ -38,6 +38,11 @@ and t = { mutable perm: Perms.Connection.t; } +let mark_as_bad con = + match con.dom with + |None -> () + | Some domain -> Domain.mark_as_bad domain + let get_path con = Printf.sprintf "/local/domain/%i/" (match con.dom with None -> 0 | Some d -> Domain.get_id d) |