stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Patch "hwrng: core - Clean up RNG list when last hwrng is unregistered" has been added to the 4.15-stable tree
@ 2018-03-22 13:06 gregkh
  0 siblings, 0 replies; only message in thread
From: gregkh @ 2018-03-22 13:06 UTC (permalink / raw)
  To: gary.hook, alexander.levin, gregkh, herbert, prasannatsmkumar
  Cc: stable, stable-commits


This is a note to let you know that I've just added the patch titled

    hwrng: core - Clean up RNG list when last hwrng is unregistered

to the 4.15-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     hwrng-core-clean-up-rng-list-when-last-hwrng-is-unregistered.patch
and it can be found in the queue-4.15 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@vger.kernel.org> know about it.


>From foo@baz Thu Mar 22 14:03:40 CET 2018
From: Gary R Hook <gary.hook@amd.com>
Date: Fri, 15 Dec 2017 13:55:59 -0600
Subject: hwrng: core - Clean up RNG list when last hwrng is unregistered

From: Gary R Hook <gary.hook@amd.com>


[ Upstream commit 0e4b52942b1c76f89e0dcb829f72e123d0678f54 ]

Commit 142a27f0a731 added support for a "best" RNG, and in doing so
introduced a hang from rmmod/modprobe -r when the last RNG on the list
was unloaded.

When the hwrng list is depleted, return the global variables to their
original state and decrement all references to the object.

Fixes: 142a27f0a731 ("hwrng: core - Reset user selected rng by writing "" to rng_current")
Signed-off-by: Gary R Hook <gary.hook@amd.com>
Reviewed-by: PrasannaKumar Muralidharan <prasannatsmkumar@gmail.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 drivers/char/hw_random/core.c |    4 ++++
 1 file changed, 4 insertions(+)

--- a/drivers/char/hw_random/core.c
+++ b/drivers/char/hw_random/core.c
@@ -306,6 +306,10 @@ static int enable_best_rng(void)
 		ret = ((new_rng == current_rng) ? 0 : set_current_rng(new_rng));
 		if (!ret)
 			cur_rng_set_by_user = 0;
+	} else {
+		drop_current_rng();
+		cur_rng_set_by_user = 0;
+		ret = 0;
 	}
 
 	return ret;


Patches currently in stable-queue which might be from gary.hook@amd.com are

queue-4.15/hwrng-core-clean-up-rng-list-when-last-hwrng-is-unregistered.patch

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2018-03-22 13:07 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-03-22 13:06 Patch "hwrng: core - Clean up RNG list when last hwrng is unregistered" has been added to the 4.15-stable tree gregkh

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 NNTP newsgroup(s).