Date: Sat, 16 Feb 2008 14:20:02 GMT From: Antoine Brodin <antoine@FreeBSD.org> To: freebsd-bugs@FreeBSD.org Subject: Re: kern/68905: core dumps are assigned wrong ownership Message-ID: <200802161420.m1GEK2fv014192@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
The following reply was made to PR kern/68905; it has been noted by GNATS. From: Antoine Brodin <antoine@FreeBSD.org> To: bug-followup@FreeBSD.org, trew@hick.org Cc: Subject: Re: kern/68905: core dumps are assigned wrong ownership Date: Sat, 16 Feb 2008 14:44:19 +0100 This is a multi-part message in MIME format. --Multipart=_Sat__16_Feb_2008_14_44_19_+0100_qDxOlQLAvZKL=+NR Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Here is a patch, not much tested and obtained from OpenBSD. --Multipart=_Sat__16_Feb_2008_14_44_19_+0100_qDxOlQLAvZKL=+NR Content-Type: text/x-diff; name="kern-sig.diff" Content-Disposition: attachment; filename="kern-sig.diff" Content-Transfer-Encoding: 7bit Index: kern_sig.c =================================================================== RCS file: /home/ncvs/src/sys/kern/kern_sig.c,v retrieving revision 1.355 diff -u -p -r1.355 kern_sig.c --- kern_sig.c 13 Jan 2008 14:44:09 -0000 1.355 +++ kern_sig.c 14 Jan 2008 13:32:06 -0000 @@ -3110,9 +3110,14 @@ restart: NDFREE(&nd, NDF_ONLY_PNBUF); vp = nd.ni_vp; - /* Don't dump to non-regular files or files with links. */ + /* + * Don't dump to non-regular files, files with links or files + * owned by someone else. + */ if (vp->v_type != VREG || - VOP_GETATTR(vp, &vattr, cred, td) || vattr.va_nlink != 1) { + VOP_GETATTR(vp, &vattr, cred, td) || vattr.va_nlink != 1 || + vattr.va_mode & (S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH) || + vattr.va_uid != cred->cr_uid) { VOP_UNLOCK(vp, 0); error = EFAULT; goto close; --Multipart=_Sat__16_Feb_2008_14_44_19_+0100_qDxOlQLAvZKL=+NR--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200802161420.m1GEK2fv014192>