From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Jan Beulich <JBeulich@suse.com>
Cc: Ben Guthro <ben@guthro.net>,
xiantao.zhang@intel.com, xen-devel <xen-devel@lists.xen.org>
Subject: Re: Ping: [PATCH] VT-d: protect against bogus information coming from BIOS
Date: Mon, 5 Aug 2013 15:55:10 +0100 [thread overview]
Message-ID: <51FFBCCE.2010607@citrix.com> (raw)
In-Reply-To: <51FFBF8B02000078000E94AC@nat28.tlf.novell.com>
On 05/08/13 14:06, Jan Beulich wrote:
> Ping?
>
>>>> On 10.07.13 at 12:26, "Jan Beulich" <JBeulich@suse.com> wrote:
>> Add checks similar to those done by Linux: The DRHD address must not
>> be all zeros or all ones (Linux only checks for zero), and capabilities
>> as well as extended capabilities must not be all ones.
>>
>> Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
>>
>> --- a/xen/drivers/passthrough/vtd/dmar.c
>> +++ b/xen/drivers/passthrough/vtd/dmar.c
>> @@ -447,6 +447,9 @@ acpi_parse_one_drhd(struct acpi_dmar_hea
>> if ( (ret = acpi_dmar_check_length(header, sizeof(*drhd))) != 0 )
>> return ret;
>>
>> + if ( !drhd->address || !(drhd->address + 1) )
>> + return -ENODEV;
>> +
>> dmaru = xzalloc(struct acpi_drhd_unit);
>> if ( !dmaru )
>> return -ENOMEM;
>> --- a/xen/drivers/passthrough/vtd/iommu.c
>> +++ b/xen/drivers/passthrough/vtd/iommu.c
>> @@ -1159,6 +1159,9 @@ int __init iommu_alloc(struct acpi_drhd_
>> dprintk(VTDPREFIX,
>> "cap = %"PRIx64" ecap = %"PRIx64"\n", iommu->cap, iommu->ecap);
>> }
>> + if ( !(iommu->cap + 1) || !(iommu->ecap + 1) )
>> + return -ENODEV;
>> +
>> if ( cap_fault_reg_offset(iommu->cap) +
>> cap_num_fault_regs(iommu->cap) * PRIMARY_FAULT_REG_LEN >= PAGE_SIZE
>> ||
>> ecap_iotlb_offset(iommu->ecap) >= PAGE_SIZE )
>
>
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel
prev parent reply other threads:[~2013-08-05 14:55 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-07-10 10:26 [PATCH] VT-d: protect against bogus information coming from BIOS Jan Beulich
2013-07-10 11:32 ` Ben Guthro
2013-08-05 13:06 ` Ping: " Jan Beulich
2013-08-05 13:10 ` Ben Guthro
2013-08-05 14:55 ` Andrew Cooper [this message]
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=51FFBCCE.2010607@citrix.com \
--to=andrew.cooper3@citrix.com \
--cc=JBeulich@suse.com \
--cc=ben@guthro.net \
--cc=xen-devel@lists.xen.org \
--cc=xiantao.zhang@intel.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 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).