Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gMpyP-0006PN-Q4 for pgsql-hackers@arkaria.postgresql.org; Wed, 14 Nov 2018 07:52:30 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gMpyO-0006NY-7b for pgsql-hackers@arkaria.postgresql.org; Wed, 14 Nov 2018 07:52:28 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gMpyN-0006Me-Nu for pgsql-hackers@lists.postgresql.org; Wed, 14 Nov 2018 07:52:28 +0000 Received: from mail-pl1-x62c.google.com ([2607:f8b0:4864:20::62c]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gMpyK-0001qU-EY for pgsql-hackers@postgresql.org; Wed, 14 Nov 2018 07:52:26 +0000 Received: by mail-pl1-x62c.google.com with SMTP id b22-v6so1932180pls.7 for ; Tue, 13 Nov 2018 23:52:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=leadboat.com; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=XFcneDVoMAktrnlNMXi9l6dFmX2d6Xw1VWFW8rNyQqY=; b=LLzqyzFeLIUbp5IdGYmYgpyj6y/N3OeugZG+1OoRJO9P9VI4s7thDQvSKubdE2nI79 jy00RkqjKlXWB0dcu9MaIBljWVCNT7iOy0ELgT1rF+cBzqxPkIzlycibqCRkshoElGd4 8faZcuCj5KCucr7QOBcnXpLOxTR6ICBjli4BQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=XFcneDVoMAktrnlNMXi9l6dFmX2d6Xw1VWFW8rNyQqY=; b=dmwj5UFNdU41m8zuSrp1gQkMezMJBitfVMcVNfCm+QZdIpKzEyNm9irqve2OGqihA5 lD2RCPWs7bETPbIg2bjzRW2wlPiEas7LgDvyaD7TdkaUN+W+QRtLRaSXvOtJBYr0+eUk zrDGG3mFOFwPBMWUuOp/QIbppkXcTlmPHlahKrloUkir3u8SqlPizC3l7BtsWJm4zfGw OnMbzcr7zqwXHiN+WmcToZOBYGesLM5VKk9+brQDaBKACc0qvsWJK2rNUagWDx5Jf9bd zd+aKhOwgpffiBaIvJaTaEIHvBmxJdir/EvvYCoU+MJobyy6hNZhVVTI0sJbkVZXOeqg ggdA== X-Gm-Message-State: AGRZ1gLrmZSoRvUpC7teFcEpj4c+Ch8tb7CgdQ6aZ21RS015/k/V2SpM za6x5rak4CCXuGoKwtBhrS+VSA== X-Google-Smtp-Source: AJdET5c+1HRAgUncq9UIHWZu2dlGJNKznNkfuSSKxtmfu9DRiV4i1jzag6BHYJWwPRo9axnYZ/Nu2g== X-Received: by 2002:a17:902:274a:: with SMTP id j10-v6mr887885plg.312.1542181941729; Tue, 13 Nov 2018 23:52:21 -0800 (PST) Received: from rfd.leadboat.com (c-73-158-248-138.hsd1.ca.comcast.net. [73.158.248.138]) by smtp.gmail.com with ESMTPSA id h7sm16783224pfa.105.2018.11.13.23.52.20 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 13 Nov 2018 23:52:20 -0800 (PST) Date: Tue, 13 Nov 2018 23:52:18 -0800 From: Noah Misch To: Thomas Munro Cc: Tom Lane , Pg Hackers Subject: Re: DSM segment handle generation in background workers Message-ID: <20181114075218.GE1096408@rfd.leadboat.com> References: <9879.1539233472@sss.pgh.pa.us> <20181112083358.GA1073796@rfd.leadboat.com> <32455.1542033541@sss.pgh.pa.us> <20181114022435.GC1096408@rfd.leadboat.com> <20181114053412.GD1096408@rfd.leadboat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Wed, Nov 14, 2018 at 08:22:42PM +1300, Thomas Munro wrote: > On Wed, Nov 14, 2018 at 6:34 PM Noah Misch 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 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?