All of lore.kernel.org
 help / color / mirror / Atom feed
From: Matt Fleming <matt-mF/unelCI9GS6iBeEJttW/XRex20P6io@public.gmane.org>
To: "Luck, Tony" <tony.luck-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
Cc: "Zhang,
	Jonathan Zhixiong"
	<zjzhang-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>,
	Matt Fleming
	<matt.fleming-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>,
	linux-efi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	harba-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org,
	linaro-acpi-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org
Subject: Re: [PATCHv2] efi: Handle memory error structures produced based on old versions of standard
Date: Wed, 8 Jul 2015 16:54:40 +0100	[thread overview]
Message-ID: <20150708155440.GA5598@codeblueprint.co.uk> (raw)
In-Reply-To: <20150630225751.GA18060-E6Nu+q68HHTI/KE9syI0vLvm/XP+8Wra@public.gmane.org>

On Tue, 30 Jun, at 03:57:51PM, Luck, Tony wrote:
> The memory error record structure includes as its first field a
> bitmask of which subsequent fields are valid. The allows new fields
> to be added to the structure while keeping compatibility with older
> software that parses these records. This mechanism was used between
> versions 2.2 and 2.3 to add four new fields, growing the size of the
> structure from 73 bytes to 80. But Linux just added all the new
> fields so this test:
> 	if (gdata->error_data_length >= sizeof(*mem_err))
> 		cper_print_mem(newpfx, mem_err);
> 	else
> 		goto err_section_too_small;
> now make Linux complain about old format records being too short.
> 
> Add a definition for the old format of the structure and use that
> for the minimum size check. Pass the actual size to cper_print_mem()
> so it can sanity check the validation_bits field to ensure that if
> a BIOS using the old format sets bits as if it were new, we won't
> access fields beyond the end of the structure.
> 
> Signed-off-by: Tony Luck <tony.luck-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
> ---
> v1-v2: print FW_WARN if we see bogus validation bits from an old sized structure
> 
>  drivers/firmware/efi/cper.c | 15 ++++++++++++---
>  include/linux/cper.h        | 22 +++++++++++++++++++++-
>  2 files changed, 33 insertions(+), 4 deletions(-)

Looks good to me Tony. Since this is essentially a bug fix, does it need
applying to stable?

-- 
Matt Fleming, Intel Open Source Technology Center

  parent reply	other threads:[~2015-07-08 15:54 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-23 17:05 compatability with older versions of UEFI Luck, Tony
     [not found] ` <20150623170534.GA21341-E6Nu+q68HHTI/KE9syI0vLvm/XP+8Wra@public.gmane.org>
2015-06-24 18:04   ` Zhang, Jonathan Zhixiong
     [not found]     ` <558AF115.8020909-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2015-06-24 19:14       ` Luck, Tony
     [not found]         ` <3908561D78D1C84285E8C5FCA982C28F32A9FB7C-8oqHQFITsIE64kNsxIetb7fspsVTdybXVpNB7YpNyf8@public.gmane.org>
2015-06-24 19:50           ` Zhang, Jonathan Zhixiong
     [not found]             ` <558B09F8.4060706-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2015-06-24 20:12               ` Luck, Tony
     [not found]                 ` <3908561D78D1C84285E8C5FCA982C28F32A9FBFF-8oqHQFITsIE64kNsxIetb7fspsVTdybXVpNB7YpNyf8@public.gmane.org>
2015-06-24 23:50                   ` Zhang, Jonathan Zhixiong
2015-06-28 14:34           ` Matt Fleming
2015-06-28 14:29       ` Matt Fleming
     [not found]         ` <20150628142909.GA28334-mF/unelCI9GS6iBeEJttW/XRex20P6io@public.gmane.org>
2015-06-29 18:21           ` [PATCH] efi: Handle memory error structures produced based on old versions of standard Luck, Tony
     [not found]             ` <20150629182106.GA25924-E6Nu+q68HHTI/KE9syI0vLvm/XP+8Wra@public.gmane.org>
2015-06-30 12:22               ` Matt Fleming
     [not found]                 ` <20150630122244.GJ28334-mF/unelCI9GS6iBeEJttW/XRex20P6io@public.gmane.org>
2015-06-30 22:57                   ` [PATCHv2] " Luck, Tony
     [not found]                     ` <20150630225751.GA18060-E6Nu+q68HHTI/KE9syI0vLvm/XP+8Wra@public.gmane.org>
2015-07-08 15:54                       ` Matt Fleming [this message]
     [not found]                         ` <20150708155440.GA5598-mF/unelCI9GS6iBeEJttW/XRex20P6io@public.gmane.org>
2015-07-08 17:35                           ` Luck, Tony

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=20150708155440.GA5598@codeblueprint.co.uk \
    --to=matt-mf/unelci9gs6ibeejttw/xrex20p6io@public.gmane.org \
    --cc=harba-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org \
    --cc=linaro-acpi-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
    --cc=linux-efi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=matt.fleming-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
    --cc=tony.luck-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
    --cc=zjzhang-sgV2jX0FEOL9JmXXK+q4OQ@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.