From owner-svn-src-stable-10@freebsd.org Thu Sep 7 19:23:10 2017 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 99237E0A227; Thu, 7 Sep 2017 19:23:10 +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 mx1.freebsd.org (Postfix) with ESMTPS id B0EC27F3E3; Thu, 7 Sep 2017 19:23:09 +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 v87JN8T6001712; Thu, 7 Sep 2017 19:23:08 GMT (envelope-from gordon@FreeBSD.org) Received: (from gordon@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v87JN89l001711; Thu, 7 Sep 2017 19:23:08 GMT (envelope-from gordon@FreeBSD.org) Message-Id: <201709071923.v87JN89l001711@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gordon set sender to gordon@FreeBSD.org using -f From: Gordon Tetlow Date: Thu, 7 Sep 2017 19:23:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r323281 - in stable: 10/contrib/file/src 11/contrib/file/src X-SVN-Group: stable-10 X-SVN-Commit-Author: gordon X-SVN-Commit-Paths: in stable: 10/contrib/file/src 11/contrib/file/src X-SVN-Commit-Revision: 323281 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-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Sep 2017 19:23:10 -0000 Author: gordon Date: Thu Sep 7 19:23:08 2017 New Revision: 323281 URL: https://svnweb.freebsd.org/changeset/base/323281 Log: MFC r323278: Fix an incorrectly used conditional causing buffer overflow. Reported by: Thomas Jarosch of Intra2net AG Reviewed by: emaste, jhb Approved by: re (marius) Security: CVE-2017-1000249 Modified: stable/10/contrib/file/src/readelf.c Directory Properties: stable/10/ (props changed) Changes in other areas also in this revision: Modified: stable/11/contrib/file/src/readelf.c Directory Properties: stable/11/ (props changed) Modified: stable/10/contrib/file/src/readelf.c ============================================================================== --- stable/10/contrib/file/src/readelf.c Thu Sep 7 19:15:31 2017 (r323280) +++ stable/10/contrib/file/src/readelf.c Thu Sep 7 19:23:08 2017 (r323281) @@ -509,7 +509,7 @@ do_bid_note(struct magic_set *ms, unsigned char *nbuf, size_t noff, size_t doff, int *flags) { if (namesz == 4 && strcmp((char *)&nbuf[noff], "GNU") == 0 && - type == NT_GNU_BUILD_ID && (descsz >= 4 || descsz <= 20)) { + type == NT_GNU_BUILD_ID && (descsz >= 4 && descsz <= 20)) { uint8_t desc[20]; const char *btype; uint32_t i;