unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
From: Jonathan Brielmaier via Bug reports for GNU Guix <bug-guix@gnu.org>
To: 68961@debbugs.gnu.org
Subject: bug#68961: ASLR seems to be partially broken
Date: Tue, 6 Feb 2024 23:57:53 +0100	[thread overview]
Message-ID: <9d2a36ae-983d-44a2-94f7-8e6aff389a05@web.de> (raw)

Hi,

I found today an interesting blog post about broken ASLR (Address Space
Layout Randomization) on Linux:
https://zolutal.github.io/aslrnt/

Curious if this is also a problem on Guix System I did a quick test.

```
$ cat aslr.py
from subprocess import check_output
result = 0x0
for _ in range(0,1000):
     out = check_output("cat /proc/self/maps | grep libc | head -n1",
shell=True).decode()
     base_address = int(out.split('-')[0], 16)
     result |= base_address
print('libc: ' + hex(result))

resultld = 0x0
for _ in range(0,1000):
     out = check_output("cat /proc/self/maps | grep ld-linux | head
-n1", shell=True).decode()
     base_address = int(out.split('-')[0], 16)
     resultld |= base_address
print('ld-linux: ' + hex(resultld))
```

Running this on x86_64 system of mine results on two systems in:
libc: 0x7ffffffa9000
ld-linux: 0x7ffffffff000

On the third system it prints:
libc: 0x7ffffffff000
ld-linux: 0x7ffffffff000

For 32bit it looks even worse (not sure if it's correct to test it like
this):
$ guix shell --system=i686-linux coreutils python -- python3 aslr.py
libc: 0xf7800000
ld-linux: 0xf7fff000

Not sure what we should do here. There seem to be some a kernel patch
for Ubuntu available:
https://git.launchpad.net/~ubuntu-kernel/ubuntu/+source/linux/+git/noble/commit/?h=master-next&id=760c2b1fa1f5e95be1117bc7b80afb8441d4b002

~Jonathan




             reply	other threads:[~2024-02-06 22:59 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-06 22:57 Jonathan Brielmaier via Bug reports for GNU Guix [this message]
2024-02-08  8:50 ` bug#68961: ASLR seems to be partially broken Liliana Marie Prikler

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

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9d2a36ae-983d-44a2-94f7-8e6aff389a05@web.de \
    --to=bug-guix@gnu.org \
    --cc=68961@debbugs.gnu.org \
    --cc=jonathan.brielmaier@web.de \
    /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.savannah.gnu.org/cgit/guix.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).