From ef5c96e91ae55745e6759bdc7a0ef99c5ef11475 Mon Sep 17 00:00:00 2001 From: Young Xiao <92siuyang@gmail.com> Date: Thu, 16 May 2019 20:09:23 +0800 Subject: [PATCH] Prevent kernel stack disclosure in swapcontext. This is the vulnerability that is same with CVE-2018-17155. Signed-off-by: Young Xiao <92siuyang@gmail.com> --- sys/arm64/arm64/freebsd32_machdep.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/arm64/arm64/freebsd32_machdep.c b/sys/arm64/arm64/freebsd32_machdep.c index a6719b6..aeac460 100644 --- a/sys/arm64/arm64/freebsd32_machdep.c +++ b/sys/arm64/arm64/freebsd32_machdep.c @@ -284,6 +284,7 @@ freebsd32_swapcontext(struct thread *td, struct freebsd32_swapcontext_args *uap) if (uap->oucp == NULL || uap->ucp == NULL) ret = EINVAL; else { + bzero(&uc, sizeof(uc)); get_mcontext32(td, &uc.uc_mcontext, GET_MC_CLEAR_RET); PROC_LOCK(td->td_proc); uc.uc_sigmask = td->td_sigmask; -- 2.7.4