All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: [PATCH v41 09/13] crypto: provide access to a static Jitter RNG state
@ 2021-07-20  6:13 kernel test robot
  0 siblings, 0 replies; 2+ messages in thread
From: kernel test robot @ 2021-07-20  6:13 UTC (permalink / raw)
  To: kbuild

[-- Attachment #1: Type: text/plain, Size: 3440 bytes --]

CC: kbuild-all(a)lists.01.org
In-Reply-To: <2275613.P25KImRyBb@positron.chronox.de>
References: <2275613.P25KImRyBb@positron.chronox.de>
TO: "Stephan Müller" <smueller@chronox.de>
TO: Tso Ted <tytso@mit.edu>
TO: linux-crypto(a)vger.kernel.org
CC: Willy Tarreau <w@1wt.eu>
CC: Nicolai Stange <nstange@suse.de>
CC: LKML <linux-kernel@vger.kernel.org>
CC: Arnd Bergmann <arnd@arndb.de>
CC: "Greg Kroah-Hartman" <gregkh@linuxfoundation.org>
CC: "Eric W. Biederman" <ebiederm@xmission.com>
CC: "Alexander E. Patrakov" <patrakov@gmail.com>
CC: "Ahmed S. Darwish" <darwish.07@gmail.com>

Hi "Stephan,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on char-misc/char-misc-testing]
[also build test WARNING on cryptodev/master crypto/master v5.14-rc2 next-20210719]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Stephan-M-ller/dev-random-a-new-approach/20210714-135308
base:   https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc.git 77d34a4683b053108ecd466cc7c4193b45805528
:::::: branch date: 6 days ago
:::::: commit date: 6 days ago
config: x86_64-randconfig-b001-20210714 (attached as .config)
compiler: clang version 13.0.0 (https://github.com/llvm/llvm-project 8d69635ed9ecf36fd0ca85906bfde17949671cbe)
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # install x86_64 cross compiling tool for clang build
        # apt-get install binutils-x86-64-linux-gnu
        # apt-get install iwyu # include-what-you-use
        # https://github.com/0day-ci/linux/commit/e6bc121044c3d2aa4e90f0c8564c7379a67e6055
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Stephan-M-ller/dev-random-a-new-approach/20210714-135308
        git checkout e6bc121044c3d2aa4e90f0c8564c7379a67e6055
        # save the attached .config to linux build tree
        mkdir build_dir
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross C=1 CHECK=iwyu O=build_dir ARCH=x86_64 SHELL=/bin/bash

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>


iwyu warnings: (new ones prefixed by >>)
>> crypto/jitterentropy.c:#include "crypto/internal/jitterentropy.h":1: iwyu: warning: superfluous #include "crypto/internal/jitterentropy.h"
--
>> crypto/jitterentropy-kcapi.c:#include "crypto/internal/jitterentropy.h":1: iwyu: warning: superfluous #include "crypto/internal/jitterentropy.h"
   crypto/jitterentropy-kcapi.c:#include "crypto/internal/rng.h":1: iwyu: warning: superfluous #include "crypto/internal/rng.h"
>> crypto/jitterentropy-kcapi.c:46:1: iwyu: warning: superfluous #include <crypto/internal/jitterentropy.h>
   crypto/jitterentropy-kcapi.c:45:1: iwyu: warning: superfluous #include <crypto/internal/rng.h>
   crypto/jitterentropy-kcapi.c:40:1: iwyu: warning: superfluous #include <linux/kernel.h>
   crypto/jitterentropy-kcapi.c:44:1: iwyu: warning: superfluous #include <linux/time.h>

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 48785 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [PATCH v41 09/13] crypto: provide access to a static Jitter RNG state
  2021-07-14  5:43 [PATCH v41 00/13] /dev/random - a new approach Stephan Müller
@ 2021-07-14  5:47 ` Stephan Müller
  0 siblings, 0 replies; 2+ messages in thread
From: Stephan Müller @ 2021-07-14  5:47 UTC (permalink / raw)
  To: Tso Ted, linux-crypto
  Cc: Willy Tarreau, Nicolai Stange, LKML, Arnd Bergmann,
	Greg Kroah-Hartman, Eric W. Biederman, Alexander E. Patrakov,
	Ahmed S. Darwish, Matthew Garrett, Vito Caputo, Andreas Dilger,
	Jan Kara, Ray Strode, William Jon McCann, zhangjs,
	Andy Lutomirski, Florian Weimer, Lennart Poettering,
	Peter Matthias, Marcelo Henrique Cerri, Neil Horman,
	Randy Dunlap, Julia Lawall, Dan Carpenter, Andy Lavr,
	Eric Biggers, Jason A. Donenfeld, Petr Tesarik, John Haxby,
	Alexander Lobakin

To support the LRNG operation which uses the Jitter RNG separately
from the kernel crypto API, at a time where potentially the regular
memory management is not yet initialized, the Jitter RNG needs to
provide a state whose memory is defined at compile time. As only once
instance will ever be needed by the LRNG, define once static memory
block which is solely to be used by the LRNG.

CC: Torsten Duwe <duwe@lst.de>
CC: "Eric W. Biederman" <ebiederm@xmission.com>
CC: "Alexander E. Patrakov" <patrakov@gmail.com>
CC: "Ahmed S. Darwish" <darwish.07@gmail.com>
CC: "Theodore Y. Ts'o" <tytso@mit.edu>
CC: Willy Tarreau <w@1wt.eu>
CC: Matthew Garrett <mjg59@srcf.ucam.org>
CC: Vito Caputo <vcaputo@pengaru.com>
CC: Andreas Dilger <adilger.kernel@dilger.ca>
CC: Jan Kara <jack@suse.cz>
CC: Ray Strode <rstrode@redhat.com>
CC: William Jon McCann <mccann@jhu.edu>
CC: zhangjs <zachary@baishancloud.com>
CC: Andy Lutomirski <luto@kernel.org>
CC: Florian Weimer <fweimer@redhat.com>
CC: Lennart Poettering <mzxreary@0pointer.de>
CC: Nicolai Stange <nstange@suse.de>
CC: Alexander Lobakin <alobakin@mailbox.org>
Reviewed-by: Roman Drahtmueller <draht@schaltsekun.de>
Tested-by: Roman Drahtmüller <draht@schaltsekun.de>
Tested-by: Marcelo Henrique Cerri <marcelo.cerri@canonical.com>
Tested-by: Neil Horman <nhorman@redhat.com>
Signed-off-by: Stephan Mueller <smueller@chronox.de>
---
 crypto/jitterentropy-kcapi.c                  |  3 +-
 crypto/jitterentropy.c                        | 31 ++++++++++++++++++-
 .../crypto/internal}/jitterentropy.h          |  3 ++
 3 files changed, 34 insertions(+), 3 deletions(-)
 rename {crypto => include/crypto/internal}/jitterentropy.h (84%)

diff --git a/crypto/jitterentropy-kcapi.c b/crypto/jitterentropy-kcapi.c
index e8a4165a1874..c90e60910827 100644
--- a/crypto/jitterentropy-kcapi.c
+++ b/crypto/jitterentropy-kcapi.c
@@ -43,8 +43,7 @@
 #include <linux/fips.h>
 #include <linux/time.h>
 #include <crypto/internal/rng.h>
-
-#include "jitterentropy.h"
+#include <crypto/internal/jitterentropy.h>
 
 /***************************************************************************
  * Helper function
diff --git a/crypto/jitterentropy.c b/crypto/jitterentropy.c
index a11b3208760f..ca7e70dab163 100644
--- a/crypto/jitterentropy.c
+++ b/crypto/jitterentropy.c
@@ -117,7 +117,7 @@ struct rand_data {
 #define JENT_EHEALTH		9 /* Health test failed during initialization */
 #define JENT_ERCT		10 /* RCT failed during initialization */
 
-#include "jitterentropy.h"
+#include <crypto/internal/jitterentropy.h>
 
 /***************************************************************************
  * Adaptive Proportion Test
@@ -854,3 +854,32 @@ int jent_entropy_init(void)
 
 	return 0;
 }
+
+struct rand_data *jent_lrng_entropy_collector(void)
+{
+	static unsigned char lrng_jent_mem[JENT_MEMORY_SIZE];
+	static struct rand_data lrng_jent_state = {
+		.data		= 0,
+		.old_data	= 0,
+		.prev_time	= 0,
+		.last_delta	= 0,
+		.last_delta2	= 0,
+		.osr		= 1,
+		.mem		= lrng_jent_mem,
+		.memlocation	= 0,
+		.memblocks	= JENT_MEMORY_BLOCKSIZE,
+		.memblocksize	= JENT_MEMORY_BLOCKS,
+		.memaccessloops	= JENT_MEMORY_ACCESSLOOPS,
+		.rct_count	= 0,
+		.apt_observations = 0,
+		.apt_count	= 0,
+		.apt_base	= 0,
+		.apt_base_set	= 0,
+		.health_failure = 0
+	};
+
+	if (jent_entropy_init())
+		return NULL;
+
+	return &lrng_jent_state;
+}
diff --git a/crypto/jitterentropy.h b/include/crypto/internal/jitterentropy.h
similarity index 84%
rename from crypto/jitterentropy.h
rename to include/crypto/internal/jitterentropy.h
index c83fff32d130..6e07d86eac82 100644
--- a/crypto/jitterentropy.h
+++ b/include/crypto/internal/jitterentropy.h
@@ -15,3 +15,6 @@ extern int jent_read_entropy(struct rand_data *ec, unsigned char *data,
 extern struct rand_data *jent_entropy_collector_alloc(unsigned int osr,
 						      unsigned int flags);
 extern void jent_entropy_collector_free(struct rand_data *entropy_collector);
+
+/* Access to statically allocated Jitter RNG instance */
+extern struct rand_data *jent_lrng_entropy_collector(void);
-- 
2.31.1





^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-07-20  6:13 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-20  6:13 [PATCH v41 09/13] crypto: provide access to a static Jitter RNG state kernel test robot
  -- strict thread matches above, loose matches on Subject: below --
2021-07-14  5:43 [PATCH v41 00/13] /dev/random - a new approach Stephan Müller
2021-07-14  5:47 ` [PATCH v41 09/13] crypto: provide access to a static Jitter RNG state Stephan Müller

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.