mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Bodo Eggert <7eggert@elstempel.de>
To: Jan Engelhardt <jengelh@linux01.gwdg.de>,
	Andreas Mohr <andi@rhlx01.fht-esslingen.de>,
	Ralf Baechle <ralf@linux-mips.org>,
	"Randy.Dunlap" <rdunlap@xenotime.net>,
	Andrew Morton <akpm@osdl.org>,
	Erik Frederiksen <erik_frederiksen@pmc-sierra.com>,
	linux-kernel@vger.kernel.org
Subject: Re: IS_ERR Threshold Value
Date: Thu, 19 Oct 2006 01:29:29 +0200	[thread overview]
Message-ID: <E1GaKr7-0001A5-Mg@be1.lrz> (raw)
In-Reply-To: <77jbT-1y3-29@gated-at.bofh.it>

Jan Engelhardt <jengelh@linux01.gwdg.de> wrote:

>>> +#define IS_ERR_VALUE(x) unlikely((x) >= (unsigned long)-MAX_ERRNO)
> 
> There seems to be a slight problem with doing that. Running
> `ldd /bin/bash` prints out
> 
> linux-gate.so.1 =>  (0xffffe000)
> 
> and the topmost address a kernel function can return is 0xFFFFf000 when
> MAX_ERRNO=4095, but that is going to be tight with the vdso mapped at
> 0xffffE000.

http://www.trilithium.com/johan/2005/08/linux-gate/

"... an x86 box where processes live in plain old 32-bit address spaces
divided into pages of 4096 bytes, making ffffe000 the penultimate page.
The very last page is reserved to catch accesses through invalid pointers,
e.g. dereferencing a decremented NULL pointer or a MAP_FAILED pointer
returned from mmap."

Therefore, MAX_ERRNO < PAGE_SIZE is safe.
-- 
Ich danke GMX dafür, die Verwendung meiner Adressen mittels per SPF
verbreiteten Lügen zu sabotieren.

http://david.woodhou.se/why-not-spf.html

       reply	other threads:[~2006-10-18 23:35 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <6sPiW-295-5@gated-at.bofh.it>
     [not found] ` <6sPsw-2y4-19@gated-at.bofh.it>
     [not found]   ` <6t9hu-6l6-11@gated-at.bofh.it>
     [not found]     ` <76GtI-T6-21@gated-at.bofh.it>
     [not found]       ` <77jbT-1y3-29@gated-at.bofh.it>
2006-10-18 23:29         ` Bodo Eggert [this message]
2006-06-28 20:57 Erik Frederiksen
2006-06-28 21:08 ` Randy.Dunlap
2006-06-28 22:39   ` H. Peter Anvin
2006-06-29 18:10   ` Ralf Baechle
2006-07-01 18:44     ` Randy.Dunlap
2006-07-01 22:23       ` H. Peter Anvin
2006-07-02 16:15         ` Ralf Baechle
2006-07-02 17:40           ` H. Peter Anvin
2006-07-02 18:22           ` Randy.Dunlap
2006-10-16 19:31     ` Andreas Mohr
2006-10-18 12:47       ` Jan Engelhardt
2006-06-28 22:41 ` Nathan Scott
2006-06-28 23:13   ` Erik Frederiksen
2006-06-28 23:22     ` Randy.Dunlap
2006-06-28 23:23     ` Nathan Scott

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=E1GaKr7-0001A5-Mg@be1.lrz \
    --to=7eggert@elstempel.de \
    --cc=7eggert@gmx.de \
    --cc=akpm@osdl.org \
    --cc=andi@rhlx01.fht-esslingen.de \
    --cc=erik_frederiksen@pmc-sierra.com \
    --cc=jengelh@linux01.gwdg.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ralf@linux-mips.org \
    --cc=rdunlap@xenotime.net \
    /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®