From: Daniel Kiper <dkiper@net-space.pl>
To: Ard Biesheuvel <ardb@kernel.org>
Cc: Glenn Washburn <development@efficientek.com>,
grub-devel@gnu.org,
Vladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Subject: Re: [PATCH v5] efi: Fix stack protector issues
Date: Wed, 8 May 2024 18:07:30 +0200 [thread overview]
Message-ID: <20240508160730.3b7ycmx2my53g3j7@tomti.i.net-space.pl> (raw)
In-Reply-To: <CAMj1kXHpr4FPFEU1rAHgkut4FUBYpPqpGab2-XAiqHEHdaqocQ@mail.gmail.com>
On Mon, Apr 29, 2024 at 03:03:50PM +0200, Ard Biesheuvel wrote:
> On Sat, 27 Apr 2024 at 15:08, Glenn Washburn
> <development@efficientek.com> wrote:
> >
> > From: Ard Biesheuvel <ardb@kernel.org>
> >
> > The 'ground truth' stack protector cookie value is kept in a global
> > variable, and loaded in every function prologue and epilogue to store
> > it into resp. compare it with the stack slot holding the cookie.
> >
> > If the comparison fails, the program aborts, and this might occur
> > spuriously when the global variable changes values between the entry and
> > exit of a function. This implies that assigning the global variable at
> > boot should not involve any instrumented function calls, unless special
> > care is taken to ensure that the live call stack is synchronized, which
> > is non-trivial.
> >
> > So avoid any function calls, including grub_memcpy(), which is
> > unnecessary given that the stack cookie is always a suitably aligned
> > variable of the native word size.
> >
> > While at it, leave the last byte 0x0 to avoid inadvertent unbounded
> > strings on the stack.
> >
> > Note that the use of __attribute__((optimize)) is described as
> > unsuitable for production use in the GCC documentation, so let's drop
> > this as well now that it is no longer needed.
> >
> > Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
> > Reviewed-by: Glenn Washburn <development@efficientek.com>
I think this RB does not make a lot of sens if we have your SOB below.
I will drop the RB.
> > Signed-off-by: Glenn Washburn <development@efficientek.com>
>
> Thanks for taking care of this.
Yeah, thanks a lot Glenn!
> I'd ack it but that would make the signoff chain look even weirder :-)
:-)
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
Daniel
_______________________________________________
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel
prev parent reply other threads:[~2024-05-08 16:08 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-27 13:07 [PATCH v5] efi: Fix stack protector issues Glenn Washburn
2024-04-29 13:03 ` Ard Biesheuvel
2024-05-08 16:07 ` Daniel Kiper [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=20240508160730.3b7ycmx2my53g3j7@tomti.i.net-space.pl \
--to=dkiper@net-space.pl \
--cc=ardb@kernel.org \
--cc=development@efficientek.com \
--cc=grub-devel@gnu.org \
--cc=phcoder@gmail.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 read-only IMAP folder(s) and NNTP newsgroup(s).