Re: Linux 2.1.125 doesn't dump core on SIGSEGV

David Woodhouse (David.Woodhouse@mvhi.com)
Tue, 20 Oct 1998 14:38:55 +0100


> > > I think this is probably best solved by stat'ing `core' before:
> > >
> > > dentry = open_namei(corefile, O_CREAT | 2 | O_TRUNC, 0600);
> > > ...
> >
> > Why not unlinking (removing) core before just like any suid root userspace
> > program should do before writing anything?
>
> There is an implicit race in doing this. Also suid programs dont dump core.
> Just 'real' root stuff. The results are as bad however
>

How about providing a new flag to open(2) which tells it not to follow links?
Then the above can become race free:

dentry = open_namei(corefile, O_CREAT | 2 | O_TRUNC | O_NLINK, 0600);

---- ---- ----
David Woodhouse David.Woodhouse@mvhi.com Office: (+44) 1223 810302
Project Leader, Process Information Systems Mobile: (+44) 976 658355
Axiom (Cambridge) Ltd., Swaffham Bulbeck, Cambridge, CB5 0NA, UK.
finger dwmw2@ferret.lmh.ox.ac.uk for PGP key.

-
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/