All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] xen/xsm: forbid PV guest console reads
@ 2013-09-30 15:48 Daniel De Graaf
  2013-09-30 15:48 ` [PATCH 2/2] xen/xsm: clean up unneeded current references Daniel De Graaf
  2013-09-30 16:10 ` [PATCH 1/2] xen/xsm: forbid PV guest console reads Jan Beulich
  0 siblings, 2 replies; 7+ messages in thread
From: Daniel De Graaf @ 2013-09-30 15:48 UTC (permalink / raw)
  To: JBeulich; +Cc: xen-devel, Daniel De Graaf, keir, ian.campbell

When the hypervisor was compiled in debug mode (with VERBOSE defined),
PV guests incorrectly had access to both read and write to the console.
Change this to only allow write access; since such writes were limited
by log levels in 48d50de8e0, remove the dependency on VERBOSE
completely.

Reported-by: Jan Beulich <JBeulich@suse.com>
Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
---

Alternatively, if controlling writes with VERBOSE is still desired, the
ifdef VERBOSE can be retained surrounding the if() with the following
commit message:

The CONSOLEIO_read operation was incorrectly allowed to PV guests if the
hypervisor was compiled in debug mode (with VERBOSE defined).

 xen/include/xsm/dummy.h | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/xen/include/xsm/dummy.h b/xen/include/xsm/dummy.h
index 052f3e0..1f4960d 100644
--- a/xen/include/xsm/dummy.h
+++ b/xen/include/xsm/dummy.h
@@ -221,11 +221,9 @@ static XSM_INLINE int xsm_memory_stat_reservation(XSM_DEFAULT_ARG struct domain
 static XSM_INLINE int xsm_console_io(XSM_DEFAULT_ARG struct domain *d, int cmd)
 {
     XSM_ASSERT_ACTION(XSM_OTHER);
-#ifdef VERBOSE
-    return xsm_default_action(XSM_HOOK, current->domain, NULL);
-#else
-    return xsm_default_action(XSM_PRIV, current->domain, NULL);
-#endif
+    if ( cmd == CONSOLEIO_write )
+        return xsm_default_action(XSM_HOOK, d, NULL);
+    return xsm_default_action(XSM_PRIV, d, NULL);
 }
 
 static XSM_INLINE int xsm_profile(XSM_DEFAULT_ARG struct domain *d, int op)
-- 
1.8.1.4

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

end of thread, other threads:[~2013-09-30 19:26 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-09-30 15:48 [PATCH 1/2] xen/xsm: forbid PV guest console reads Daniel De Graaf
2013-09-30 15:48 ` [PATCH 2/2] xen/xsm: clean up unneeded current references Daniel De Graaf
2013-09-30 16:10 ` [PATCH 1/2] xen/xsm: forbid PV guest console reads Jan Beulich
2013-09-30 17:29   ` Daniel De Graaf
2013-09-30 18:06     ` Konrad Rzeszutek Wilk
2013-09-30 18:29       ` Daniel De Graaf
2013-09-30 19:26         ` Konrad Rzeszutek Wilk

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.