only dump core if user has read permission on the text
authorKirk McKusick <mckusick@ucbvax.Berkeley.EDU>
Thu, 23 May 1985 11:06:14 +0000 (03:06 -0800)
committerKirk McKusick <mckusick@ucbvax.Berkeley.EDU>
Thu, 23 May 1985 11:06:14 +0000 (03:06 -0800)
SCCS-vsn: sys/kern/kern_sig.c 6.16

usr/src/sys/kern/kern_sig.c

index 22c6715..20f9cbf 100644 (file)
@@ -1,4 +1,4 @@
-/*     kern_sig.c      6.15    85/05/22        */
+/*     kern_sig.c      6.16    85/05/22        */
 
 #include "../machine/reg.h"
 #include "../machine/pte.h"
 
 #include "../machine/reg.h"
 #include "../machine/pte.h"
@@ -760,6 +760,8 @@ core()
        if (ctob(UPAGES+u.u_dsize+u.u_ssize) >=
            u.u_rlimit[RLIMIT_CORE].rlim_cur)
                return (0);
        if (ctob(UPAGES+u.u_dsize+u.u_ssize) >=
            u.u_rlimit[RLIMIT_CORE].rlim_cur)
                return (0);
+       if (u.u_procp->p_textp && access(u.u_procp->p_textp->x_iptr, IREAD))
+               return (0);
        u.u_error = 0;
        ndp->ni_nameiop = CREATE | FOLLOW;
        ndp->ni_segflg = UIO_SYSSPACE;
        u.u_error = 0;
        ndp->ni_nameiop = CREATE | FOLLOW;
        ndp->ni_segflg = UIO_SYSSPACE;