From: Andrew Cooper <andrew.cooper3@citrix.com>
To: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>
Subject: KEXEC: fix kexec_get_range_compat to fail vocally
Date: Mon, 5 Dec 2011 11:35:04 +0000 [thread overview]
Message-ID: <4EDCAC68.8060303@citrix.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 250 bytes --]
I am not sure that this is the only instance, but it is really not
acceptable to hand truncated pointers or sizes for physical memory to dom0.
--
Andrew Cooper - Dom0 Kernel Engineer, Citrix XenServer
T: +44 (0)1223 225 900, http://www.citrix.com
[-- Attachment #2: KEXEC-fix-kexec_get_range_compat.patch --]
[-- Type: text/x-patch, Size: 820 bytes --]
KEXEC: fix kexec_get_range_compat to fail vocally.
Fail with -ERANGE rather than silently truncating 64bit values (a
physical address and size) into 32bit integers for dom0 to consume.
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
diff -r df7cec2c6c03 xen/common/kexec.c
--- a/xen/common/kexec.c
+++ b/xen/common/kexec.c
@@ -395,6 +395,12 @@ static int kexec_get_range_compat(XEN_GU
ret = kexec_get_range_internal(&range);
+#define RANGE_MASK (((unsigned long)-1) & ~((unsigned int)-1))
+ /* Dont silently truncate physical addresses or sizes. */
+ if ( range.start & RANGE_MASK || range.size & RANGE_MASK )
+ return -ERANGE;
+#undef RANGE_MASK
+
if ( ret == 0 ) {
XLAT_kexec_range(&compat_range, &range);
if ( unlikely(copy_to_guest(uarg, &compat_range, 1)) )
[-- Attachment #3: Type: text/plain, Size: 138 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel
next reply other threads:[~2011-12-05 11:35 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-12-05 11:35 Andrew Cooper [this message]
2011-12-05 12:58 ` KEXEC: fix kexec_get_range_compat to fail vocally Jan Beulich
2011-12-05 13:01 ` Andrew Cooper
2011-12-05 13:18 ` Jan Beulich
2011-12-05 13:39 ` Andrew Cooper
2011-12-05 19:46 ` Keir Fraser
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4EDCAC68.8060303@citrix.com \
--to=andrew.cooper3@citrix.com \
--cc=xen-devel@lists.xensource.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.