Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bmOKh-0004de-Dn for pgsql-hackers@arkaria.postgresql.org; Tue, 20 Sep 2016 16:55:47 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1bmOKh-0000dD-10 for pgsql-hackers@arkaria.postgresql.org; Tue, 20 Sep 2016 16:55:47 +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_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1bmOJB-00053d-Lp for pgsql-hackers@postgresql.org; Tue, 20 Sep 2016 16:54:13 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1bmOJ8-0003At-W1 for pgsql-hackers@postgresql.org; Tue, 20 Sep 2016 16:54:13 +0000 Received: from pro.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id u8KGrseu011825; Tue, 20 Sep 2016 12:53:54 -0400 From: Tom Lane To: Robert Haas cc: Amit Kapila , Dmitry Vasilyev , pgsql-hackers Subject: Re: =?UTF-8?Q?Re=3A_=5BHACKERS=5D_Re=3A_=5BHACKERS=5D_Windows_service_is_not_s?= =?UTF-8?Q?tarting_so_there=E2=80=99s_message_in_log=3A_FATAL=3A_=22could_not_creat?= =?UTF-8?Q?e_shared_memory_segment_=E2=80=9CGlobal=2FPostgreSQL=2E851401618=E2=80=9D=3A_P?= =?UTF-8?Q?ermission_denied=E2=80=9D?= In-reply-to: References: <1444920387.3661.7.camel@postgrespro.ru> <1444921511.3661.13.camel@postgrespro.ru> Comments: In-reply-to Robert Haas message dated "Tue, 20 Sep 2016 12:32:56 -0400" Date: Tue, 20 Sep 2016 12:53:54 -0400 Message-ID: <20789.1474390434@sss.pgh.pa.us> X-Pg-Spam-Score: -5.0 (-----) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org Robert Haas writes: > Yeah, random() is the wrong thing. It should use PostmasterRandom(). > Fixed to do that instead. I am not very happy about this patch; have you considered the security implications of what you just did? If you haven't, I'll tell you: you just made the postmaster's selection of "random" cancel keys and password salts a lot more predictable. Formerly, the srandom() seed for those depended on both the postmaster start time and the time of the first connection request, but this change removes the first connection request from the equation. If you know the postmaster start time --- which we will happily tell any asker --- it will not take too many trials to find the seed that's in use. I'd be the first to agree that this point is inadequately documented in the code, but PostmasterRandom should be reserved for its existing security-related uses, not exposed to the world for (ahem) random other uses. regards, tom lane -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers