From: Eric Biggers <ebiggers@kernel.org>
To: Uros Bizjak <ubizjak@gmail.com>
Cc: linux-kernel@vger.kernel.org, "Theodore Y. Ts'o" <tytso@mit.edu>,
Jaegeuk Kim <jaegeuk@kernel.org>,
linux-fscrypt@vger.kernel.org
Subject: Re: [PATCH 06/18] fscrypt: Include <linux/prandom.h> instead of <linux/random.h>
Date: Thu, 5 Sep 2024 16:02:19 -0700 [thread overview]
Message-ID: <20240905230219.GB1512@sol.localdomain> (raw)
In-Reply-To: <20240905122020.872466-7-ubizjak@gmail.com>
On Thu, Sep 05, 2024 at 02:17:14PM +0200, Uros Bizjak wrote:
> Usage of pseudo-random functions requires inclusion of
> <linux/prandom.h> header instead of <linux/random.h>.
>
> Signed-off-by: Uros Bizjak <ubizjak@gmail.com>
> Cc: Eric Biggers <ebiggers@kernel.org>
> Cc: "Theodore Y. Ts'o" <tytso@mit.edu>
> Cc: Jaegeuk Kim <jaegeuk@kernel.org>
> Cc. linux-fscrypt@vger.kernel.org
> ---
> fs/crypto/keyring.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/fs/crypto/keyring.c b/fs/crypto/keyring.c
> index 6681a71625f0..e2c10b3b960b 100644
> --- a/fs/crypto/keyring.c
> +++ b/fs/crypto/keyring.c
> @@ -21,7 +21,7 @@
> #include <asm/unaligned.h>
> #include <crypto/skcipher.h>
> #include <linux/key-type.h>
> -#include <linux/random.h>
> +#include <linux/prandom.h>
> #include <linux/seq_file.h>
>
1. linux-fscrypt wasn't actually Cc'ed on this patch, due to the typo of
"Cc." instead of "Cc:".
2. Currently <linux/random.h> includes <linux/prandom.h>, so the issue described
in the commit message does not exist. I assume this in changing in a later
patch that was not sent to me. The commit message should be rephrased to
clarify that this change is needed because of header refactoring, as
otherwise it sounds like a bug fix.
3. The proposed change does not make sense, because fs/crypto/keyring.c does not
use any "pseudo-random functions". It does use get_random_once(), which is
defined in <linux/once.h>. Currently <linux/random.h> includes
<linux/prandom.h> which includes <linux/once.h>. If the inclusion of
prandom.h by random.h is going away, then perhaps random.h should include
once.h directly so that get_random_once() continues to work? If not, then
this file should include once.h. Either way it should not include prandom.h.
- Eric
next prev parent reply other threads:[~2024-09-05 23:02 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-05 12:17 [PATCH 00/18] random: Include <linux/percpu.h> and resolve circular include dependency Uros Bizjak
2024-09-05 12:17 ` [PATCH 01/18] x86/kaslr: Include <linux/prandom.h> instead of <linux/random.h> Uros Bizjak
2024-09-05 12:17 ` [PATCH 02/18] drm/i915/selftests: " Uros Bizjak
2024-09-05 13:06 ` Jani Nikula
2024-09-05 12:17 ` [PATCH 03/18] drm/lib: " Uros Bizjak
2024-09-05 12:17 ` [PATCH 04/18] media: vivid: Include <linux/prandom.h> in vivid-vid-cap.c Uros Bizjak
2024-09-05 12:17 ` [PATCH 05/18] mtd: tests: Include <linux/prandom.h> instead of <linux/random.h> Uros Bizjak
2024-09-06 15:10 ` Miquel Raynal
2024-09-06 15:58 ` Uros Bizjak
2024-09-09 9:49 ` Miquel Raynal
2024-09-05 12:17 ` [PATCH 06/18] fscrypt: " Uros Bizjak
2024-09-05 23:02 ` Eric Biggers [this message]
2024-09-06 8:09 ` Uros Bizjak
2024-09-05 12:17 ` [PATCH 07/18] scsi: libfcoe: " Uros Bizjak
2024-09-05 12:17 ` [PATCH 08/18] bpf: " Uros Bizjak
2024-09-05 12:17 ` [PATCH 09/18] lib/interval_tree_test.c: " Uros Bizjak
2024-09-05 12:17 ` [PATCH 10/18] kunit: string-stream-test: " Uros Bizjak
2024-09-05 12:17 ` [PATCH 11/18] random32: " Uros Bizjak
2024-09-05 12:17 ` [PATCH 12/18] lib/rbtree-test: " Uros Bizjak
2024-09-05 12:17 ` [PATCH 13/18] bpf/tests: " Uros Bizjak
2024-09-05 12:17 ` [PATCH 14/18] lib/test_parman: " Uros Bizjak
2024-09-05 12:17 ` [PATCH 15/18] lib/test_scanf: " Uros Bizjak
2024-09-09 12:54 ` Petr Mladek
2024-09-05 12:17 ` [PATCH 16/18] netem: Include <linux/prandom.h> in sch_netem.c Uros Bizjak
2024-09-05 12:17 ` [PATCH 17/18] random: Do not include <linux/prandom.h> Uros Bizjak
2024-09-06 13:30 ` kernel test robot
2024-09-06 14:21 ` kernel test robot
2024-09-06 15:46 ` Uros Bizjak
2024-09-05 12:17 ` [PATCH 18/18] prandom: Include <linux/percpu.h> Uros Bizjak
2024-09-05 12:40 ` [PATCH 00/18] random: Include <linux/percpu.h> and resolve circular include dependency Andy Shevchenko
2024-09-05 13:03 ` Uros Bizjak
2024-09-05 15:36 ` Andy Shevchenko
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=20240905230219.GB1512@sol.localdomain \
--to=ebiggers@kernel.org \
--cc=jaegeuk@kernel.org \
--cc=linux-fscrypt@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=tytso@mit.edu \
--cc=ubizjak@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
all inboxes | Powered by JetHome®