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]
Date:   Thu, 16 Jan 2020 07:52:38 +0100
From:   Stephan Mueller <smueller@...onox.de>
To:     Randy Dunlap <rdunlap@...radead.org>
Cc:     Arnd Bergmann <arnd@...db.de>,
        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>,
        Matthew Garrett <mjg59@...f.ucam.org>,
        Vito Caputo <vcaputo@...garu.com>,
        Andreas Dilger <adilger.kernel@...ger.ca>,
        Jan Kara <jack@...e.cz>, Ray Strode <rstrode@...hat.com>,
        William Jon McCann <mccann@....edu>,
        zhangjs <zachary@...shancloud.com>,
        Andy Lutomirski <luto@...nel.org>,
        Florian Weimer <fweimer@...hat.com>,
        Lennart Poettering <mzxreary@...inter.de>,
        Nicolai Stange <nstange@...e.de>,
        "Peter, Matthias" <matthias.peter@....bund.de>,
        Marcelo Henrique Cerri <marcelo.cerri@...onical.com>,
        Roman Drahtmueller <draht@...altsekun.de>,
        Neil Horman <nhorman@...hat.com>,
        Julia Lawall <julia.lawall@...ia.fr>,
        Dan Carpenter <dan.carpenter@...cle.com>
Subject: Re: [PATCH v28 11/12] LRNG - add interface for gathering of raw entropy

Am Donnerstag, 16. Januar 2020, 07:48:20 CET schrieb Randy Dunlap:

Hi Randy,

> On 1/15/20 10:43 PM, Stephan Mueller wrote:
> > Am Donnerstag, 16. Januar 2020, 01:18:18 CET schrieb Randy Dunlap:
> > 
> > Hi Randy,
> > 
> >> On 1/15/20 2:35 AM, Stephan Müller wrote:
> >>> CC: "Eric W. Biederman" <ebiederm@...ssion.com>
> >>> CC: "Alexander E. Patrakov" <patrakov@...il.com>
> >>> CC: "Ahmed S. Darwish" <darwish.07@...il.com>
> >>> CC: "Theodore Y. Ts'o" <tytso@....edu>
> >>> CC: Willy Tarreau <w@....eu>
> >>> CC: Matthew Garrett <mjg59@...f.ucam.org>
> >>> CC: Vito Caputo <vcaputo@...garu.com>
> >>> CC: Andreas Dilger <adilger.kernel@...ger.ca>
> >>> CC: Jan Kara <jack@...e.cz>
> >>> CC: Ray Strode <rstrode@...hat.com>
> >>> CC: William Jon McCann <mccann@....edu>
> >>> CC: zhangjs <zachary@...shancloud.com>
> >>> CC: Andy Lutomirski <luto@...nel.org>
> >>> CC: Florian Weimer <fweimer@...hat.com>
> >>> CC: Lennart Poettering <mzxreary@...inter.de>
> >>> CC: Nicolai Stange <nstange@...e.de>
> >>> Reviewed-by: Roman Drahtmueller <draht@...altsekun.de>
> >>> Tested-by: Roman Drahtmüller <draht@...altsekun.de>
> >>> Tested-by: Marcelo Henrique Cerri <marcelo.cerri@...onical.com>
> >>> Tested-by: Neil Horman <nhorman@...hat.com>
> >>> Signed-off-by: Stephan Mueller <smueller@...onox.de>
> >>> ---
> >>> 
> >>>  drivers/char/lrng/Kconfig        |  16 ++
> >>>  drivers/char/lrng/Makefile       |   1 +
> >>>  drivers/char/lrng/lrng_testing.c | 271 +++++++++++++++++++++++++++++++
> >>>  3 files changed, 288 insertions(+)
> >>>  create mode 100644 drivers/char/lrng/lrng_testing.c
> >>> 
> >>> diff --git a/drivers/char/lrng/lrng_testing.c
> >>> b/drivers/char/lrng/lrng_testing.c new file mode 100644
> >>> index 000000000000..0e287eccd622
> >>> --- /dev/null
> >>> +++ b/drivers/char/lrng/lrng_testing.c
> >>> @@ -0,0 +1,271 @@
> >>> +// SPDX-License-Identifier: GPL-2.0 OR BSD-2-Clause
> >>> +/*
> >>> + * Linux Random Number Generator (LRNG) Raw entropy collection tool
> >>> + *
> >>> + * Copyright (C) 2019 - 2020, Stephan Mueller <smueller@...onox.de>
> >>> + */
> >>> +
> >>> +#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
> >>> +
> >>> +#include <linux/atomic.h>
> >>> +#include <linux/bug.h>
> >>> +#include <linux/debugfs.h>
> >>> +#include <linux/module.h>
> >>> +#include <linux/sched.h>
> >>> +#include <linux/sched/signal.h>
> >>> +#include <linux/slab.h>
> >>> +#include <linux/string.h>
> >>> +#include <linux/types.h>
> >>> +#include <linux/uaccess.h>
> >>> +#include <linux/workqueue.h>
> >>> +#include <asm/errno.h>
> >>> +
> >>> +#include "lrng_internal.h"
> >>> +
> >>> +#define LRNG_TESTING_RINGBUFFER_SIZE	1024
> >>> +#define LRNG_TESTING_RINGBUFFER_MASK	
(LRNG_TESTING_RINGBUFFER_SIZE - 1)
> >>> +
> >>> +static u32 lrng_testing_rb[LRNG_TESTING_RINGBUFFER_SIZE];
> >>> +static u32 lrng_rb_reader = 0;
> >>> +static u32 lrng_rb_writer = 0;
> >>> +static atomic_t lrng_testing_enabled = ATOMIC_INIT(0);
> >>> +
> >>> +static DECLARE_WAIT_QUEUE_HEAD(lrng_raw_read_wait);
> >>> +static DEFINE_SPINLOCK(lrng_raw_lock);
> >>> +
> >>> +/*
> >>> + * 0 ==> No boot test, gathering of runtime data allowed
> >>> + * 1 ==> Boot test enabled and ready for collecting data, gathering
> >>> runtime + *	 data is disabled
> >>> + * 2 ==> Boot test completed and disabled, gathering of runtime data is
> >>> + *	 disabled
> >>> + */
> >>> +static u32 boot_test = 0;
> >>> +module_param(boot_test, uint, 0644);
> >>> +MODULE_PARM_DESC(boot_test, "Enable gathering boot time entropy of the
> >>> first" +			    " entropy events");
> >> 
> >> One line for the string, please.
> > 
> > may I ask the question whether this should be done for all lines with
> > printk statements? As checkpatch.pl will complain if you have lines
> > larger than 80 chars and complains about line-broken printk statements, I
> > am always unsure which way to go.
> > 
> > All printk statements in the patch series have line-broken printk
> > statements.
> It's for grep-ability of the strings.
> grepping for partial strings would work as is, but then one would need to
> know what partial string to search for.

Ok, I am changing all these strings to one-liners even though checkpatch.pl 
will complain.

Thank you.

Ciao
Stephan


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ