[lkml]   [1998]   [Oct]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: Linux 2.1.125 doesn't dump core on SIGSEGV
On Tue, Oct 20, 1998 at 10:55:27PM +0100, David Woodhouse wrote:

> In the coredump case, I'm not sure - but in general it's because
> there's a race condition. Someone can put the 'evil' symlink in
> place between the stat() and the open().

No, indeed you are correct - there is a race. Doh! Need more coffee.

> Even in the coredump case there's a race, but presumably there's a
> lock somewhere that we can use to make it seem atomic.

How does this look (still a race, but much harder to exploit):

if(fd = (open("core",O_CREAT | O_EXCL)) == -1)
goto end_dump;


/* compare stat results - don't sump if bad */



We _really_ do need O_NOFOLLOW semantics. Anyone looked at how hard
this would be to implement?

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
Please read the FAQ at

 \ /
  Last update: 2005-03-22 13:45    [W:0.076 / U:3.592 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site