mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: yalin wang <yalin.wang2010@gmail.com>
To: 慕冬亮 <mudongliangabcd@gmail.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: why is text address constant with full randomization?
Date: Tue, 15 Sep 2015 17:05:40 +0800	[thread overview]
Message-ID: <000AC074-2BC0-4361-A518-787ABAC1C9A2@gmail.com> (raw)
In-Reply-To: <CAD-N9QVQiWXkv9PYs8Hqw7jryCUKqeaeyWc-rWzMODc0Zu0KTw@mail.gmail.com>


> On Sep 15, 2015, at 16:36, 慕冬亮 <mudongliangabcd@gmail.com> wrote:
> 
> First, my linux kernel is Linux 114-212-83-136 4.1.0-2-amd64.
> Second, I copy /bin/cat in system to mycat , and see the address space
> layout below.
> 
> mdl@114-212-83-136:~$ ./mycat /proc/self/maps
> 00400000-0040c000 r-xp 00000000 08:03 1046776
> /home/mdl/mycat
> 0060b000-0060c000 r--p 0000b000 08:03 1046776
> /home/mdl/mycat
> 0060c000-0060d000 rw-p 0000c000 08:03 1046776
> /home/mdl/mycat
> 01da7000-01dc8000 rw-p 00000000 00:00 0
> [heap]
> ......
> 
> The starting address of executable image is constant with my aslr
> configuration 2 (full randomization).
> I think text segment should be inconstant to defeat the attack like
> reusing text code!
> Is it related to fixing offset2lib attack?
> Thanks for any help!
>    - mudongliang

 your mycat elf is executable elf file,
it is not possible to random the .text section address,
only relocatable elf file can be random,
you should build your elf with  gcc -fPIC to make it relocatable .

Thanks


  reply	other threads:[~2015-09-15  9:06 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-15  8:36 慕冬亮
2015-09-15  9:05 ` yalin wang [this message]
2015-09-21 14:31   ` 慕冬亮
2015-09-21 18:59     ` Austin S Hemmelgarn

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=000AC074-2BC0-4361-A518-787ABAC1C9A2@gmail.com \
    --to=yalin.wang2010@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mudongliangabcd@gmail.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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®