> On Mar 10, 2016, at 12:20 PM, Rich Felker 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 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