arm: Zero padding in mcontext_vfp_t in get_vfpcontext().

This can leak kernel stack data otherwise.

Reviewed by:	imp, markj
Sponsored by:	The University of Cambridge, Google, Inc.
Differential Revision:	https://reviews.freebsd.org/D34594
This commit is contained in:
John Baldwin 2022-03-25 09:57:20 -07:00
parent 220c48e2d9
commit b234b8d911

View File

@ -107,6 +107,7 @@ get_vfpcontext(struct thread *td, mcontext_vfp_t *vfp)
critical_exit();
} else
MPASS(TD_IS_SUSPENDED(td));
memset(vfp, 0, sizeof(*vfp));
memcpy(vfp->mcv_reg, pcb->pcb_vfpstate.reg,
sizeof(vfp->mcv_reg));
vfp->mcv_fpscr = pcb->pcb_vfpstate.fpscr;