From owner-svn-src-stable@freebsd.org Thu Sep 27 18:54:42 2018 Return-Path: Delivered-To: svn-src-stable@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 B447510B5E91; Thu, 27 Sep 2018 18:54:42 +0000 (UTC) (envelope-from gordon@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6A86F71DAD; Thu, 27 Sep 2018 18:54:42 +0000 (UTC) (envelope-from gordon@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 6106B20D1; Thu, 27 Sep 2018 18:54:42 +0000 (UTC) (envelope-from gordon@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w8RIsglV084574; Thu, 27 Sep 2018 18:54:42 GMT (envelope-from gordon@FreeBSD.org) Received: (from gordon@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w8RIsgQG084573; Thu, 27 Sep 2018 18:54:42 GMT (envelope-from gordon@FreeBSD.org) Message-Id: <201809271854.w8RIsgQG084573@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gordon set sender to gordon@FreeBSD.org using -f From: Gordon Tetlow Date: Thu, 27 Sep 2018 18:54:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r338987 - stable/11/sys/kern X-SVN-Group: stable-11 X-SVN-Commit-Author: gordon X-SVN-Commit-Paths: stable/11/sys/kern X-SVN-Commit-Revision: 338987 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Sep 2018 18:54:42 -0000 Author: gordon Date: Thu Sep 27 18:54:41 2018 New Revision: 338987 URL: https://svnweb.freebsd.org/changeset/base/338987 Log: Check to ensure the buffer returned is not NULL. Direct commit to the branch as this behavior is only seeing in stable/11. Reported by: Thomas Barabosch, Fraunhofer FKIE Reviewed by: wes@ Approved by: so Security: FreeBSD-EN-18:10.syscall Security: CVE-2018-17154 Modified: stable/11/sys/kern/vfs_syscalls.c Modified: stable/11/sys/kern/vfs_syscalls.c ============================================================================== --- stable/11/sys/kern/vfs_syscalls.c Thu Sep 27 18:50:10 2018 (r338986) +++ stable/11/sys/kern/vfs_syscalls.c Thu Sep 27 18:54:41 2018 (r338987) @@ -601,6 +601,8 @@ freebsd4_getfsstat(struct thread *td, struct freebsd4_ size = count * sizeof(struct statfs); error = kern_getfsstat(td, &buf, size, &count, UIO_SYSSPACE, uap->mode); + if (buf == NULL) + return (EINVAL); td->td_retval[0] = count; if (size != 0) { sp = buf;