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: <CAHmME9qsj-Ge0LAXwFjtaMpY6W-G_fB7fTdXQ3rKRGpVpHnDnw@mail.gmail.com>
Date:   Fri, 25 Feb 2022 14:39:56 +0100
From:   "Jason A. Donenfeld" <Jason@...c4.com>
To:     Dominik Brodowski <linux@...inikbrodowski.net>
Cc:     LKML <linux-kernel@...r.kernel.org>,
        "Theodore Ts'o" <tytso@....edu>
Subject: Re: [PATCH v2] random: unify cycles_t and jiffies usage and types

On Fri, Feb 25, 2022 at 8:06 AM Dominik Brodowski
<linux@...inikbrodowski.net> wrote:
> maybe "flags, now = jiffies" is a bit more reader-friendly?

Good idea. Will do.

> >       enum { MIX_INFLIGHT = 1U << 31 };
> > +     cycles_t cycles = random_get_entropy();
> > +     unsigned long now = jiffies;
> >       struct fast_pool *fast_pool = this_cpu_ptr(&irq_randomness);
> >       struct pt_regs *regs = get_irq_regs();
> > -     unsigned long now = jiffies;
> > -     cycles_t cycles = random_get_entropy();
> >       unsigned int new_count;
> >
> >       if (cycles == 0)
>
>
> Why do you change the ordering here?

So that get_cycles() is called as closest to the actual interrupt as
possible, and so that we retain the order as elsewhere of reading
cycles before jiffies.

v+1 on its way.

Jason

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ