Bug 678571 - hap_gva_to_gfn_* do not preserve domain context
Summary: hap_gva_to_gfn_* do not preserve domain context
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: kernel-xen
Version: 5.6
Hardware: x86_64
OS: Linux
low
low
Target Milestone: rc
: ---
Assignee: Radim Krčmář
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks: 678618
TreeView+ depends on / blocked
 
Reported: 2011-02-18 13:29 UTC by Radim Krčmář
Modified: 2011-07-21 09:48 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2011-07-21 09:48:21 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
backport of gdbsx, suffering from this bug (97.33 KB, patch)
2011-02-18 13:29 UTC, Radim Krčmář
no flags Details | Diff
fix, using different function to get mfn from gfn (1.35 KB, patch)
2011-02-18 13:39 UTC, Radim Krčmář
no flags Details | Diff
fix, using different function to get mfn from gfn (1.35 KB, patch)
2011-02-18 15:18 UTC, Radim Krčmář
no flags Details | Diff


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2011:1065 0 normal SHIPPED_LIVE Important: Red Hat Enterprise Linux 5.7 kernel security and bug fix update 2011-07-21 09:21:37 UTC

Description Radim Krčmář 2011-02-18 13:29:51 UTC
Created attachment 479501 [details]
backport of gdbsx, suffering from this bug

Description of problem:
hap_gva_to_gfn_* functions do not preserve domain context when requesting mfn from gfn, returning the current domain's mfn regardless of wanted domain.

Ecountered while backporting gdbsx, where dom0 was current domain, yet information about paused guest was wanted.

How reproducible:
Always.

Steps to reproduce:
1. Backport gdbsx (patch attached)
2. Run the modified hypervisor with enabled hap. (hardware support required)
3. Start debugging a hvm machine (howto in tools/gdbsx/README)
4. See it fail on a breakpoint.
  
Actual results:
(gdbsx output)
ERROR:xg_write_mem:ERROR: failed to write 0 bytes. errno:14 rc:-1

Expected results:
(No error and the breakpoint works)

Comment 1 Radim Krčmář 2011-02-18 13:39:39 UTC
Created attachment 479503 [details]
fix, using different function to get mfn from gfn

get_mfn_from_gpfn(gfn) calls gfn_to_mfn_current(pfn),
proposed patch uses gfn_to_mfn(domain, gfn) instead, which calls either gfn_to_mfn_current(pfn), or gfn_to_mfn_foreign(domain, gfn), depending on context, thus fixing the bug with little overhead.

Comment 2 Radim Krčmář 2011-02-18 15:18:53 UTC
Created attachment 479539 [details]
fix, using different function to get mfn from gfn

The last patch was not using mfn_x, hence failing typecheck.
Replaced gfn_to_mfn by gmfn_to_mfn. (macro for mfn_x(gfn_to_mfn))

Comment 3 RHEL Program Management 2011-02-25 15:39:55 UTC
This request was evaluated by Red Hat Product Management for inclusion in a Red
Hat Enterprise Linux maintenance release.  Product Management has requested
further review of this request by Red Hat Engineering, for potential
inclusion in a Red Hat Enterprise Linux Update release for currently deployed
products.  This request is not yet committed for inclusion in an Update
release.

Comment 9 Jarod Wilson 2011-03-16 18:02:27 UTC
Patch(es) available in kernel-2.6.18-248.el5
Detailed testing feedback is always welcomed.

Comment 11 Jinxin Zheng 2011-04-28 10:09:25 UTC
We checked the -257 code, confirming that the patches are inside.
Due to comment 5, debug tools won't be packaged with any release, thus this shouldn't need any specific testing. Setting this 'Verified:SanityOnly'.

Comment 12 errata-xmlrpc 2011-07-21 09:48:21 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHSA-2011-1065.html


Note You need to log in before you can comment on or make changes to this bug.