From: Tom Lane <tgl@sss.pgh.pa.us>
To: Andres Freund <andres@anarazel.de>
Cc: Amit Kapila <amit.kapila16@gmail.com>
Cc: pgsql-hackers <pgsql-hackers@postgresql.org>
Subject: Re: OK, so culicidae is *still* broken
Date: Thu, 20 Apr 2017 16:49:20 -0400
Message-ID: <18989.1492721360@sss.pgh.pa.us> (raw)
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>
<CAA4eK1KCbLtpG1qPMCN2orHsHhxkrL+UL9amZBeRfJ6XeA3iPg@mail.gmail.com>
<6309.1492611331@sss.pgh.pa.us>
<20170419153151.y5bfp4kdo377ycps@alap3.anarazel.de>
<CAA4eK1LFuxqWg8Jo5yjjn9rneG748Hb8V_HRmi+C0j7fp18qFQ@mail.gmail.com>
<20170420192500.gaagaaopc2kjmort@alap3.anarazel.de>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-hackers>
Andres Freund <andres@anarazel.de> 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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-hackers@postgresql.org
Cc: tgl@sss.pgh.pa.us, andres@anarazel.de, amit.kapila16@gmail.com
Subject: Re: OK, so culicidae is *still* broken
In-Reply-To: <18989.1492721360@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox