Re: Linux 2.1.125 doesn't dump core on SIGSEGV

Kev (klmitch@mit.edu)
Tue, 20 Oct 1998 15:37:41 EDT


> The current code will follow link though, so a hard or soft link to
> /etc/passwd somewhere where you might expect root to dump core is
> still very dangerous.
>
> I think this is probably best solved by stat'ing `core' before:
>
> dentry = open_namei(corefile, O_CREAT | 2 | O_TRUNC, 0600);
>
> is executed:
>
> - if the file is a link, coredumps should fail
>
> - if the file is a regular file, only one referrence to the inode
> is permissable
>
>
> Now, this means tricks like `ln -s /dev/null core' no longer work,
> but in this instance, it doesn't matter.
>
> Is there some ligitimate reasons why we might want to allow core to
> follow links of write to a file thats has multiple referrences?

hmmm...how sane would it be to only do these checks iff it is root that's
trying to do the core? I find it very useful for coredumps to follow the
symlink out of my AFS home directory (with a quota of 15M) to an
appropriate file in /tmp...

-- 
Kevin L. Mitchell <klmitch@mit.edu>
-------------------------  -. .---- --.. ..- -..-  --------------------------
http://web.mit.edu/klmitch/www/              (PGP5 keys availiable from here)
   DSS Key ID ED0DB34E: D9BF 0E74 FDCB 43F5 C597  878F 9455 EC24 ED0D B34E
   DH  Key ID 2A2C31D4: 1A77 4BA5 9E32 14AE 87DA  9FEC 7106 FC62 2A2C 31D4

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