Am Montag, 5. April 2004 10:27 schrieb Peter Waechtler: > With the current behavior typical server programs that switch euid > don't dump core. This is done "for security". > If the core file pattern exists the dump is written to but readable > for the file owner (not necessarily root - don't argue: only chdir into > dirs that only root can write to: think of file servers like samba) > > The patch below addresses this (but still not perfect). > What I would like to see: instead of mm->dumpable=0 when calling seteuid() > something like mm->dumpAs=root and making sure that the core is owned by > root mode 600 > > I could install a sighandler that calls prctl(PR_SET_DUMPABLE,1,0,0,0), > switch euid to root, but still the formerly placed core is owned by evil > user :( > Then I could read the core pattern and unlink such a file - and all this > just for the Linux platform... > Unlink a previously existing core. I tried on solaris - I find the behavior (tunable with coreadm) perfect: Switched uid? -> create as root (unlink a previously and potentially opened core first: yes it got a new inode) then creat(O_EXCL,0600)