From b5f3baa5a581eeaf63951f8669fbe77e2b9177d2 Mon Sep 17 00:00:00 2001 From: glebius Date: Tue, 31 May 2016 16:58:00 +0000 Subject: [PATCH] Merge r301053: Fix kernel stack disclosures in the Linux and 4.3BSD compat layers. Security: SA-16:20 Security: SA-16:21 git-svn-id: svn://svn.freebsd.org/base/stable/9@301055 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f --- sys/compat/linux/linux_ioctl.c | 2 ++ sys/compat/linux/linux_misc.c | 1 + sys/kern/vfs_syscalls.c | 1 + 3 files changed, 4 insertions(+) diff --git a/sys/compat/linux/linux_ioctl.c b/sys/compat/linux/linux_ioctl.c index 31f029040..ada7927e0 100644 --- a/sys/compat/linux/linux_ioctl.c +++ b/sys/compat/linux/linux_ioctl.c @@ -911,6 +911,8 @@ linux_ioctl_termio(struct thread *td, struct linux_ioctl_args *args) case LINUX_TIOCGSERIAL: { struct linux_serial_struct lss; + + bzero(&lss, sizeof(lss)); lss.type = LINUX_PORT_16550A; lss.flags = 0; lss.close_delay = 0; diff --git a/sys/compat/linux/linux_misc.c b/sys/compat/linux/linux_misc.c index 857297a90..85c7c9302 100644 --- a/sys/compat/linux/linux_misc.c +++ b/sys/compat/linux/linux_misc.c @@ -138,6 +138,7 @@ linux_sysinfo(struct thread *td, struct linux_sysinfo_args *args) int i, j; struct timespec ts; + bzero(&sysinfo, sizeof(sysinfo)); getnanouptime(&ts); if (ts.tv_nsec != 0) ts.tv_sec++; diff --git a/sys/kern/vfs_syscalls.c b/sys/kern/vfs_syscalls.c index 8916d9bd4..d94654f72 100644 --- a/sys/kern/vfs_syscalls.c +++ b/sys/kern/vfs_syscalls.c @@ -2326,6 +2326,7 @@ cvtstat(st, ost) struct ostat *ost; { + bzero(ost, sizeof(*ost)); ost->st_dev = st->st_dev; ost->st_ino = st->st_ino; ost->st_mode = st->st_mode; -- 2.45.0