From 026227b6ae041bb147d5021f91cff0144b4714fb Mon Sep 17 00:00:00 2001 From: Eitan Adler Date: Sat, 3 Mar 2018 21:50:55 +0000 Subject: [PATCH] sys/linux: Fix a few potential infoleaks in cloudabi Submitted by: Domagoj Stolfa MFC After: 1 month Sponsored by: DARPA/AFRL --- sys/compat/cloudabi/cloudabi_file.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sys/compat/cloudabi/cloudabi_file.c b/sys/compat/cloudabi/cloudabi_file.c index 6133ddd6ae54..5811c0bbb314 100644 --- a/sys/compat/cloudabi/cloudabi_file.c +++ b/sys/compat/cloudabi/cloudabi_file.c @@ -563,6 +563,8 @@ cloudabi_sys_file_stat_fget(struct thread *td, cloudabi_filetype_t filetype; int error; + memset(&csb, 0, sizeof(csb)); + /* Fetch file descriptor attributes. */ error = fget(td, uap->fd, cap_rights_init(&rights, CAP_FSTAT), &fp); if (error != 0) @@ -650,6 +652,8 @@ cloudabi_sys_file_stat_get(struct thread *td, char *path; int error; + memset(&csb, 0, sizeof(csb)); + error = copyin_path(uap->path, uap->path_len, &path); if (error != 0) return (error);