From d851b216eb6879bbd34d7ddbab6ad53602fe61ec Mon Sep 17 00:00:00 2001 From: Ed Maste Date: Wed, 4 Apr 2018 14:41:48 +0000 Subject: [PATCH] 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 MFC after: 1 day Security: Kernel memory disclosure Sponsored by: The FreeBSD Foundation --- 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 9c417fad79a..880aff267c4 100644 --- a/sys/compat/linux/linux_ioctl.c +++ b/sys/compat/linux/linux_ioctl.c @@ -253,6 +253,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;