From: kernel test robot <lkp@intel.com>
To: "Stephan Müller" <smueller@chronox.de>, "Arnd Bergmann" <arnd@arndb.de>
Cc: kbuild-all@lists.01.org,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
linux-crypto@vger.kernel.org, LKML <linux-kernel@vger.kernel.org>,
linux-api@vger.kernel.org,
"Eric W. Biederman" <ebiederm@xmission.com>,
"Alexander E. Patrakov" <patrakov@gmail.com>,
"Ahmed S. Darwish" <darwish.07@gmail.com>,
"Theodore Y. Ts'o" <tytso@mit.edu>, Willy Tarreau <w@1wt.eu>
Subject: Re: [PATCH v32 01/12] Linux Random Number Generator
Date: Thu, 20 Aug 2020 19:46:49 +0800 [thread overview]
Message-ID: <202008201950.Peepx4LA%lkp@intel.com> (raw)
In-Reply-To: <7836955.NyiUUSuA9g@positron.chronox.de>
[-- Attachment #1: Type: text/plain, Size: 9347 bytes --]
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.9-rc1 next-20200820]
[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-with-full-SP800-90B-compliance/20200820-165712
base: https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc.git d162219c655c8cf8003128a13840d6c1e183fb80
config: nios2-allyesconfig (attached as .config)
compiler: nios2-linux-gcc (GCC) 9.3.0
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
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=nios2
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
All warnings (new ones prefixed by >>):
>> drivers/char/lrng/lrng_interfaces.c:120:6: warning: no previous prototype for 'add_hwgenerator_randomness' [-Wmissing-prototypes]
120 | void add_hwgenerator_randomness(const char *buffer, size_t count,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/char/lrng/lrng_interfaces.c:297:6: warning: no previous prototype for 'get_random_bytes_full' [-Wmissing-prototypes]
297 | void get_random_bytes_full(void *buf, int nbytes)
| ^~~~~~~~~~~~~~~~~~~~~
drivers/char/lrng/lrng_interfaces.c:37:18: warning: array 'random_table' assumed to have one element
37 | struct ctl_table random_table[];
| ^~~~~~~~~~~~
# https://github.com/0day-ci/linux/commit/866aae82856f1fba6af5c4b19a3905800cab4563
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-with-full-SP800-90B-compliance/20200820-165712
git checkout 866aae82856f1fba6af5c4b19a3905800cab4563
vim +/add_hwgenerator_randomness +120 drivers/char/lrng/lrng_interfaces.c
107
108 /**
109 * add_hwgenerator_randomness() - Interface for in-kernel drivers of true
110 * hardware RNGs.
111 *
112 * Those devices may produce endless random bits and will be throttled
113 * when our pool is full.
114 *
115 * @buffer: buffer holding the entropic data from HW noise sources to be used to
116 * insert into entropy pool.
117 * @count: length of buffer
118 * @entropy_bits: amount of entropy in buffer (value is in bits)
119 */
> 120 void add_hwgenerator_randomness(const char *buffer, size_t count,
121 size_t entropy_bits)
122 {
123 /*
124 * Suspend writing if we are fully loaded with entropy.
125 * We'll be woken up again once below lrng_write_wakeup_thresh,
126 * or when the calling thread is about to terminate.
127 */
128 wait_event_interruptible(lrng_write_wait,
129 lrng_need_entropy() ||
130 lrng_state_exseed_allow(lrng_noise_source_hw) ||
131 kthread_should_stop());
132 lrng_state_exseed_set(lrng_noise_source_hw, false);
133 lrng_pool_lfsr_nonaligned(buffer, count);
134 lrng_pool_add_entropy(entropy_bits);
135 }
136 EXPORT_SYMBOL_GPL(add_hwgenerator_randomness);
137
138 /**
139 * add_bootloader_randomness() - Handle random seed passed by bootloader.
140 *
141 * If the seed is trustworthy, it would be regarded as hardware RNGs. Otherwise
142 * it would be regarded as device data.
143 * The decision is controlled by CONFIG_RANDOM_TRUST_BOOTLOADER.
144 *
145 * @buf: buffer holding the entropic data from HW noise sources to be used to
146 * insert into entropy pool.
147 * @size: length of buffer
148 */
149 void add_bootloader_randomness(const void *buf, unsigned int size)
150 {
151 if (IS_ENABLED(CONFIG_RANDOM_TRUST_BOOTLOADER))
152 add_hwgenerator_randomness(buf, size, size * 8);
153 else
154 add_device_randomness(buf, size);
155 }
156 EXPORT_SYMBOL_GPL(add_bootloader_randomness);
157
158 /*
159 * Callback for HID layer -- use the HID event values to stir the entropy pool
160 */
161 void add_input_randomness(unsigned int type, unsigned int code,
162 unsigned int value)
163 {
164 static unsigned char last_value;
165
166 /* ignore autorepeat and the like */
167 if (value == last_value)
168 return;
169
170 last_value = value;
171
172 lrng_pool_lfsr_u32((type << 4) ^ code ^ (code >> 4) ^ value);
173 }
174 EXPORT_SYMBOL_GPL(add_input_randomness);
175
176 /**
177 * add_device_randomness() - Add device- or boot-specific data to the entropy
178 * pool to help initialize it.
179 *
180 * None of this adds any entropy; it is meant to avoid the problem of
181 * the entropy pool having similar initial state across largely
182 * identical devices.
183 *
184 * @buf: buffer holding the entropic data from HW noise sources to be used to
185 * insert into entropy pool.
186 * @size: length of buffer
187 */
188 void add_device_randomness(const void *buf, unsigned int size)
189 {
190 lrng_pool_lfsr_nonaligned((u8 *)buf, size);
191 lrng_pool_lfsr_u32(random_get_entropy());
192 lrng_pool_lfsr_u32(jiffies);
193 }
194 EXPORT_SYMBOL(add_device_randomness);
195
196 #ifdef CONFIG_BLOCK
197 void rand_initialize_disk(struct gendisk *disk) { }
198 void add_disk_randomness(struct gendisk *disk) { }
199 EXPORT_SYMBOL(add_disk_randomness);
200 #endif
201
202 /**
203 * del_random_ready_callback() - Delete a previously registered readiness
204 * callback function.
205 *
206 * @rdy: callback definition that was registered initially
207 */
208 void del_random_ready_callback(struct random_ready_callback *rdy)
209 {
210 unsigned long flags;
211 struct module *owner = NULL;
212
213 spin_lock_irqsave(&lrng_ready_list_lock, flags);
214 if (!list_empty(&rdy->list)) {
215 list_del_init(&rdy->list);
216 owner = rdy->owner;
217 }
218 spin_unlock_irqrestore(&lrng_ready_list_lock, flags);
219
220 module_put(owner);
221 }
222 EXPORT_SYMBOL(del_random_ready_callback);
223
224 /**
225 * add_random_ready_callback() - Add a callback function that will be invoked
226 * when the DRNG is mimimally seeded.
227 *
228 * @rdy: callback definition to be invoked when the LRNG is seeded
229 *
230 * Return:
231 * * 0 if callback is successfully added
232 * * -EALREADY if pool is already initialised (callback not called)
233 * * -ENOENT if module for callback is not alive
234 */
235 int add_random_ready_callback(struct random_ready_callback *rdy)
236 {
237 struct module *owner;
238 unsigned long flags;
239 int err = -EALREADY;
240
241 if (likely(lrng_state_min_seeded()))
242 return err;
243
244 owner = rdy->owner;
245 if (!try_module_get(owner))
246 return -ENOENT;
247
248 spin_lock_irqsave(&lrng_ready_list_lock, flags);
249 if (lrng_state_min_seeded())
250 goto out;
251
252 owner = NULL;
253
254 list_add(&rdy->list, &lrng_ready_list);
255 err = 0;
256
257 out:
258 spin_unlock_irqrestore(&lrng_ready_list_lock, flags);
259
260 module_put(owner);
261
262 return err;
263 }
264 EXPORT_SYMBOL(add_random_ready_callback);
265
266 /*********************** LRNG kernel output interfaces ************************/
267
268 /**
269 * get_random_bytes() - Provider of cryptographic strong random numbers for
270 * kernel-internal usage.
271 *
272 * This function is appropriate for all in-kernel use cases. However,
273 * it will always use the ChaCha20 DRNG.
274 *
275 * @buf: buffer to store the random bytes
276 * @nbytes: size of the buffer
277 */
278 void get_random_bytes(void *buf, int nbytes)
279 {
280 lrng_drng_get_atomic((u8 *)buf, (u32)nbytes);
281 lrng_debug_report_seedlevel("get_random_bytes");
282 }
283 EXPORT_SYMBOL(get_random_bytes);
284
285 /**
286 * get_random_bytes_full() - Provider of cryptographic strong random numbers
287 * for kernel-internal usage.
288 *
289 * This function is appropriate only for non-atomic use cases as this
290 * function may sleep. Though, it provides access to the full functionality
291 * of LRNG including the switchable DRNG support, that may support other
292 * DRNGs such as the SP800-90A DRBG.
293 *
294 * @buf: buffer to store the random bytes
295 * @nbytes: size of the buffer
296 */
> 297 void get_random_bytes_full(void *buf, int nbytes)
298 {
299 lrng_drng_get_sleep((u8 *)buf, (u32)nbytes);
300 lrng_debug_report_seedlevel("get_random_bytes_full");
301 }
302 EXPORT_SYMBOL(get_random_bytes_full);
303
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 57262 bytes --]
next prev parent reply other threads:[~2020-08-20 11:49 UTC|newest]
Thread overview: 72+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-08-20 8:25 [PATCH v32 00/12] /dev/random - a new approach with full SP800-90B compliance Stephan Müller
2020-08-20 8:39 ` [PATCH v32 01/12] Linux Random Number Generator Stephan Müller
2020-08-20 11:46 ` kernel test robot [this message]
2020-08-20 12:31 ` Stephan Müller
2020-08-20 8:40 ` [PATCH v32 02/12] LRNG - allocate one DRNG instance per NUMA node Stephan Müller
2020-08-20 8:40 ` [PATCH v32 03/12] LRNG - sysctls and /proc interface Stephan Müller
2020-08-20 8:41 ` [PATCH v32 04/12] LRNG - add switchable DRNG support Stephan Müller
2020-08-20 8:42 ` [PATCH v32 05/12] crypto: DRBG - externalize DRBG functions for LRNG Stephan Müller
2020-08-20 8:42 ` [PATCH v32 06/12] LRNG - add SP800-90A DRBG extension Stephan Müller
2020-08-20 12:07 ` kernel test robot
2020-08-20 12:27 ` Stephan Müller
2020-08-20 8:43 ` [PATCH v32 07/12] LRNG - add kernel crypto API PRNG extension Stephan Müller
2020-08-20 12:32 ` kernel test robot
2020-08-20 8:43 ` [PATCH v32 08/12] crypto: provide access to a static Jitter RNG state Stephan Müller
2020-08-20 8:44 ` [PATCH v32 09/12] LRNG - add Jitter RNG fast noise source Stephan Müller
2020-08-20 8:44 ` [PATCH v32 10/12] LRNG - add SP800-90B compliant health tests Stephan Müller
2020-08-20 8:45 ` [PATCH v32 11/12] LRNG - add interface for gathering of raw entropy Stephan Müller
2020-08-20 12:47 ` kernel test robot
2020-08-20 8:45 ` [PATCH v32 12/12] LRNG - add power-on and runtime self-tests Stephan Müller
2020-08-21 5:37 ` [PATCH v33 00/12] /dev/random - a new approach with full SP800-90B compliance Stephan Müller
2020-08-21 5:38 ` [PATCH v33 01/12] Linux Random Number Generator Stephan Müller
2020-08-21 19:42 ` kernel test robot
2020-08-22 4:49 ` Stephan Müller
2020-08-22 3:34 ` kernel test robot
2020-08-26 14:27 ` kernel test robot
2020-08-26 14:22 ` Stephan Mueller
2020-08-21 5:39 ` [PATCH v33 02/12] LRNG - allocate one DRNG instance per NUMA node Stephan Müller
2020-08-21 5:39 ` [PATCH v33 03/12] LRNG - sysctls and /proc interface Stephan Müller
2020-08-23 7:10 ` kernel test robot
2020-08-21 5:40 ` [PATCH v33 04/12] LRNG - add switchable DRNG support Stephan Müller
2020-08-21 5:40 ` [PATCH v33 05/12] crypto: DRBG - externalize DRBG functions for LRNG Stephan Müller
2020-08-21 5:41 ` [PATCH v33 06/12] LRNG - add SP800-90A DRBG extension Stephan Müller
2020-08-21 5:42 ` [PATCH v33 07/12] LRNG - add kernel crypto API PRNG extension Stephan Müller
2020-08-21 5:42 ` [PATCH v33 08/12] crypto: provide access to a static Jitter RNG state Stephan Müller
2020-08-21 5:42 ` [PATCH v33 09/12] LRNG - add Jitter RNG fast noise source Stephan Müller
2020-08-21 5:43 ` [PATCH v33 10/12] LRNG - add SP800-90B compliant health tests Stephan Müller
2020-08-21 5:43 ` [PATCH v33 11/12] LRNG - add interface for gathering of raw entropy Stephan Müller
2020-08-21 5:44 ` [PATCH v33 12/12] LRNG - add power-on and runtime self-tests Stephan Müller
2020-08-23 14:50 ` kernel test robot
2020-08-25 7:21 ` [PATCH v34 00/12] /dev/random - a new approach with full SP800-90B compliance Stephan Müller
2020-08-25 7:22 ` [PATCH v34 01/12] Linux Random Number Generator Stephan Müller
2020-08-25 11:28 ` kernel test robot
2020-08-25 11:51 ` Stephan Mueller
2020-08-31 9:24 ` kernel test robot
2020-08-25 7:23 ` [PATCH v34 02/12] LRNG - allocate one DRNG instance per NUMA node Stephan Müller
2020-08-25 7:23 ` [PATCH v34 03/12] LRNG - sysctls and /proc interface Stephan Müller
2020-08-25 7:24 ` [PATCH v34 04/12] LRNG - add switchable DRNG support Stephan Müller
2020-08-31 10:03 ` kernel test robot
2020-08-25 7:24 ` [PATCH v34 05/12] crypto: DRBG - externalize DRBG functions for LRNG Stephan Müller
2020-08-25 7:25 ` [PATCH v34 06/12] LRNG - add SP800-90A DRBG extension Stephan Müller
2020-08-25 7:25 ` [PATCH v34 07/12] LRNG - add kernel crypto API PRNG extension Stephan Müller
2020-08-25 7:26 ` [PATCH v34 08/12] crypto: provide access to a static Jitter RNG state Stephan Müller
2020-08-25 7:26 ` [PATCH v34 09/12] LRNG - add Jitter RNG fast noise source Stephan Müller
2020-08-25 7:27 ` [PATCH v34 10/12] LRNG - add SP800-90B compliant health tests Stephan Müller
2020-08-25 7:27 ` [PATCH v34 11/12] LRNG - add interface for gathering of raw entropy Stephan Müller
2020-08-25 7:27 ` [PATCH v34 12/12] LRNG - add power-on and runtime self-tests Stephan Müller
2020-09-18 9:47 ` [PATCH v35 00/13] /dev/random - a new approach Stephan Müller
2020-09-18 9:48 ` [PATCH v35 01/13] Linux Random Number Generator Stephan Müller
2020-09-18 13:02 ` kernel test robot
2020-09-20 16:49 ` Stephan Mueller
2020-09-18 9:48 ` [PATCH v35 02/13] LRNG - allocate one DRNG instance per NUMA node Stephan Müller
2020-09-18 9:49 ` [PATCH v35 03/13] LRNG - sysctls and /proc interface Stephan Müller
2020-09-18 9:49 ` [PATCH v35 04/13] LRNG - add switchable DRNG support Stephan Müller
2020-09-18 9:49 ` [PATCH v35 05/13] LRNG - add common generic hash support Stephan Müller
2020-09-18 9:50 ` [PATCH v35 06/13] crypto: DRBG - externalize DRBG functions for LRNG Stephan Müller
2020-09-18 9:50 ` [PATCH v35 07/13] LRNG - add SP800-90A DRBG extension Stephan Müller
2020-09-18 9:51 ` [PATCH v35 08/13] LRNG - add kernel crypto API PRNG extension Stephan Müller
2020-09-18 9:51 ` [PATCH v35 09/13] crypto: provide access to a static Jitter RNG state Stephan Müller
2020-09-18 9:51 ` [PATCH v35 10/13] LRNG - add Jitter RNG fast noise source Stephan Müller
2020-09-18 9:52 ` [PATCH v35 11/13] LRNG - add SP800-90B compliant health tests Stephan Müller
2020-09-18 9:53 ` [PATCH v35 12/13] LRNG - add interface for gathering of raw entropy Stephan Müller
2020-09-18 9:53 ` [PATCH v35 13/13] LRNG - add power-on and runtime self-tests Stephan Müller
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=202008201950.Peepx4LA%lkp@intel.com \
--to=lkp@intel.com \
--cc=arnd@arndb.de \
--cc=darwish.07@gmail.com \
--cc=ebiederm@xmission.com \
--cc=gregkh@linuxfoundation.org \
--cc=kbuild-all@lists.01.org \
--cc=linux-api@vger.kernel.org \
--cc=linux-crypto@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=patrakov@gmail.com \
--cc=smueller@chronox.de \
--cc=tytso@mit.edu \
--cc=w@1wt.eu \
/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;
as well as URLs for NNTP newsgroup(s).