From d7cb1c47daf3962af8df474e6b98f2c90685cd1a Mon Sep 17 00:00:00 2001 From: Eitan Adler Date: Wed, 7 Mar 2018 14:44:32 +0000 Subject: [PATCH] sys: Fix a few potential infoleaks in cloudabi While there is no immediate leak, if the structure changes underneath us, there might be in the future. Submitted by: Domagoj Stolfa MFC After: 1 month Sponsored by: DARPA/AFRL --- sys/i386/ibcs2/ibcs2_ipc.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sys/i386/ibcs2/ibcs2_ipc.c b/sys/i386/ibcs2/ibcs2_ipc.c index f17719f21f0..aa588dae6d8 100644 --- a/sys/i386/ibcs2/ibcs2_ipc.c +++ b/sys/i386/ibcs2/ibcs2_ipc.c @@ -135,6 +135,8 @@ ibcs2_msgctl(struct thread *td, void *v) struct msqid_ds bs; int error; + memset(&is, 0, sizeof(is)); + switch (uap->cmd) { case IBCS2_IPC_STAT: error = kern_msgctl(td, uap->msqid, IPC_STAT, &bs); @@ -318,6 +320,8 @@ ibcs2_semctl(struct thread *td, void *v) register_t rval; int error; + memset(&is, 0, sizeof(is)); + switch(uap->cmd) { case IBCS2_IPC_STAT: semun.buf = &bs;