Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 559030 - dev-lisp/sbcl: Fix handling of ASLR after program setup
Summary: dev-lisp/sbcl: Fix handling of ASLR after program setup
Status: RESOLVED TEST-REQUEST
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: AMD64 Linux
: Normal major (vote)
Assignee: Panagiotis Christopoulos (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-08-28 13:40 UTC by Andreas Wiese
Modified: 2016-05-30 07:45 UTC (History)
4 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
patch to reenable ASLR after setup (sbcl-reenable-asrl.patch,1.95 KB, patch)
2015-08-28 13:41 UTC, Andreas Wiese
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Andreas Wiese 2015-08-28 13:40:24 UTC
On startup, sbcl detects whether it is running under ASLR and if so calls personality() to disable it and re-execs to have it turned off for itself.  Unfortunately, after restart it does not turn it back on again.  The result is that every executable started by sbcl also has ASLR disabled.

I already submitted this bug with an accompanying patch to upstream already¹.  Unfortunately, they are in feature-freeze at the moment and will only apply the patch after that phase.

Thus I'm submitting this patch here and would like to ask you to integrate it into the ebuild until it is applied upstream.

¹ http://sourceforge.net/p/sbcl/mailman/message/34413464/

Reproducible: Always

Steps to Reproduce:
$ cat > test.c << EOF
#include <sys/personality.h>
#include <stdio.h>

int main(void)
{
    int pers = personality(0xffffffffUL);
    printf("ASLR is %s\n", pers & ADDR_NO_RANDOMIZE ? "off" : "on");
    return 0;
}
EOF
}
$ gcc -o test test.c
$ ./test
ASLR is on
$ cat > test.lisp << EOF
#!/usr/bin/sbcl --script
(sb-ext:run-program "./test" nil :output t)
EOF
$ sbcl --script test.lisp
ASLR is off
$

Actual Results:  
ASLR is off

Expected Results:  
ASLR is on
Comment 1 Andreas Wiese 2015-08-28 13:41:31 UTC
Created attachment 410516 [details, diff]
patch to reenable ASLR after setup
Comment 2 Pacho Ramos gentoo-dev 2016-05-28 08:48:28 UTC
is this solved in 1.3.5 then?
Comment 3 Andreas Wiese 2016-05-30 07:45:54 UTC
The patch was applied upstream prior to release of 1.2.16, so this and all greater versions are covered.  Unfortunately it seems upstream took this more as a feature request, though, so only version >=1.2.16 got the patch.  Version 1.1.18 still present in portage hence is affected, too.