lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240905230219.GB1512@sol.localdomain>
Date: Thu, 5 Sep 2024 16:02:19 -0700
From: Eric Biggers <ebiggers@...nel.org>
To: Uros Bizjak <ubizjak@...il.com>
Cc: linux-kernel@...r.kernel.org, "Theodore Y. Ts'o" <tytso@....edu>,
	Jaegeuk Kim <jaegeuk@...nel.org>, linux-fscrypt@...r.kernel.org
Subject: Re: [PATCH 06/18] fscrypt: Include <linux/prandom.h> instead of
 <linux/random.h>

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@...il.com>
> Cc: Eric Biggers <ebiggers@...nel.org>
> Cc: "Theodore Y. Ts'o" <tytso@....edu>
> Cc: Jaegeuk Kim <jaegeuk@...nel.org>
> Cc. linux-fscrypt@...r.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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ