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: <CANc+2y4vg1F2+y98ijoR1Ve_2u+zpChN3OXxn+6uLebVLcDp6Q@mail.gmail.com>
Date:   Thu, 18 May 2017 11:13:29 +0530
From:   PrasannaKumar Muralidharan <prasannatsmkumar@...il.com>
To:     Rick Altherr <raltherr@...gle.com>
Cc:     linux-crypto@...r.kernel.org, linux-kernel@...r.kernel.org,
        Thomas Gleixner <tglx@...utronix.de>,
        Herbert Xu <herbert@...dor.apana.org.au>,
        Matt Mackall <mpm@...enic.com>
Subject: Re: [PATCH v1 2/2] hw_random: timeriomem_rng: Allow setting RNG
 quality from platform data

Hi Rick,

Minor comment below.

On 18 May 2017 at 03:59, Rick Altherr <raltherr@...gle.com> wrote:
> When a hw_random device's quality is non-zero, it will automatically be
> used to fill the kernel's entropy pool.  Since timeriomem_rng is used by
> many different devices, the quality needs to be provided by platform
> data or device tree.
>
> Signed-off-by: Rick Altherr <raltherr@...gle.com>
> ---
>
>  drivers/char/hw_random/timeriomem-rng.c | 7 +++++++
>  include/linux/timeriomem-rng.h          | 3 +++
>  2 files changed, 10 insertions(+)
>
> diff --git a/drivers/char/hw_random/timeriomem-rng.c b/drivers/char/hw_random/timeriomem-rng.c
> index a0faa5f05deb..03ff5483d865 100644
> --- a/drivers/char/hw_random/timeriomem-rng.c
> +++ b/drivers/char/hw_random/timeriomem-rng.c
> @@ -151,8 +151,15 @@ static int timeriomem_rng_probe(struct platform_device *pdev)
>                         dev_err(&pdev->dev, "missing period\n");
>                         return -EINVAL;
>                 }
> +
> +               if (!of_property_read_u32(pdev->dev.of_node,
> +                                               "quality", &i))
> +                       priv->rng_ops.quality = i;
> +               else
> +                       priv->rng_ops.quality = 0;
>         } else {
>                 period = pdata->period;
> +               priv->rng_ops.quality = pdata->quality;
>         }
>
>         priv->period = ns_to_ktime(period * NSEC_PER_USEC);
> diff --git a/include/linux/timeriomem-rng.h b/include/linux/timeriomem-rng.h
> index 46eb27ddbfab..320f743bf06b 100644
> --- a/include/linux/timeriomem-rng.h
> +++ b/include/linux/timeriomem-rng.h
> @@ -13,4 +13,7 @@ struct timeriomem_rng_data {
>
>         /* measures in usecs */
>         unsigned int            period;
> +
> +       /* bits of entropy per 1000 bits read */

Your dt-bindings patch says 'entropy per 1024 bits'. Please be consistent.

> +       unsigned int            quality;
>  };
> --
> 2.13.0.303.g4ebf302169-goog
>

Regards,
PrasannaKumar

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ