public inbox for kernel-hardening@lists.openwall.com
 help / color / mirror / Atom feed
From: Solar Designer <solar@openwall.com>
To: kernel-hardening@lists.openwall.com
Subject: Re: [kernel-hardening] [RFC] x86, mm: start mmap allocation for libs from low addresses
Date: Wed, 7 Sep 2011 14:16:08 +0400	[thread overview]
Message-ID: <20110907101608.GA17974@openwall.com> (raw)
In-Reply-To: <20110907095508.GA16114@albatros>

On Wed, Sep 07, 2011 at 01:55:08PM +0400, Vasiliy Kulikov wrote:
> OK, fully agree.  But why 100 KB?  Probably 0x10000 (64 KB)?  It looks
> nicer and not so magic.

Well, on Owl we have mmap_min_addr at 96 KB, which is sufficient e.g. in
case we have a struct field offset not larger than 32 KB and the field
itself is an array indexed by a 16-bit value.  Or if the field offset is
not larger than 64 KB and the index is a signed 16-bit value.

100 KB is a very cheap enhancement of the above, also allowing for two
levels of indirection (up to one 16-bit signed and one 16-bit unsigned)
relative to a fixed offset that fits in 4 KB.

Maybe we should move from 96 KB to 100 KB for Owl's mmap_min_addr
default.  Or maybe we should use 132 KB (4+64+64).

Oh, this assumes arrays of char, or our 16-bit variable being byte
offset rather than index.  132 KB would also support arrays of 16-bit
words, and even 16-bit signed indexes into arrays of 32-bit words.

OK, maybe I am imagining these possibilities, but to me these values
feel a little bit more reasonable than a mere 64 KB, which might be
just insufficient e.g. if we have a 16-bit unsigned byte offset variable
and the array itself is a struct field.  Even 68 KB would be a lot more
likely to help then.

Alexander

  reply	other threads:[~2011-09-07 10:16 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-12 10:29 [kernel-hardening] [RFC] x86, mm: start mmap allocation for libs from low addresses Vasiliy Kulikov
2011-08-12 10:58 ` Solar Designer
2011-08-12 11:05   ` Vasiliy Kulikov
2011-08-25 17:19   ` Vasiliy Kulikov
2011-08-25 17:39     ` Solar Designer
2011-09-02 18:29     ` Solar Designer
2011-09-03 11:18       ` Vasiliy Kulikov
2011-09-03 23:57         ` Solar Designer
2011-09-05 12:46           ` Vasiliy Kulikov
2011-09-06  5:05             ` Solar Designer
2011-09-07  9:09               ` Vasiliy Kulikov
2011-09-07  9:30                 ` Solar Designer
2011-09-07  9:34                   ` Vasiliy Kulikov
2011-09-07  9:43                     ` Solar Designer
2011-09-07  9:55                       ` Vasiliy Kulikov
2011-09-07 10:16                         ` Solar Designer [this message]
2011-09-07 11:01                           ` Vasiliy Kulikov
2011-09-02 23:34     ` Solar Designer
2011-09-03 12:12       ` Vasiliy Kulikov
2011-09-03 23:40         ` Solar Designer
2011-09-04  7:21         ` Vasiliy Kulikov
2011-08-12 23:19 ` [kernel-hardening] " H. Peter Anvin
2011-08-13  6:26   ` Vasiliy Kulikov
2011-08-16  9:05   ` Vasiliy Kulikov
2011-08-22 10:17     ` Vasiliy Kulikov
2011-08-22 17:24       ` H. Peter Anvin
2011-08-22 20:14         ` Vasiliy Kulikov
2011-08-22 20:17           ` H. Peter Anvin
2011-08-23  6:41             ` 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=20110907101608.GA17974@openwall.com \
    --to=solar@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