From 230c18c02fe1ba4aa3b09545611c0ef7c5a56693 Mon Sep 17 00:00:00 2001 From: emaste Date: Thu, 5 Apr 2018 12:50:47 +0000 Subject: [PATCH] MFC r332034: linux_ioctl_hdio: fix kernel memory disclosure Stack-allocated struct linux_hd_big_geometry has undeclared padding copied to userland. admbugs: 765 Reported by: Vlad Tsyrklevich Security: Kernel memory disclosure Sponsored by: The FreeBSD Foundation git-svn-id: svn://svn.freebsd.org/base/stable/10@332063 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f --- sys/compat/linux/linux_ioctl.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/compat/linux/linux_ioctl.c b/sys/compat/linux/linux_ioctl.c index 9aed544f7..8941fab65 100644 --- a/sys/compat/linux/linux_ioctl.c +++ b/sys/compat/linux/linux_ioctl.c @@ -246,6 +246,7 @@ linux_ioctl_hdio(struct thread *td, struct linux_ioctl_args *args) } else if ((args->cmd & 0xffff) == LINUX_HDIO_GET_GEO_BIG) { struct linux_hd_big_geometry hdbg; + memset(&hdbg, 0, sizeof(hdbg)); hdbg.cylinders = fwcylinders; hdbg.heads = fwheads; hdbg.sectors = fwsectors; -- 2.45.0