Skip to content

Commit d869f4a

Browse files
committed
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
1 parent e106753 commit d869f4a

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

sys/kern/kern_context.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ sys_getcontext(struct thread *td, struct getcontext_args *uap)
6868
if (uap->ucp == NULL)
6969
ret = EINVAL;
7070
else {
71+
bzero(&uc, sizeof(ucontext_t));
7172
get_mcontext(td, &uc.uc_mcontext, GET_MC_CLEAR_RET);
7273
PROC_LOCK(td->td_proc);
7374
uc.uc_sigmask = td->td_sigmask;
@@ -108,6 +109,7 @@ sys_swapcontext(struct thread *td, struct swapcontext_args *uap)
108109
if (uap->oucp == NULL || uap->ucp == NULL)
109110
ret = EINVAL;
110111
else {
112+
bzero(&uc, sizeof(ucontext_t));
111113
get_mcontext(td, &uc.uc_mcontext, GET_MC_CLEAR_RET);
112114
bzero(uc.__spare__, sizeof(uc.__spare__));
113115
PROC_LOCK(td->td_proc);

0 commit comments

Comments
 (0)