From: Andy Shevchenko <andriy.shevchenko@intel.com>
To: Thorsten Blum <blum@kernel.org>
Cc: Olivia Mackall <olivia@selenic.com>,
Herbert Xu <herbert@gondor.apana.org.au>,
Manos Pitsidianakis <manos@pitsidianak.is>,
David Laight <david.laight.linux@gmail.com>,
Jonathan McDowell <noodles@meta.com>,
Lianjie Wang <karin0.zst@gmail.com>,
"Thomas Richard (TI)" <thomas.richard@bootlin.com>,
PrasannaKumar Muralidharan <prasannatsmkumar@gmail.com>,
linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] hwrng: core - reject unknown RNG names
Date: Fri, 25 Sep 2026 13:06:09 +0300 [thread overview]
Message-ID: <arZHkd8efyV0IFYQ@ashevche-desk.local> (raw)
In-Reply-To: <arZGQxGEP-i9fLiJ@ashevche-desk.local>
On Fri, Sep 25, 2026 at 01:00:39PM +0300, Andy Shevchenko wrote:
> On Thu, Sep 24, 2026 at 11:21:13PM +0200, Thorsten Blum wrote:
> > In rng_current_store(), err is 0 after successfully locking rng_mutex,
> > and if the requested RNG name cannot be found, the function reports
> > success even though the current RNG was not changed.
> >
> > Set err = -ENODEV before searching the RNG list to reject unknown names.
>
> Yeah, from the
>
> > Fixes: 142a27f0a731 ("hwrng: core - Reset user selected rng by writing "" to rng_current")
>
> it looks like it was the intention, but the mutex_lock_interruptible() rewrites
> an error code. That's a good example on why I often tell people to decouple
> assignment from the definition and the very same issue might happen and would be
> hard to debug later on. Surprisingly this happened in the same patch...
>
> Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Also
Fixes: cb028f1662a9 ("hwrng: core - remove redundant initialization of variable err")
as that one removed the indeed redundant assignment, but forget to fix the issue.
--
With Best Regards,
Andy Shevchenko
prev parent reply other threads:[~2026-09-25 10:06 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-24 21:21 Thorsten Blum
2026-09-25 10:00 ` Andy Shevchenko
2026-09-25 10:06 ` Andy Shevchenko [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=arZHkd8efyV0IFYQ@ashevche-desk.local \
--to=andriy.shevchenko@intel.com \
--cc=blum@kernel.org \
--cc=david.laight.linux@gmail.com \
--cc=herbert@gondor.apana.org.au \
--cc=karin0.zst@gmail.com \
--cc=linux-crypto@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=manos@pitsidianak.is \
--cc=noodles@meta.com \
--cc=olivia@selenic.com \
--cc=prasannatsmkumar@gmail.com \
--cc=thomas.richard@bootlin.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
all inboxes | Powered by JetHome®