From: Xen.org security team <security@xen.org>
To: xen-announce@lists.xen.org, xen-devel@lists.xen.org,
xen-users@lists.xen.org, oss-security@lists.openwall.com
Cc: "Xen.org security team" <security@xen.org>
Subject: Xen Security Advisory 210 - arm: memory corruption when freeing p2m pages
Date: Thu, 23 Feb 2017 16:28:18 +0000 [thread overview]
Message-ID: <E1cgwFe-0005Mf-Pk@xenbits.xenproject.org> (raw)
[-- Attachment #1: Type: text/plain, Size: 3023 bytes --]
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Xen Security Advisory XSA-210
arm: memory corruption when freeing p2m pages
ISSUE DESCRIPTION
=================
When freeing pages used for stage-2 page tables, the freeing routine
failed to remove these pages from an internally managed list they were
put on during allocation. The same list node elements are also
used by the hypervisor's page allocator. Subsequent manipulation of
ARM's private P2M list could therefore corrupt the lists maintained by
the page allocator. The buggy code is exposed to guests via the
XENMEM_decrease_reservation hypercall.
IMPACT
======
A malicious or buggy guest may corrupt hypervisor state, commonly
leading to a host crash (Denial of Service). Privilege escalation or
information leaks cannot be excluded.
VULNERABLE SYSTEMS
==================
Only Xen version 4.8 is affected. Xen versions 4.7 and earlier are not
vulnerable.
Only ARM systems are vulnerable. X86 based systems are not vulnerable.
MITIGATION
==========
There is no known mitigation.
NOTE REGARDING LACK OF EMBARGO
==============================
The issue was discussed publicly before being recognized as a security
issue.
RESOLUTION
==========
Applying the attached patch resolves this issue.
xsa210.patch xen-unstable, Xen 4.8.x
$ sha256sum xsa210*
10e26c017c916dcac261c6a3c92656831f0ad037f792940e6faf6905c6e23861 xsa210.patch
$
CREDITS
=======
The initial bug was discovered by Vijay Kilari of Cavium and the
security aspect was diagnosed by Julien Grall of ARM.
DEPLOYMENT DURING EMBARGO
=========================
Deployment of the patches and/or mitigations described above (or
others which are substantially similar) is permitted during the
embargo, even on public-facing systems with untrusted guest users and
administrators.
But: Distribution of updated software is prohibited (except to other
members of the predisclosure list).
Predisclosure list members who wish to deploy significantly different
patches and/or mitigations, please contact the Xen Project Security
Team.
(Note: this during-embargo deployment notice is retained in
post-embargo publicly released Xen Project advisories, even though it
is then no longer applicable. This is to enable the community to have
oversight of the Xen Project Security Team's decisionmaking.)
For more information about permissible uses of embargoed information,
consult the Xen Project community's agreed Security Policy:
http://www.xenproject.org/security-policy.html
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1
iQEcBAEBAgAGBQJYrw2aAAoJEIP+FMlX6CvZuw4H/34z2io/65h2RLDL3bx4w//A
nWNcrceKrxyvtZmTss56RHrUeiOOKOeuCXWMx5CSihBcSRXqyZa79IDul9t1b7fB
m6NUPerILGueF3uOYTRUvvSiWKWRzVPOCgqSxlCmd7YTrkjHZkq/x2Gb9Acj3hrl
yE0fFdD/hTIN9wZtHWY+gTIXMIGHBJ4/xieZeYZvylbnmu9nDC0WIupTExonWqie
sG0DICl+eKJMt3ioSzaGd9117Xk1P7JWvcr7MJQvzn/2VDTG2TjC4kZE1iDHHVPz
+txQh2G2Luf+jX5VQSqWnlv7I9zuGlqYEpAMQacjrLzGejuqPSC2kbzliOEoCaE=
=1k3w
-----END PGP SIGNATURE-----
[-- Attachment #2: xsa210.patch --]
[-- Type: application/octet-stream, Size: 1480 bytes --]
From: Julien Grall <julien.grall@arm.com>
Subject: arm/p2m: remove the page from p2m->pages list before freeing it
The p2m code is using the page list field to link all the pages used
for the stage-2 page tables. The page is added into the p2m->pages
list just after the allocation but never removed from the list.
The page list field is also used by the allocator, not removing may
result a later Xen crash due to inconsistency (see [1]).
This bug was introduced by the reworking of p2m code in commit 2ef3e36ec7
"xen/arm: p2m: Introduce p2m_set_entry and __p2m_set_entry".
[1] https://lists.xenproject.org/archives/html/xen-devel/2017-02/msg00524.html
Reported-by: Vijaya Kumar K <Vijaya.Kumar@cavium.com>
Signed-off-by: Julien Grall <julien.grall@arm.com>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
--- a/xen/arch/arm/p2m.c
+++ b/xen/arch/arm/p2m.c
@@ -660,6 +660,7 @@ static void p2m_free_entry(struct p2m_domain *p2m,
unsigned int i;
lpae_t *table;
mfn_t mfn;
+ struct page_info *pg;
/* Nothing to do if the entry is invalid. */
if ( !p2m_valid(entry) )
@@ -697,7 +698,10 @@ static void p2m_free_entry(struct p2m_domain *p2m,
mfn = _mfn(entry.p2m.base);
ASSERT(mfn_valid(mfn_x(mfn)));
- free_domheap_page(mfn_to_page(mfn_x(mfn)));
+ pg = mfn_to_page(mfn_x(mfn));
+
+ page_list_del(pg, &p2m->pages);
+ free_domheap_page(pg);
}
static bool p2m_split_superpage(struct p2m_domain *p2m, lpae_t *entry,
[-- Attachment #3: Type: text/plain, Size: 127 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
reply other threads:[~2017-02-23 16:28 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=E1cgwFe-0005Mf-Pk@xenbits.xenproject.org \
--to=security@xen.org \
--cc=oss-security@lists.openwall.com \
--cc=xen-announce@lists.xen.org \
--cc=xen-devel@lists.xen.org \
--cc=xen-users@lists.xen.org \
/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 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).