Skip to contentSkip to conversation

coredump - as root not only if euid switched

PATCH Peter Waechtler 1 participant 1 message Apr 23, 2004

lore
Share & tools
lore
#0 lore raw
Quoted 11 lines · Chris Wright
Quoted 10 lines · * Peter W�chtler ([email protected]) wrote:

Am Do, 2004-04-22 um 11.56 schrieb Andrew Morton:

Quoted 9 lines
Quoted 7 lines · Peter Waechtler
Quoted 3 lines

(why are you trying to unlink the old file anyway?)

For security measure :O
I tried on solaris: touch the core file as user, open it and wait, dump core as root -> nope, couldn't read the damn core - it was unlinked and created!

Quoted 7 lines
Quoted 4 lines
Quoted 2 lines

hm, OK. There's a window in which someone can come in and recreate the file, but the open is using O_EXCL|O_CREATE so that seems safe enough.

So here is the updated patch with an open coded call to sys_unlink

This patch breaks various ptrace() checks.

I guess the mm->dumpable flag was misused then as something like mm->switchUid. I can add this flag and make the ptrace paths use that.