From owner-svn-src-stable@FreeBSD.ORG Fri Sep 7 18:03:29 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id E7EB0106564A; Fri, 7 Sep 2012 18:03:29 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D1F198FC08; Fri, 7 Sep 2012 18:03:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q87I3TBl040768; Fri, 7 Sep 2012 18:03:29 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q87I3TJ8040766; Fri, 7 Sep 2012 18:03:29 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201209071803.q87I3TJ8040766@svn.freebsd.org> From: Dimitry Andric Date: Fri, 7 Sep 2012 18:03:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240208 - in stable: 7/contrib/binutils/binutils 8/contrib/binutils/binutils 9/contrib/binutils/binutils X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 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: Fri, 07 Sep 2012 18:03:30 -0000 Author: dim Date: Fri Sep 7 18:03:29 2012 New Revision: 240208 URL: http://svn.freebsd.org/changeset/base/240208 Log: MFC r239962: Fix a twelve year old bug in readelf: when process_dynamic_segment() encounters a DT_RUNPATH entry, the global dynamic_info[] array is overrun, causing some other global variable to be overwritten. In my testcase, this was the section_headers variable, leading to segfaults or jemalloc assertions when it was freed later on. Thanks to Koop Mast for providing samples of a few "bad" .so files. Modified: stable/9/contrib/binutils/binutils/readelf.c Directory Properties: stable/9/contrib/binutils/ (props changed) Changes in other areas also in this revision: Modified: stable/7/contrib/binutils/binutils/readelf.c stable/8/contrib/binutils/binutils/readelf.c Directory Properties: stable/7/contrib/binutils/ (props changed) stable/8/contrib/binutils/ (props changed) Modified: stable/9/contrib/binutils/binutils/readelf.c ============================================================================== --- stable/9/contrib/binutils/binutils/readelf.c Fri Sep 7 17:58:36 2012 (r240207) +++ stable/9/contrib/binutils/binutils/readelf.c Fri Sep 7 18:03:29 2012 (r240208) @@ -174,7 +174,7 @@ static Elf_Internal_Syminfo *dynamic_sym static unsigned long dynamic_syminfo_offset; static unsigned int dynamic_syminfo_nent; static char program_interpreter[PATH_MAX]; -static bfd_vma dynamic_info[DT_JMPREL + 1]; +static bfd_vma dynamic_info[DT_ENCODING]; static bfd_vma dynamic_info_DT_GNU_HASH; static bfd_vma version_info[16]; static Elf_Internal_Ehdr elf_header;