Re: start address of the code segment of the program on x86-64

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, 14 Feb 2013 15:33:48 +0200, Kevin Wilson said:
> Hi,
>
> 0x08048000 address is the start address of the code segment of a
> program in on x86-32.

More likely, it was the start address of *one particular run* of the
program.  In most kernel configurations, there's something called Address
Space Layout Randomization (ASLR) that makes the code land at different
places each time, to make it harder to write exploits because you can't
hardcode addresses.

> What is the start address of the code segment of the program  on x86-64 ?
>
> Is there a place in the kernel code where I can add a printk on a
> x86_64 machine to view the code segment
> start ?  How can it be done ?

cat /proc/self/smaps    and ponder for a while.  Try it twice and compare
and see if you can see what ASLR does.

You may also want to think about *why* you want to know where the code
segment starts.  If you know what this address is, what do you plan to
use it for?  (In other words, there's probably a different, easier way
to do whatever it is you're trying to accomplish here)...

Attachment: pgpi1XtDLkgmD.pgp
Description: PGP signature

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@xxxxxxxxxxxxxxxxx
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux