1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-29 12:03:03 +00:00

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
This commit is contained in:
Konstantin Belousov 2019-09-07 16:03:26 +00:00
parent 0e79619e1e
commit 1073d17eeb
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=352015

View File

@ -733,7 +733,7 @@ __elfN(load_file)(struct proc *p, const char *file, u_long *addr,
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_long *addr,
*/
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);