svn commit: r338981 - in releng: 10.4/sys/kern 11.1/sys/kern 11.2/sys/kern
Gordon Tetlow
gordon at FreeBSD.org
Thu Sep 27 18:36:32 UTC 2018
Author: gordon
Date: Thu Sep 27 18:36:30 2018
New Revision: 338981
URL: https://svnweb.freebsd.org/changeset/base/338981
Log:
Fix small kernel memory disclosures. [EN-18:12.mem]
Reported by: Thomas Barabosch, Fraunhofer FKIE
Approved by: so
Security: FreeBSD-EN-18:12.mem
Security: CVE-2018-17155
Modified:
releng/10.4/sys/kern/kern_context.c
releng/11.1/sys/kern/kern_context.c
releng/11.2/sys/kern/kern_context.c
Modified: releng/10.4/sys/kern/kern_context.c
==============================================================================
--- releng/10.4/sys/kern/kern_context.c Thu Sep 27 18:34:42 2018 (r338980)
+++ releng/10.4/sys/kern/kern_context.c Thu Sep 27 18:36:30 2018 (r338981)
@@ -68,6 +68,7 @@ sys_getcontext(struct thread *td, struct getcontext_ar
if (uap->ucp == NULL)
ret = EINVAL;
else {
+ bzero(&uc, sizeof(ucontext_t));
get_mcontext(td, &uc.uc_mcontext, GET_MC_CLEAR_RET);
PROC_LOCK(td->td_proc);
uc.uc_sigmask = td->td_sigmask;
@@ -108,6 +109,7 @@ sys_swapcontext(struct thread *td, struct swapcontext_
if (uap->oucp == NULL || uap->ucp == NULL)
ret = EINVAL;
else {
+ bzero(&uc, sizeof(ucontext_t));
get_mcontext(td, &uc.uc_mcontext, GET_MC_CLEAR_RET);
bzero(uc.__spare__, sizeof(uc.__spare__));
PROC_LOCK(td->td_proc);
Modified: releng/11.1/sys/kern/kern_context.c
==============================================================================
--- releng/11.1/sys/kern/kern_context.c Thu Sep 27 18:34:42 2018 (r338980)
+++ releng/11.1/sys/kern/kern_context.c Thu Sep 27 18:36:30 2018 (r338981)
@@ -68,6 +68,7 @@ sys_getcontext(struct thread *td, struct getcontext_ar
if (uap->ucp == NULL)
ret = EINVAL;
else {
+ bzero(&uc, sizeof(ucontext_t));
get_mcontext(td, &uc.uc_mcontext, GET_MC_CLEAR_RET);
PROC_LOCK(td->td_proc);
uc.uc_sigmask = td->td_sigmask;
@@ -108,6 +109,7 @@ sys_swapcontext(struct thread *td, struct swapcontext_
if (uap->oucp == NULL || uap->ucp == NULL)
ret = EINVAL;
else {
+ bzero(&uc, sizeof(ucontext_t));
get_mcontext(td, &uc.uc_mcontext, GET_MC_CLEAR_RET);
bzero(uc.__spare__, sizeof(uc.__spare__));
PROC_LOCK(td->td_proc);
Modified: releng/11.2/sys/kern/kern_context.c
==============================================================================
--- releng/11.2/sys/kern/kern_context.c Thu Sep 27 18:34:42 2018 (r338980)
+++ releng/11.2/sys/kern/kern_context.c Thu Sep 27 18:36:30 2018 (r338981)
@@ -68,6 +68,7 @@ sys_getcontext(struct thread *td, struct getcontext_ar
if (uap->ucp == NULL)
ret = EINVAL;
else {
+ bzero(&uc, sizeof(ucontext_t));
get_mcontext(td, &uc.uc_mcontext, GET_MC_CLEAR_RET);
PROC_LOCK(td->td_proc);
uc.uc_sigmask = td->td_sigmask;
@@ -108,6 +109,7 @@ sys_swapcontext(struct thread *td, struct swapcontext_
if (uap->oucp == NULL || uap->ucp == NULL)
ret = EINVAL;
else {
+ bzero(&uc, sizeof(ucontext_t));
get_mcontext(td, &uc.uc_mcontext, GET_MC_CLEAR_RET);
bzero(uc.__spare__, sizeof(uc.__spare__));
PROC_LOCK(td->td_proc);
More information about the svn-src-releng
mailing list