xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* granting access to MSI-X table and pending bit array
@ 2010-07-07 10:14 Jan Beulich
  2010-07-07 14:14 ` Konrad Rzeszutek Wilk
  0 siblings, 1 reply; 9+ messages in thread
From: Jan Beulich @ 2010-07-07 10:14 UTC (permalink / raw)
  To: xen-devel@lists.xensource.com

The original implementation (c/s 17536) disallowed access to these
after granting access to all BAR specified resources (i.e. this was
almost correct, except for a small time window during which the
memory was accessible to the guest and except for hiding the
pending bit array from the guest), but this got reverted with c/s
20171.

Afaics this is a security problem, as CPU accesses to the granted
memory don't go through any IOMMU and hence there's no place
these could be filtered out even in a supposedly secure environment
(not that I think devices accesses would be filtered at present, but
for those this would at least be possible ), and such accesses could
inadvertently or maliciously unmask masked vectors or modify the
message address/data fields.

Imo the pending bit array must be granted read-only access to the
guest (instead of either granting full access or no access at all),
with the potential side effect of also granting read-only access to
the table. And I would even think that this shouldn't be done in the
tools, but rather in Xen itself (since it knows of all the PCI devices
and their respective eventual MSI-X address ranges), thus at once
eliminating any timing windows.

Jan

^ permalink raw reply	[flat|nested] 9+ messages in thread
* RE: granting access to MSI-X table and pending bit array
@ 2010-08-05 17:44 Jan Beulich
  0 siblings, 0 replies; 9+ messages in thread
From: Jan Beulich @ 2010-08-05 17:44 UTC (permalink / raw)
  To: yunhong.jiang, konrad.wilk; +Cc: xen-devel

>>> "Jiang, Yunhong"  07/15/10 10:24 AM >>>
>Will the small window for qemu exists still? QEMU may setup the mapping before the msix_capability_init().

Yes, I think so, as Dom0 still is permitted to map this area writable (revoking this requires a qemu fix to be committed at the same time, or a prerequisite fix to make qemu map this area read-only, which I think doesn't fit well within the MMIO model used there).

>BTW, I'm not sure if mapping as RO this will solve the sharing issue (i.e. the PBA or table entry share with other resource).

Not if the device meets the standard's requirement of these two tables being allowed to share a page between them, but not with any other resource.

Jan

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

end of thread, other threads:[~2010-08-05 17:44 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-07-07 10:14 granting access to MSI-X table and pending bit array Jan Beulich
2010-07-07 14:14 ` Konrad Rzeszutek Wilk
2010-07-07 14:31   ` Jan Beulich
2010-07-07 16:49     ` Stefano Stabellini
2010-07-09  9:54       ` Jan Beulich
2010-07-09  9:59         ` Keir Fraser
2010-07-12  9:55   ` Jan Beulich
2010-07-15  8:22     ` Jiang, Yunhong
  -- strict thread matches above, loose matches on Subject: below --
2010-08-05 17:44 Jan Beulich

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).