All of lore.kernel.org
 help / color / mirror / Atom feed
From: Matt Fleming <matt-mF/unelCI9GS6iBeEJttW/XRex20P6io@public.gmane.org>
To: Ard Biesheuvel <ard.biesheuvel-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
Cc: Qiuxu Zhuo <qiuxu.zhuo-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>,
	"linux-efi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
	<linux-efi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	Tony Luck <tony.luck-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
Subject: Re: [PATCH v2 1/2] efi/capsule: Add 'capsule' lookup support
Date: Thu, 2 Mar 2017 16:44:02 +0000	[thread overview]
Message-ID: <20170302164402.GB9522@codeblueprint.co.uk> (raw)
In-Reply-To: <CAKv+Gu8=_D_ghJkxeLtnVN2fNV8ybS_2+cjs3ih_TmGtTJM4+Q-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>

On Thu, 02 Mar, at 03:38:51PM, Ard Biesheuvel wrote:
> 
> > +       if (!capsule)
> > +               return -ENOMEM;
> > +
> > +       capsule += sizeof(uint32_t);
> 
> This is incorrect for 64-bit. You need to increment by the size of
> unsigned long here, regardless of the size of efi_capsule_num.

I'm almost positive this is correct, but I can't find the bit in the
spec that says why. We're not trying to step over a pointer here, if
memory serves, it's a capsule count or something and uint32_t is the
right type.

Lemme go dig in the spec.

  parent reply	other threads:[~2017-03-02 16:44 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-01 17:59 [PATCH v2 0/2] capsule pstore backend Qiuxu Zhuo
     [not found] ` <20170301175943.87444-1-qiuxu.zhuo-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2017-03-01 17:59   ` [PATCH v2 1/2] efi/capsule: Add 'capsule' lookup support Qiuxu Zhuo
     [not found]     ` <20170301175943.87444-2-qiuxu.zhuo-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2017-03-02 15:38       ` Ard Biesheuvel
     [not found]         ` <CAKv+Gu8=_D_ghJkxeLtnVN2fNV8ybS_2+cjs3ih_TmGtTJM4+Q-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-03-02 16:44           ` Matt Fleming [this message]
     [not found]             ` <20170302164402.GB9522-mF/unelCI9GS6iBeEJttW/XRex20P6io@public.gmane.org>
2017-03-02 16:45               ` Ard Biesheuvel
     [not found]                 ` <CAKv+Gu8aKUMrZa0mwjVugmzAZvkSJC5xe4xerMvrsa5x+xH5xA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-03-02 16:46                   ` Ard Biesheuvel
     [not found]                     ` <CAKv+Gu__kQsbb9dZM9h2FFms9Od4VEgXGeRUycqwzM54WG7=yg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-03-04  0:54                       ` Zhuo, Qiuxu
2017-03-01 17:59   ` [PATCH v2 2/2] efi: capsule pstore backend Qiuxu Zhuo
     [not found]     ` <20170301175943.87444-3-qiuxu.zhuo-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2017-03-02 15:43       ` Ard Biesheuvel
     [not found]         ` <CAKv+Gu_25t7Bs-sfxdNi=axo4mjtWo2CF5302AtNRCc0_3RnWg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-03-02 21:31           ` Kees Cook
2017-03-03 15:19   ` [PATCH v2 0/2] " Ard Biesheuvel
     [not found]     ` <CAKv+Gu-PjFD8eAAOau6wPXH+pQ8JfKh-huFqiB+Go+5YTth3tQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-03-03 17:23       ` Luck, Tony
     [not found]         ` <20170303172319.GA27957-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2017-03-03 17:28           ` Ard Biesheuvel
2017-03-04  0:31       ` Zhuo, Qiuxu

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=20170302164402.GB9522@codeblueprint.co.uk \
    --to=matt-mf/unelci9gs6ibeejttw/xrex20p6io@public.gmane.org \
    --cc=ard.biesheuvel-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
    --cc=linux-efi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=qiuxu.zhuo-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
    --cc=tony.luck-ral2JQCrhuEAvxtiuMwx3w@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.