lkml.org 
[lkml]   [2006]   [Oct]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: IS_ERR Threshold Value
Date
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
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2006-10-19 01:37    [W:0.061 / U:0.128 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site