WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] dom0 and anonymous connections can create unlimited size

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] dom0 and anonymous connections can create unlimited sized entries in the store.
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Thu, 11 May 2006 17:04:11 +0000
Delivery-date: Fri, 12 May 2006 01:59:05 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User vhanquez@xxxxxxxxxxxxxxxxxxxxxxx
# Node ID 891e0d1cf4abfac1b3ce1210f22032dad205d46d
# Parent  08f5adb5058b6122e802aa243c4dd253c701c00c
dom0 and anonymous connections can create unlimited sized entries in the store.

Signed-off-by: Vincent Hanquez <vincent@xxxxxxxxxxxxx>
---
 tools/xenstore/xenstored_core.c   |    2 +-
 tools/xenstore/xenstored_domain.c |    9 +++++++--
 tools/xenstore/xenstored_domain.h |    2 ++
 3 files changed, 10 insertions(+), 3 deletions(-)

diff -r 08f5adb5058b -r 891e0d1cf4ab tools/xenstore/xenstored_core.c
--- a/tools/xenstore/xenstored_core.c   Thu May 11 15:01:54 2006 +0100
+++ b/tools/xenstore/xenstored_core.c   Thu May 11 15:51:56 2006 +0100
@@ -461,7 +461,7 @@ static bool write_node(struct connection
                + node->num_perms*sizeof(node->perms[0])
                + node->datalen + node->childlen;
 
-       if (data.dsize >= quota_max_entry_size)
+       if (domain_is_unprivileged(conn) && data.dsize >= quota_max_entry_size)
                goto error;
 
        data.dptr = talloc_size(node, data.dsize);
diff -r 08f5adb5058b -r 891e0d1cf4ab tools/xenstore/xenstored_domain.c
--- a/tools/xenstore/xenstored_domain.c Thu May 11 15:01:54 2006 +0100
+++ b/tools/xenstore/xenstored_domain.c Thu May 11 15:51:56 2006 +0100
@@ -248,6 +248,11 @@ bool domain_can_read(struct connection *
 {
        struct xenstore_domain_interface *intf = conn->domain->interface;
        return (intf->req_cons != intf->req_prod);
+}
+
+bool domain_is_unprivileged(struct connection *conn)
+{
+       return (conn && conn->domain && conn->domain->domid != 0);
 }
 
 bool domain_can_write(struct connection *conn)
@@ -587,7 +592,7 @@ void domain_entry_dec(struct connection 
 
 int domain_entry(struct connection *conn)
 {
-       return (conn && conn->domain && conn->domain->domid)
+       return (domain_is_unprivileged(conn))
                ? conn->domain->nbentry
                : 0;
 }
@@ -609,7 +614,7 @@ void domain_watch_dec(struct connection 
 
 int domain_watch(struct connection *conn)
 {
-       return (conn && conn->domain && conn->domain->domid)
+       return (domain_is_unprivileged(conn))
                ? conn->domain->nbwatch
                : 0;
 }
diff -r 08f5adb5058b -r 891e0d1cf4ab tools/xenstore/xenstored_domain.h
--- a/tools/xenstore/xenstored_domain.h Thu May 11 15:01:54 2006 +0100
+++ b/tools/xenstore/xenstored_domain.h Thu May 11 15:51:56 2006 +0100
@@ -47,6 +47,8 @@ bool domain_can_read(struct connection *
 bool domain_can_read(struct connection *conn);
 bool domain_can_write(struct connection *conn);
 
+bool domain_is_unprivileged(struct connection *conn);
+
 /* Quota manipulation */
 void domain_entry_inc(struct connection *conn);
 void domain_entry_dec(struct connection *conn);

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] dom0 and anonymous connections can create unlimited sized entries in the store., Xen patchbot-unstable <=