Author: kib
Date: Sat Sep  7 16:03:26 2019
New Revision: 352015
URL: https://svnweb.freebsd.org/changeset/base/352015

Log:
  When loading ELF interpreter, initialize whole nested image_params with zero.
  
  Otherwise we could mishandle imgp->textset.
  
  Reviewed by:  markj
  MFC after:    1 week
  Differential revision:        https://reviews.freebsd.org/D21560

Modified:
  head/sys/kern/imgact_elf.c

Modified: head/sys/kern/imgact_elf.c
==============================================================================
--- head/sys/kern/imgact_elf.c  Sat Sep  7 16:01:45 2019        (r352014)
+++ head/sys/kern/imgact_elf.c  Sat Sep  7 16:03:26 2019        (r352015)
@@ -733,7 +733,7 @@ __elfN(load_file)(struct proc *p, const char *file, u_
                return (ECAPMODE);
 #endif
 
-       tempdata = malloc(sizeof(*tempdata), M_TEMP, M_WAITOK);
+       tempdata = malloc(sizeof(*tempdata), M_TEMP, M_WAITOK | M_ZERO);
        nd = &tempdata->nd;
        attr = &tempdata->attr;
        imgp = &tempdata->image_params;
@@ -743,10 +743,6 @@ __elfN(load_file)(struct proc *p, const char *file, u_
         */
        imgp->proc = p;
        imgp->attr = attr;
-       imgp->firstpage = NULL;
-       imgp->image_header = NULL;
-       imgp->object = NULL;
-       imgp->execlabel = NULL;
 
        NDINIT(nd, LOOKUP, ISOPEN | FOLLOW | LOCKSHARED | LOCKLEAF,
            UIO_SYSSPACE, file, curthread);
_______________________________________________
[email protected] mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "[email protected]"

Reply via email to