Re: DSM segment handle generation in background workers

From: Noah Misch <noah(at)leadboat(dot)com>
To: Thomas Munro <thomas(dot)munro(at)enterprisedb(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: DSM segment handle generation in background workers
Date: 2018-11-14 07:52:18
Message-ID: 20181114075218.GE1096408@rfd.leadboat.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Nov 14, 2018 at 08:22:42PM +1300, Thomas Munro wrote:
> On Wed, Nov 14, 2018 at 6:34 PM Noah Misch <noah(at)leadboat(dot)com> wrote:
> > On Wed, Nov 14, 2018 at 05:50:26PM +1300, Thomas Munro wrote:
> > > On Wed, Nov 14, 2018 at 3:24 PM Noah Misch <noah(at)leadboat(dot)com> wrote:
> > > > What counts is the ease of predicting a complete seed. HEAD's algorithm has
> > > > ~13 trivially-predictable bits, and the algorithm that stood in BackendRun()
> > > > from 98c5065 until 197e4af had no such bits. You're right that the other 19
> > > > bits are harder to predict than any given 19 bits under the old algorithm, but
> > > > the complete seed remains more predictable than it was before 197e4af.
> > >
> > > However we mix them, given that the source code is well known, isn't
> > > an attacker's job really to predict the time and pid, two not
> > > especially well guarded secrets?
> >
> > True. Better to frame the issue as uniform distribution of seed, not
> > unpredictability of seed selection.
>
> What do you think about the attached?

You mentioned that you rewrote the algorithm because the new function had a
TimestampTz. But the BackendRun() code, which it replaced, also had a
TimestampTz. You can reuse the exact algorithm. Is there a reason to change?

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2018-11-14 08:01:52 Re: [RFC] Removing "magic" oids
Previous Message Michael Paquier 2018-11-14 07:51:51 Re: Restore CurrentUserId only if 'prevUser' is valid when abort transaction