public inbox for kernel-hardening@lists.openwall.com
 help / color / mirror / Atom feed
From: Vasiliy Kulikov <segoon@openwall.com>
To: kernel-hardening@lists.openwall.com
Subject: Re: [kernel-hardening] base address for shared libs
Date: Fri, 29 Jul 2011 13:27:12 +0400	[thread overview]
Message-ID: <20110729092712.GA7727@albatros> (raw)
In-Reply-To: <20110723162251.GA11485@openwall.com>

Solar,

On Sat, Jul 23, 2011 at 20:22 +0400, Solar Designer wrote:
> 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.

Looking into RHEL6 kernel:

    void arch_pick_mmap_layout(struct mm_struct *mm)
    {
        ...
            if (!(current->personality & READ_IMPLIES_EXEC)
                && mmap_is_ia32())
                mm->get_unmapped_exec_area = arch_get_unmapped_exec_area;
        ...
    }

    #define SHLIB_BASE	0x00110000

    unsigned long
    arch_get_unmapped_exec_area(struct file *filp, unsigned long addr0,
            unsigned long len0, unsigned long pgoff, unsigned long flags)
    {
        ...
        if (!addr)
            addr = !should_randomize() ? SHLIB_BASE :
                randomize_range(SHLIB_BASE, 0x01000000, len);
        ...
    }

Looks like it is considered as a way to easily mmap libraries in CS
limited area by exec-shield, and not as a C-string barrier.


The comment says the common bottom-up doesn't support randomization:

    /*
     * Bottom-up (legacy) layout on X86_32 did not support randomization, X86_64
     * does, but not when emulating X86_32
     */

So, IMO the bottom-up layout allocator should be patched.


Thanks,

-- 
Vasiliy

  parent reply	other threads:[~2011-07-29  9:27 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
2011-07-30 18:38 ` Vasiliy Kulikov
2011-07-30 18:43   ` Vasiliy Kulikov

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=20110729092712.GA7727@albatros \
    --to=segoon@openwall.com \
    --cc=kernel-hardening@lists.openwall.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