All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ard Biesheuvel <ardb@kernel.org>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: "Jason A. Donenfeld" <Jason@zx2c4.com>,
	regressions@leemhuis.info,  Andrew Lunn <andrew@lunn.ch>,
	Linux Stable <stable@vger.kernel.org>,
	 Linux Regressions <regressions@lists.linux.dev>,
	Bagas Sanjaya <bagasdotme@gmail.com>,
	 Sami Korkalainen <sami.korkalainen@proton.me>
Subject: Re: [REGRESSION][BISECTED] Boot stall from merge tag 'net-next-6.2'
Date: Sat, 24 Jun 2023 00:55:03 +0200	[thread overview]
Message-ID: <CAMj1kXF7aO1FPXeBFeLBe1-7j5hUjiTAXu-xV6oKFN8dRY3qDQ@mail.gmail.com> (raw)
In-Reply-To: <CAHk-=wjKtHwJBeUiJL_1HFJKWja120w-6qaLx1FS5p9QE0PfSw@mail.gmail.com>

On Fri, 23 Jun 2023 at 23:52, Linus Torvalds
<torvalds@linux-foundation.org> wrote:
>
> On Fri, 23 Jun 2023 at 13:31, Jason A. Donenfeld <Jason@zx2c4.com> wrote:
> >
> > We always have to write when using so that we don't credit the same
> > seed twice, so it's gotta be used at a stage when SetVariable is
> > somewhat working.
>
> This code isn't even the code that "uses" the alleged entropy from
> that EFI variable in the first place. That's the code in
> efi_random_get_seed() in the EFI boot sequence, and appends it to the
> bootup randomness buffers.
>
> And that code already seems to clear the EFI variable (or seems to
> append to it).
>

It reads the variable twice (once to obtain the size and once to grab
the data), and replaces it with a zero-length string, which causes the
variable to disappear. (This is typically NOR flash with spare blocks
managed by a fault tolerant write layer in software, and so really
wiping the seed or overwriting it is not generally possible)

Using SetVariable() from boot services to delete a variable is highly
unlikely to regress older systems in a similar way.

> So this argument seems to be complete garbage - we absolutely do not
> have to write it, and your patch already just wrote it in the wrong
> place anyway.
>
> Don't make excuses. That code caused boot failures, it was all done in
> the wrong place, and at entirely the wrong time.
>

With the revert applied, the kernel/EFI stub only consumes the
variable and deletes it, but never creates it by itself, and so the
code does nothing if the variable is never created in the first place.

If we leave it up to user space to create it, we won´t need any policy
or quirks handling in the kernel at all, which I´d prefer. The only
thing we should do is special case the variable's scope GUID in
efivarfs so the file is not created world-readable like we do for
other variables. (This predates my involvement but I think this was an
oversight). Using efivarfs will also ensure that the 'storage
paranoia' logic is used on x86. (This is something I failed to take
into account when I reviewed Jason's patch)

  reply	other threads:[~2023-06-23 22:55 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-26 19:17 [REGRESSION][BISECTED] Boot stall from merge tag 'net-next-6.2' Sami Korkalainen
2023-05-27  1:17 ` Bagas Sanjaya
2023-05-27  4:07   ` Sami Korkalainen
2023-06-12 14:07     ` Bagas Sanjaya
2023-06-12 19:05       ` Sami Korkalainen
2023-06-12 19:50         ` Andrew Lunn
2023-06-21  6:07           ` Sami Korkalainen
2023-06-21  8:46             ` Linux regression tracking (Thorsten Leemhuis)
2023-06-21 17:56               ` Linus Torvalds
2023-06-21 18:08                 ` Linus Torvalds
2023-06-22 18:34                   ` Thorsten Leemhuis
2023-06-21 17:57               ` Jason A. Donenfeld
2023-06-23 13:55                 ` Ard Biesheuvel
2023-06-23 17:29                   ` Linus Torvalds
2023-06-23 20:30                     ` Jason A. Donenfeld
2023-06-23 21:52                       ` Linus Torvalds
2023-06-23 22:55                         ` Ard Biesheuvel [this message]
2023-06-23 23:02                           ` Linus Torvalds
2023-06-25 15:36                             ` David Laight
2023-06-25 14:40                         ` Jason A. Donenfeld
2023-06-23 18:20                   ` Sami Korkalainen
2023-06-23 18:38                     ` Ard Biesheuvel
2023-06-23 19:01                       ` Linus Torvalds
2023-06-21 18:49               ` Jason A. Donenfeld
2023-06-21 19:51                 ` Linus Torvalds
2023-06-22 13:40                   ` Jason A. Donenfeld
2023-06-22 19:25                     ` Sami Korkalainen

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=CAMj1kXF7aO1FPXeBFeLBe1-7j5hUjiTAXu-xV6oKFN8dRY3qDQ@mail.gmail.com \
    --to=ardb@kernel.org \
    --cc=Jason@zx2c4.com \
    --cc=andrew@lunn.ch \
    --cc=bagasdotme@gmail.com \
    --cc=regressions@leemhuis.info \
    --cc=regressions@lists.linux.dev \
    --cc=sami.korkalainen@proton.me \
    --cc=stable@vger.kernel.org \
    --cc=torvalds@linux-foundation.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.