From: Bryan Hundven <bryanhundven@gmail.com>
To: musl@lists.openwall.com
Subject: Re: Memory management, how to protect some address space.
Date: Thu, 10 Mar 2016 12:24:21 -0800 [thread overview]
Message-ID: <B50D4B61-4044-4844-92C4-1158E07C17C8@gmail.com> (raw)
In-Reply-To: <20160310202050.GQ9349@brightrain.aerifal.cx>
[-- Attachment #1: Type: text/plain, Size: 1019 bytes --]
> On Mar 10, 2016, at 12:20 PM, Rich Felker <dalias@libc.org> wrote:
>
> On Thu, Mar 10, 2016 at 09:23:02PM +0200, John Found wrote:
>> On Thu, 10 Mar 2016 14:11:03 -0500
>> Rich Felker <dalias@libc.org> wrote:
>>
>>> The proper way to use personality() is before exec'ing your program.
>>> The stack address and some spare memory that musl re-uses as heap get
>>> assigned at exec time before you can do anything within your program
>>> to prevent that from happening. In theory that could happen with glibc
>>> too; if it doesn't you're just getting lucky.
>>>
>>> Rich
>>
>> Hm, isn't it paragraph 22? sys_personality changes the personality
>> of the calling process.
>> How to call it *before* executing program???
>
> exec does not make a new process; it replaces the program running in
> the current process with a new one. There's actually a command line
> too (I forget the name) to run a program with a particular personality
> that calls personality() before execve().
>
> Rich
iirc: setarch
-Bryan
[-- Attachment #2: Message signed with OpenPGP using GPGMail --]
[-- Type: application/pgp-signature, Size: 496 bytes --]
next prev parent reply other threads:[~2016-03-10 20:24 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-03-10 8:22 John Found
2016-03-10 16:45 ` Rich Felker
2016-03-10 19:02 ` John Found
2016-03-10 19:11 ` Rich Felker
2016-03-10 19:23 ` John Found
2016-03-10 19:53 ` Tomasz Sterna
2016-03-10 20:20 ` Rich Felker
2016-03-10 20:24 ` Bryan Hundven [this message]
2016-03-10 20:25 ` Alexander Monakov
2016-03-10 22:20 ` John Found
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=B50D4B61-4044-4844-92C4-1158E07C17C8@gmail.com \
--to=bryanhundven@gmail.com \
--cc=musl@lists.openwall.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/musl/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).