* [PATCH stable 5.18 5.17 5.15 5.10 0/3] rng stable patches from 5.19-rc2
@ 2022-06-13 8:05 Jason A. Donenfeld
2022-06-13 8:05 ` [PATCH stable 5.18 5.17 5.15 5.10 1/3] random: avoid checking crng_ready() twice in random_init() Jason A. Donenfeld
0 siblings, 1 reply; 4+ messages in thread
From: Jason A. Donenfeld @ 2022-06-13 8:05 UTC (permalink / raw)
To: stable, gregkh
Hi Greg,
These three patches from 5.19-rc2 failed to automatically apply. The
following series should work okay.
Note that these are already part of the 4.9, 4.14, 4.19, 5.4 backport I
did for later this week.
Jason
Jason A. Donenfeld (3):
random: avoid checking crng_ready() twice in random_init()
random: mark bootloader randomness code as __init
random: account for arch randomness in bits
drivers/char/random.c | 15 +++++++--------
include/linux/random.h | 2 +-
2 files changed, 8 insertions(+), 9 deletions(-)
--
2.35.1
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH stable 5.18 5.17 5.15 5.10 1/3] random: avoid checking crng_ready() twice in random_init()
2022-06-13 8:05 [PATCH stable 5.18 5.17 5.15 5.10 0/3] rng stable patches from 5.19-rc2 Jason A. Donenfeld
@ 2022-06-13 8:05 ` Jason A. Donenfeld
0 siblings, 0 replies; 4+ messages in thread
From: Jason A. Donenfeld @ 2022-06-13 8:05 UTC (permalink / raw)
To: stable, gregkh
commit 9b29b6b20376ab64e1b043df6301d8a92378e631 upstream.
The current flow expands to:
if (crng_ready())
...
else if (...)
if (!crng_ready())
...
The second crng_ready() call is redundant, but can't so easily be
optimized out by the compiler.
This commit simplifies that to:
if (crng_ready()
...
else if (...)
...
Fixes: 560181c27b58 ("random: move initialization functions out of hot pages")
Cc: stable@vger.kernel.org
Cc: Dominik Brodowski <linux@dominikbrodowski.net>
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
---
drivers/char/random.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/char/random.c b/drivers/char/random.c
index 420d78eee6c5..9972259809db 100644
--- a/drivers/char/random.c
+++ b/drivers/char/random.c
@@ -834,7 +834,7 @@ int __init random_init(const char *command_line)
if (crng_ready())
crng_reseed();
else if (trust_cpu)
- credit_init_bits(arch_bytes * 8);
+ _credit_init_bits(arch_bytes * 8);
return 0;
}
--
2.35.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH stable 5.18 5.17 5.15 5.10 0/3] rng stable patches from 5.19-rc2
@ 2022-06-13 8:07 Jason A. Donenfeld
2022-06-13 9:02 ` Greg KH
0 siblings, 1 reply; 4+ messages in thread
From: Jason A. Donenfeld @ 2022-06-13 8:07 UTC (permalink / raw)
To: stable, gregkh
Hi Greg,
These three patches from 5.19-rc2 failed to automatically apply. The
following series should work okay.
Note that these are already part of the 4.9, 4.14, 4.19, 5.4 backport I
did for later this week.
Jason
Jason A. Donenfeld (3):
random: avoid checking crng_ready() twice in random_init()
random: mark bootloader randomness code as __init
random: account for arch randomness in bits
drivers/char/random.c | 15 +++++++--------
include/linux/random.h | 2 +-
2 files changed, 8 insertions(+), 9 deletions(-)
--
2.35.1
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH stable 5.18 5.17 5.15 5.10 0/3] rng stable patches from 5.19-rc2
2022-06-13 8:07 [PATCH stable 5.18 5.17 5.15 5.10 0/3] rng stable patches from 5.19-rc2 Jason A. Donenfeld
@ 2022-06-13 9:02 ` Greg KH
0 siblings, 0 replies; 4+ messages in thread
From: Greg KH @ 2022-06-13 9:02 UTC (permalink / raw)
To: Jason A. Donenfeld; +Cc: stable
On Mon, Jun 13, 2022 at 10:07:46AM +0200, Jason A. Donenfeld wrote:
> Hi Greg,
>
> These three patches from 5.19-rc2 failed to automatically apply. The
> following series should work okay.
All now queued up, thanks.
> Note that these are already part of the 4.9, 4.14, 4.19, 5.4 backport I
> did for later this week.
Great, thanks for adding them there too.
greg k-h
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2022-06-13 9:02 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-13 8:05 [PATCH stable 5.18 5.17 5.15 5.10 0/3] rng stable patches from 5.19-rc2 Jason A. Donenfeld
2022-06-13 8:05 ` [PATCH stable 5.18 5.17 5.15 5.10 1/3] random: avoid checking crng_ready() twice in random_init() Jason A. Donenfeld
2022-06-13 8:07 [PATCH stable 5.18 5.17 5.15 5.10 0/3] rng stable patches from 5.19-rc2 Jason A. Donenfeld
2022-06-13 9:02 ` Greg KH
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.