Re: PostgreSQL and ASLR on Linux

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Andres Freund <andres(at)2ndquadrant(dot)com>
Cc: "Robert Lerche (rlerche)" <rlerche(at)cisco(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>, "Sailesh Krishnamurthy (sailkris)" <sailkris(at)cisco(dot)com>
Subject: Re: PostgreSQL and ASLR on Linux
Date: 2013-08-05 01:07:02
Message-ID: CA+TgmoYFR+MyOsQOiZejvAAAEGLyrxDjmqKW5hN8h5JWE_PCDQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sun, Aug 4, 2013 at 8:54 PM, Andres Freund <andres(at)2ndquadrant(dot)com> wrote:
>> AFAIK you've got it backwards: ASLR is something that happens
>> automatically, unless you take steps to suppress it, at least on MacOS
>> X. I not long ago built with EXEC_BACKEND on that platform and found
>> that it broke stuff until I disabled ASLR.
>
> ALSR for code can only happen if code is built as position independent
> code, otherwise addresses are hardcoded. That is - in modern unixoid
> systems - nearly always the case for shared libraries et al, but not
> necessarily for plain binaries or statically linked code. The above
> referenced -fPIC and -pie make the code/executable position independent.

Ah, for code, yeah, I suppose that would be true. In the case I
mentioned though, though, it definitely seemed that other things were
moving around each time through, particularly the stack.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2013-08-05 01:10:10 Re: PostgreSQL and ASLR on Linux
Previous Message Tom Lane 2013-08-05 00:57:12 Re: query_planner() API change