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
| ||
|
Date: Sun, 20 Sep 2020 18:49:57 +0200 From: Stephan Mueller <smueller@...onox.de> To: Arnd Bergmann <arnd@...db.de>, kernel test robot <lkp@...el.com> Cc: kbuild-all@...ts.01.org, Greg Kroah-Hartman <gregkh@...uxfoundation.org>, linux-crypto@...r.kernel.org, LKML <linux-kernel@...r.kernel.org>, linux-api@...r.kernel.org, "Eric W. Biederman" <ebiederm@...ssion.com>, "Alexander E. Patrakov" <patrakov@...il.com>, "Ahmed S. Darwish" <darwish.07@...il.com>, "Theodore Y. Ts'o" <tytso@....edu>, Willy Tarreau <w@....eu> Subject: Re: [PATCH v35 01/13] Linux Random Number Generator Am Freitag, 18. September 2020, 15:02:17 CEST schrieb kernel test robot: Hi, > All errors (new ones prefixed by >>): > >> drivers/char/lrng/lrng_chacha20.c:33:8: error: structure variable > >> 'chacha20' with 'latent_entropy' attribute has a non-integer field > >> 'block' > 33 | struct chacha20_state chacha20 __latent_entropy; > > | ^~~~~~~~~~~~~~ > > # > https://github.com/0day-ci/linux/commit/ecb964754fd80cca434d6d2ad6db8f28a15 > 92fa1 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/20200918-181505 git checkout > ecb964754fd80cca434d6d2ad6db8f28a1592fa1 > vim +33 drivers/char/lrng/lrng_chacha20.c > > 27 > 28 /* > 29 * Have a static memory blocks for the ChaCha20 DRNG instance to > avoid calling 30 * kmalloc too early in the boot cycle. For subsequent > allocation requests, 31 * such as per-NUMA-node DRNG instances, kmalloc > will be used. 32 */ > > > 33 struct chacha20_state chacha20 __latent_entropy; I do not think this report is valid. The following definitions apply: struct chacha20_state { struct chacha20_block block; }; struct chacha20_block { u32 constants[4]; union { #define CHACHA_KEY_SIZE_WORDS (CHACHA_KEY_SIZE / sizeof(u32)) u32 u[CHACHA_KEY_SIZE_WORDS]; u8 b[CHACHA_KEY_SIZE]; } key; u32 counter; u32 nonce[3]; }; This implies that struct chacha20_state and thus the chacha20 variable is a linear buffer with in total 4 + 8 + 1 + 3 = 16 32-bit integers which are at least aligned on a 32-bit boundary and are designated as u32 integers. Please let me know if I need to make a tweak to the definitions to convince the code analyzer it is a flat linear buffer consisting of integers and thus to understand the structure correctly. Thanks a lot. Ciao Stephan
Powered by blists - more mailing lists