From owner-svn-src-all@freebsd.org Wed Jan 23 14:19:42 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1489F14A9792; Wed, 23 Jan 2019 14:19:42 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id ADA2C748E2; Wed, 23 Jan 2019 14:19:41 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 82FC919DD4; Wed, 23 Jan 2019 14:19:41 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0NEJfML000367; Wed, 23 Jan 2019 14:19:41 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0NEJexS000361; Wed, 23 Jan 2019 14:19:40 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201901231419.x0NEJexS000361@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 23 Jan 2019 14:19:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r343343 - in stable/12/sys: amd64/linux compat/linux X-SVN-Group: stable-12 X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: in stable/12/sys: amd64/linux compat/linux X-SVN-Commit-Revision: 343343 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: ADA2C748E2 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.93 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.94)[-0.937,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Jan 2019 14:19:42 -0000 Author: emaste Date: Wed Jan 23 14:19:40 2019 New Revision: 343343 URL: https://svnweb.freebsd.org/changeset/base/343343 Log: MFC linuxulator stack memory disclosure fixes r343260 linuxulator: fix stack memory disclosure in linux_ioctl_v4l r343261 linuxulator: fix stack memory disclosure in linux_ioctl_termio r343262 linuxulator: fix stack memory disclosure in linux_sigaltstack r343263 linuxulator: fix stack memory disclosure in linux_sigaltstack admbugs: 765 Reported by: Vlad Tsyrklevich Security: Kernel stack memory disclosure Sponsored by: The FreeBSD Foundation Modified: stable/12/sys/amd64/linux/linux_machdep.c stable/12/sys/compat/linux/linux_ioctl.c stable/12/sys/compat/linux/linux_misc.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/amd64/linux/linux_machdep.c ============================================================================== --- stable/12/sys/amd64/linux/linux_machdep.c Wed Jan 23 13:17:03 2019 (r343342) +++ stable/12/sys/amd64/linux/linux_machdep.c Wed Jan 23 14:19:40 2019 (r343343) @@ -201,6 +201,7 @@ linux_sigaltstack(struct thread *td, struct linux_siga l_stack_t lss; int error; + memset(&lss, 0, sizeof(lss)); LINUX_CTR2(sigaltstack, "%p, %p", uap->uss, uap->uoss); if (uap->uss != NULL) { Modified: stable/12/sys/compat/linux/linux_ioctl.c ============================================================================== --- stable/12/sys/compat/linux/linux_ioctl.c Wed Jan 23 13:17:03 2019 (r343342) +++ stable/12/sys/compat/linux/linux_ioctl.c Wed Jan 23 14:19:40 2019 (r343343) @@ -686,6 +686,7 @@ bsd_to_linux_termio(struct termios *bios, struct linux { struct linux_termios lios; + memset(lio, 0, sizeof(*lio)); bsd_to_linux_termios(bios, &lios); lio->c_iflag = lios.c_iflag; lio->c_oflag = lios.c_oflag; @@ -2843,6 +2844,8 @@ linux_to_bsd_v4l_window(struct l_video_window *lvw, st static int bsd_to_linux_v4l_window(struct video_window *vw, struct l_video_window *lvw) { + memset(lvw, 0, sizeof(*lvw)); + lvw->x = vw->x; lvw->y = vw->y; lvw->width = vw->width; Modified: stable/12/sys/compat/linux/linux_misc.c ============================================================================== --- stable/12/sys/compat/linux/linux_misc.c Wed Jan 23 13:17:03 2019 (r343342) +++ stable/12/sys/compat/linux/linux_misc.c Wed Jan 23 14:19:40 2019 (r343343) @@ -1089,9 +1089,8 @@ linux_waitid(struct thread *td, struct linux_waitid_ar } if (args->info != NULL) { p = td->td_proc; - if (td->td_retval[0] == 0) - bzero(&lsi, sizeof(lsi)); - else { + bzero(&lsi, sizeof(lsi)); + if (td->td_retval[0] != 0) { sig = bsd_to_linux_signal(siginfo.si_signo); siginfo_to_lsiginfo(&siginfo, &lsi, sig); }