xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 2/6] trace: fix T_INFO_FIRST_OFFSET
@ 2010-06-29 15:32 Jan Beulich
  2010-06-30 14:52 ` George Dunlap
  0 siblings, 1 reply; 11+ messages in thread
From: Jan Beulich @ 2010-06-29 15:32 UTC (permalink / raw)
  To: George Dunlap; +Cc: xen-devel

[-- Attachment #1: Type: text/plain, Size: 940 bytes --]

This wasn't defined correctly, thus allowing in the
num_online_cpus() == NR_CPUS case to pass a corrupted MFN to
Dom0.

Signed-off-by: Jan Beulich <jbeulich@novell.com>

--- 2010-06-15.orig/xen/common/trace.c	2010-06-28 11:58:37.000000000 +0200
+++ 2010-06-15/xen/common/trace.c	2010-06-28 11:58:37.000000000 +0200
@@ -51,7 +51,7 @@ static struct t_info *t_info;
 #define T_INFO_PAGES 2  /* Size fixed at 2 pages for now. */
 #define T_INFO_SIZE ((T_INFO_PAGES)*(PAGE_SIZE))
 /* t_info.tbuf_size + list of mfn offsets + 1 to round up / sizeof uint32_t */
-#define T_INFO_FIRST_OFFSET ((sizeof(int16_t) + NR_CPUS * sizeof(int16_t) + 1) / sizeof(uint32_t))
+#define T_INFO_FIRST_OFFSET (((2 + NR_CPUS) * sizeof(uint16_t)) / sizeof(uint32_t))
 static DEFINE_PER_CPU_READ_MOSTLY(struct t_buf *, t_bufs);
 static DEFINE_PER_CPU_READ_MOSTLY(unsigned char *, t_data);
 static DEFINE_PER_CPU_READ_MOSTLY(spinlock_t, t_lock);




[-- Attachment #2: trace-t_info-first-offset.patch --]
[-- Type: text/plain, Size: 934 bytes --]

This wasn't defined correctly, thus allowing in the
num_online_cpus() == NR_CPUS case to pass a corrupted MFN to
Dom0.

Signed-off-by: Jan Beulich <jbeulich@novell.com>

--- 2010-06-15.orig/xen/common/trace.c	2010-06-28 11:58:37.000000000 +0200
+++ 2010-06-15/xen/common/trace.c	2010-06-28 11:58:37.000000000 +0200
@@ -51,7 +51,7 @@ static struct t_info *t_info;
 #define T_INFO_PAGES 2  /* Size fixed at 2 pages for now. */
 #define T_INFO_SIZE ((T_INFO_PAGES)*(PAGE_SIZE))
 /* t_info.tbuf_size + list of mfn offsets + 1 to round up / sizeof uint32_t */
-#define T_INFO_FIRST_OFFSET ((sizeof(int16_t) + NR_CPUS * sizeof(int16_t) + 1) / sizeof(uint32_t))
+#define T_INFO_FIRST_OFFSET (((2 + NR_CPUS) * sizeof(uint16_t)) / sizeof(uint32_t))
 static DEFINE_PER_CPU_READ_MOSTLY(struct t_buf *, t_bufs);
 static DEFINE_PER_CPU_READ_MOSTLY(unsigned char *, t_data);
 static DEFINE_PER_CPU_READ_MOSTLY(spinlock_t, t_lock);

[-- Attachment #3: Type: text/plain, Size: 138 bytes --]

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

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

end of thread, other threads:[~2010-07-01  9:53 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-06-29 15:32 [PATCH 2/6] trace: fix T_INFO_FIRST_OFFSET Jan Beulich
2010-06-30 14:52 ` George Dunlap
2010-06-30 15:15   ` Jan Beulich
2010-06-30 15:28     ` George Dunlap
2010-06-30 16:10       ` George Dunlap
2010-06-30 16:12         ` George Dunlap
2010-06-30 17:14           ` Keir Fraser
2010-06-30 18:12             ` George Dunlap
2010-07-01  9:50               ` Jan Beulich
2010-07-01  9:49           ` Jan Beulich
2010-07-01  9:53             ` George Dunlap

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).