public inbox for kernel-hardening@lists.openwall.com
 help / color / mirror / Atom feed
* [kernel-hardening] base address for shared libs
@ 2011-07-23 16:22 Solar Designer
  2011-07-24  8:51 ` Vasiliy Kulikov
                   ` (2 more replies)
  0 siblings, 3 replies; 16+ messages in thread
From: Solar Designer @ 2011-07-23 16:22 UTC (permalink / raw)
  To: kernel-hardening

Vasiliy,

At least on rhel5/openvz kernels, 32-bit processes get their shared libs
loaded at different kinds of addresses on i686 vs. x86_64 kernels.

Here's an example:

32-bit kernel and userland (OpenVZ container):

$ ldd /bin/ls
        librt.so.1 => /lib/librt.so.1 (0x00a99000)
        libtermcap.so.2 => /lib/libtermcap.so.2 (0x00c1a000)
        libc.so.6 => /lib/libc.so.6 (0x0014d000)
        libpthread.so.0 => /lib/libpthread.so.0 (0x00617000)
        /lib/ld-linux.so.2 (0x0012e000)

64-bit kernel, 32-bit userland (OpenVZ container):

$ ldd /bin/ls
        librt.so.1 => /lib/librt.so.1 (0xb7fcf000)
        libtermcap.so.2 => /lib/libtermcap.so.2 (0xb7fca000)
        libc.so.6 => /lib/libc.so.6 (0xb7eae000)
        libpthread.so.0 => /lib/libpthread.so.0 (0xb7e5b000)
        /lib/ld-linux.so.2 (0xb7fe6000)

Notice how the 32-bit kernel produces addresses that are safer against
attacks via C strings (contain NULs).  This is the approach I used in
-ow patches (using 0x00110000 as the base address, considering vm86
needs for the first 1 MB + 64 KB).  I'd like 64-bit kernels to do the
same when running 32-bit binaries.

Can you please look into this and likely fix it for mainline, as well as
for rhel6/openvz when we're ready to move to those kernels?  A fix for
rhel5/openvz would also be welcome if it's easy to do.

Thanks,

Alexander

^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2011-08-12 10:06 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-07-23 16:22 [kernel-hardening] base address for shared libs Solar Designer
2011-07-24  8:51 ` Vasiliy Kulikov
2011-07-24 14:27   ` Solar Designer
2011-07-24 18:18     ` Vasiliy Kulikov
2011-07-25 19:20     ` Vasiliy Kulikov
2011-08-11  8:32       ` Vasiliy Kulikov
2011-08-12  3:57         ` Solar Designer
2011-08-12  4:21           ` Solar Designer
2011-08-12  8:20             ` Vasiliy Kulikov
2011-08-12  9:20               ` Solar Designer
2011-08-12  9:52                 ` Vasiliy Kulikov
2011-08-12 10:04                   ` Solar Designer
2011-08-12 10:06                     ` Vasiliy Kulikov
2011-07-29  9:27 ` Vasiliy Kulikov
2011-07-30 18:38 ` Vasiliy Kulikov
2011-07-30 18:43   ` Vasiliy Kulikov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox