lkml.org 
[lkml]   [1998]   [Oct]   [21]   [last100]   RSS Feed
Views: [more markup]  [less markup]  [headers]  [forward] 
 
Messages in this thread
/
DateWed, 21 Oct 1998 12:25:43 +1300
FromChris Wedgwood <>
SubjectRe: Linux 2.1.125 doesn't dump core on SIGSEGV
On Wed, Oct 21, 1998 at 12:42:47AM +0100, Alan Cox wrote:

> To wear a linus impersonator hat
> O_NOFOLLOW is the generic solution to that and a pile of other link handling
> problems

O_CREAT|O_EXCL won't follow links - so we can create core that way,
and not dump if it fails.
I've also got a three liner to implement O_NOFOLLOW that may or may
not work (kernel being recompiled now). It seemed to trivial to
implement, so I'm not sure its `correct':

open_namei uses a macro lookup_flags(x) to generate a lookup
condition based upon the open flags - if O_CREAT|O_EXCL are both set,
we don't follow links.
So, adding O_NOFOLLOW to asm/fcntl.h and changing this macro to
reflect this, we get O_NOFOLLOW semantics for free (well, one
instruction, maybe two).




-cw

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:45    [from the cache]
©2003-2008