DragonFly bugs List (threaded) for 2008-02
DragonFly BSD
DragonFly bugs List (threaded) for 2008-02
[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]

Re: Coredumping design error


From: "Simon 'corecode' Schubert" <corecode@xxxxxxxxxxxx>
Date: Fri, 15 Feb 2008 21:03:31 +0100

Eduardo Tongson wrote:
>> su
> Password:
> syslog: Feb 16 09:40:56  su: user to root on /dev/ttyd0
> # ./coredumper
> Segmentation fault (core dumped)
> syslog: Feb 16 09:41:14  kernel: pid 728 (coredumper), uid 0: exited
> on signal 11 (core dumped)
> # md5 coredumper.core
> MD5 (coredumper.core) = 68e3e5fee874e688c795537721a6b511
> # ls -la coredumper.core
> -rw-------  1 user  user  1003520 Feb 16 09:41 coredumper.core
> #
> 
> I was not able to test the below patch. Trivial enough to fix if broken.
> 
> --- kern_sig.c	2008-02-14 13:41:12.000000000 +0800
> +++ kern_sig-20080216.c	2008-02-16 01:15:01.000000000 +0800
> @@ -2066,6 +2066,12 @@ coredump(struct lwp *lp, int sig)
>  		goto out1;
>  	}
> 
> +        /* Don't dump to files current user does not own */

Shouldn't we rather remove the file and recreate a new file (which then
will be owned by root)?

cheers
  simon

Attachment: signature.asc
Description: OpenPGP digital signature



[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]