|
|
|
|
|
|
|
|
|
|
xen-ppc-devel
Re: [XenPPC] libvirt bad paddr patch for our hcall.c
Hollis Blanchard wrote:
On Wed, 2007-07-11 at 14:12 +0200, Christian Ehrhardt wrote:
I added a new inline function "invalid_endianness" for better readability.
An invalid address now returns -EINVAL and triggers a WARN_ON().
If a more sophisticated check is wanted later on like a additional >0x0C
or something we can add this there on a central point.
If we will need it somewhere else in the future we can move it to a header.
Perhaps these messages should be quieted a little:
(XEN) pfn2mfn: Dom[0] pfn 0x3f875eb000000 is not a valid page
(XEN) paddr_to_maddr: Dom:0 bad paddr: 0x3f875eb000000000
This only occurs when something goes really wrong, so why silence it?
We may move the sanity check from the kernel down here.
It also looks like we need to have the callers of paddr_to_maddr()
(within Xen) do some error-checking and return the error.
I think the xen portion just does what it was designed for, it receives
an address and tries to translate it. In our scenario the userspace sets
up a wrong padded structure which lead to misinterpretation of the
address. Therefore the fix is in userspace, but now we know this issue
we can add some sanity checks to make this issue more visible if it
occurs which is what I've done with my patch.
The question is now where to add such a sanity check - I'm open to every
suggestion. The Kernel patch I sent should be such a standard "I'm a
syscall and I do sanity checks on the values passed to me before using
them" mechanism.
However, it isn't the kernel's job to be checking these addresses, so
this patch isn't the right solution.
The "solution" for the current issue is what was checked in to the
libvirt cvs last week and fixes the initial call from userspace.
Let's discuss this via phone today where to add the sanity check and I
think we find the solution satisfying both of us much faster ;-)
--
Grüsse / regards,
Christian Ehrhardt
IBM Linux Technology Center, Open Virtualization
+49 7031/16-3385
Ehrhardt@xxxxxxxxxxxxxxxxxx
Ehrhardt@xxxxxxxxxx
IBM Deutschland Entwicklung GmbH
Vorsitzender des Aufsichtsrats: Johann Weihen
Geschäftsführung: Herbert Kircher
Sitz der Gesellschaft: Böblingen
Registergericht: Amtsgericht Stuttgart, HRB 243294
_______________________________________________
Xen-ppc-devel mailing list
Xen-ppc-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-ppc-devel
|
|
|
|
|