From: Josh Triplett <josh-iaAMLnmF4UmaiuxdJuQwMA@public.gmane.org>
To: Matt Fleming <matt-mF/unelCI9GS6iBeEJttW/XRex20P6io@public.gmane.org>
Cc: "Môshe van der Sterre" <me-A/3C56C7qwM@public.gmane.org>,
linux-efi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
"Matthew Garrett" <mjg59-1xO5oi07KQx4cg9Nei1l7Q@public.gmane.org>
Subject: Re: [PATCH] x86/efi-bgrt: Don't ignore the BGRT if the 'valid' bit is 0
Date: Fri, 8 Jan 2016 10:09:25 -0800 [thread overview]
Message-ID: <20160108180925.GA3488@cloud> (raw)
In-Reply-To: <20160108113047.GD2532-mF/unelCI9GS6iBeEJttW/XRex20P6io@public.gmane.org>
On Fri, Jan 08, 2016 at 11:30:47AM +0000, Matt Fleming wrote:
> On Tue, 05 Jan, at 05:38:54PM, Môshe van der Sterre wrote:
> > On 01/05/2016 04:46 PM, Matt Fleming wrote:
> > >Shouldn't this be pr_debug() instead of pr_err()?
> >
> > It is an actual error for the image to be anything else. I did look at your
> > commit "x86/efi-bgrt: Switch pr_err() to pr_debug() for invalid BGRT", and
> > actually intentionally chose pr_err() instead of pr_debug() because of it.
> >
> > From that commit message:
> > However, Josh points that out it still makes sense to test the
> > validity of the upper 7 bits of the 'status' field, since
> > they're marked as "reserved" in the spec and must be zero. If
> > firmware violates this it really *is* an error.
> >
> > From the ACPI spec:
> > If the value is 0, the Image Type is Bitmap. The format for a Bitmap is
> > defined at the reference located in the ACPI Link Document under the heading
> > "Types of Bitmaps". All other values not defined in the table are reserved
> > for future use.
> > and also:
> > Implementations must present the image in a 24 bit bitmap with pixel
> > format 0xRRGGBB, or a 32-bit bitmap with the pixel format 0xrrRRGGBB, where
> > ‘rr’ is reserved.
> > Following the link to MSDN, the header id is definitely also required to be
> > "BM" for those types,
> > That said, I'm not 100% sure if pr_err() is right for any of the errors in
>
> OK, I'll queue this up. Josh, does this look OK to you?
Yes, checking the bitmap file header seems like a good additional
cross-check. And since the spec says that the image must be a bitmap
(given the one possible value for the format field), and since we can't
reliably know *how much* data to read without reading the bitmap header,
we should indeed error out if the data doesn't look like a bitmap.
Reviewed-by: Josh Triplett <josh-iaAMLnmF4UmaiuxdJuQwMA@public.gmane.org>
next prev parent reply other threads:[~2016-01-08 18:09 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-12-20 21:53 [PATCH] x86/efi-bgrt: Don't ignore the BGRT if the 'valid' bit is 0 Môshe van der Sterre
[not found] ` <1450648391-4631-1-git-send-email-me-A/3C56C7qwM@public.gmane.org>
2016-01-05 15:46 ` Matt Fleming
[not found] ` <20160105154640.GB2714-mF/unelCI9GS6iBeEJttW/XRex20P6io@public.gmane.org>
2016-01-05 16:38 ` Môshe van der Sterre
[not found] ` <568BF19E.3040701-A/3C56C7qwM@public.gmane.org>
2016-01-08 11:30 ` Matt Fleming
[not found] ` <20160108113047.GD2532-mF/unelCI9GS6iBeEJttW/XRex20P6io@public.gmane.org>
2016-01-08 11:42 ` Matt Fleming
[not found] ` <20160108114235.GE2532-mF/unelCI9GS6iBeEJttW/XRex20P6io@public.gmane.org>
2016-01-14 12:29 ` Matt Fleming
[not found] ` <20160114122945.GB3602-mF/unelCI9GS6iBeEJttW/XRex20P6io@public.gmane.org>
2016-01-14 12:31 ` Môshe van der Sterre
2016-01-08 18:09 ` Josh Triplett [this message]
[not found] <1452809107-17779-1-git-send-email-me@moshe.nl>
[not found] ` <1452809107-17779-1-git-send-email-me-A/3C56C7qwM@public.gmane.org>
2016-01-18 21:08 ` Matt Fleming
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=20160108180925.GA3488@cloud \
--to=josh-iaamlnmf4umaiuxdjuqwma@public.gmane.org \
--cc=linux-efi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=matt-mF/unelCI9GS6iBeEJttW/XRex20P6io@public.gmane.org \
--cc=me-A/3C56C7qwM@public.gmane.org \
--cc=mjg59-1xO5oi07KQx4cg9Nei1l7Q@public.gmane.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 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.