All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ben Guthro <ben@guthro.net>
To: Jan Beulich <JBeulich@suse.com>
Cc: 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 09:10:21 -0400	[thread overview]
Message-ID: <CAOvdn6W9n6VhvzMx3nU94CcBetezQKwAZohe8c8ZEW-CAH+GgQ@mail.gmail.com> (raw)
In-Reply-To: <51FFBF8B02000078000E94AC@nat28.tlf.novell.com>


[-- Attachment #1.1: Type: text/plain, Size: 1549 bytes --]

On Mon, Aug 5, 2013 at 9:06 AM, Jan Beulich <JBeulich@suse.com> 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>
> >
>

Looks OK to me, FWIW

You can add
Reviewed-by: Ben Guthro <benjamin.guthro@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 )
>
>
>
>

[-- Attachment #1.2: Type: text/html, Size: 2418 bytes --]

[-- Attachment #2: Type: text/plain, Size: 126 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

  reply	other threads:[~2013-08-05 13:10 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 [this message]
2013-08-05 14:55   ` Andrew Cooper

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=CAOvdn6W9n6VhvzMx3nU94CcBetezQKwAZohe8c8ZEW-CAH+GgQ@mail.gmail.com \
    --to=ben@guthro.net \
    --cc=JBeulich@suse.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.