Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d1J1A-0001ma-5T for pgsql-hackers@arkaria.postgresql.org; Thu, 20 Apr 2017 20:49:32 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1d1J19-0004M0-AS for pgsql-hackers@arkaria.postgresql.org; Thu, 20 Apr 2017 20:49:31 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1d1J17-0004LI-Dh for pgsql-hackers@postgresql.org; Thu, 20 Apr 2017 20:49:29 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1d1J12-0006me-79 for pgsql-hackers@postgresql.org; Thu, 20 Apr 2017 20:49:28 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id v3KKnK90018990; Thu, 20 Apr 2017 16:49:20 -0400 From: Tom Lane To: Andres Freund cc: Amit Kapila , pgsql-hackers Subject: Re: OK, so culicidae is *still* broken In-reply-to: <20170420192500.gaagaaopc2kjmort@alap3.anarazel.de> References: <20170415210643.cdapwhwmbiwaqd6e@alap3.anarazel.de> <2829.1492290578@sss.pgh.pa.us> <20170415211810.vsing3muvqfcswqx@alap3.anarazel.de> <3667.1492291494@sss.pgh.pa.us> <20170415213017.co7gkjlbcy44zlmw@alap3.anarazel.de> <4180.1492292046@sss.pgh.pa.us> <6309.1492611331@sss.pgh.pa.us> <20170419153151.y5bfp4kdo377ycps@alap3.anarazel.de> <20170420192500.gaagaaopc2kjmort@alap3.anarazel.de> Comments: In-reply-to Andres Freund message dated "Thu, 20 Apr 2017 12:25:00 -0700" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <18988.1492721360.1@sss.pgh.pa.us> Date: Thu, 20 Apr 2017 16:49:20 -0400 Message-ID: <18989.1492721360@sss.pgh.pa.us> X-Pg-Spam-Score: -1.9 (-) 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 Andres Freund writes: > On 2017-04-20 16:57:03 +0530, Amit Kapila wrote: >> Agreed. I have done some further study by using VMMap tool in Windows >> and it seems to me that all 64-bit processes use address range >> (0000000000010000 ~ 000007FFFFFE0000). I have attached two screen >> shots to show the address range (lower range and upper range). You >> need to refer the lower half of the window in attached screenshots. >> At this stage, I am not completely sure whether we can assume some >> address out of this range to use in MapViewOfFileEx. Let me know your >> thoughts. > That seems like a fairly restricted range (good!), and squares with > memories of reading about this (can't find the reference anymore). Just > using something like 0x00000F0000000000 as the address might work > sufficiently well. What happens if you just hardcode that in the first > MapViewOfFileEx call, and change RandomizedBaseAddress="FALSE" in > src/tools/msvc/VCBuildProject.pm to true? The material I found about Linux x86_64 addressing explains that the underlying hardware address space is only 48 bits. Linux chooses to normalize this by sign-extending into the upper 16 bits, so that valid 64-bit addresses are 0000000000000000 .. 00007FFFFFFFFFFF and FFFF800000000000 .. FFFFFFFFFFFFFFFF If I'm counting the bits correctly, Windows is choosing to use only 1/16th of the lower half of the available address space, which seems a bit odd. However, the main point here is that there should be quite a bit of available daylight, if they will let us use addresses above 000007FFFFFE0000 at all. I'd be inclined to do our own low-tech ASLR by using addresses with a random component, say 00000Fxxxxxx0000. 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