[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen-unstable] [XENSTORED] Fix errno 'leak' in xenstored.



# HG changeset patch
# User kaf24@xxxxxxxxxxxxxxxxxxxxx
# Node ID d108efc94de79ab8aa34311580c657740300908e
# Parent  ddb3581f4f1cde96fc5c5a33f0ef4b7c650d0731
[XENSTORED] Fix errno 'leak' in xenstored.

In certain cases, when a client doesn't have enough permissions, the
errno variable is not set in xenstored_core.c before its value is
reported back.  As a result, the client can learn about the errno of
the last failed request to xenstored (which could have come from
another client).  (An unintended information channel! :-)

From: Magnus Carlsson <magnus@xxxxxxxxxx>
Signed-off-by: Keir Fraser <keir@xxxxxxxxxxxxx>
---
 tools/xenstore/xenstored_core.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletion(-)

diff -r ddb3581f4f1c -r d108efc94de7 tools/xenstore/xenstored_core.c
--- a/tools/xenstore/xenstored_core.c   Sat Nov 11 01:19:26 2006 +0000
+++ b/tools/xenstore/xenstored_core.c   Sat Nov 11 01:23:11 2006 +0000
@@ -575,8 +575,10 @@ struct node *get_node(struct connection 
        /* If we don't have permission, we don't have node. */
        if (node) {
                if ((perm_for_conn(conn, node->perms, node->num_perms) & perm)
-                   != perm)
+                   != perm) {
+                       errno = EACCES;
                        node = NULL;
+               }
        }
        /* Clean up errno if they weren't supposed to know. */
        if (!node) 

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


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.