From owner-svn-src-stable@freebsd.org Fri Nov 13 01:25:03 2015 Return-Path: Delivered-To: svn-src-stable@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 C80DAA2D1CA; Fri, 13 Nov 2015 01:25:03 +0000 (UTC) (envelope-from markj@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 9522B12A2; Fri, 13 Nov 2015 01:25:03 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tAD1P2Zh068036; Fri, 13 Nov 2015 01:25:02 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tAD1P2kH068035; Fri, 13 Nov 2015 01:25:02 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201511130125.tAD1P2kH068035@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Fri, 13 Nov 2015 01:25:02 +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: r290737 - stable/10/sys/kern X-SVN-Group: stable-10 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.20 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, 13 Nov 2015 01:25:03 -0000 Author: markj Date: Fri Nov 13 01:25:02 2015 New Revision: 290737 URL: https://svnweb.freebsd.org/changeset/base/290737 Log: MFC r290320: Have elf_lookup() return an error if the specified non-weak symbol could not be found. Otherwise, relocations against such symbols will be silently ignored instead of causing an error to be raised. Modified: stable/10/sys/kern/link_elf.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/kern/link_elf.c ============================================================================== --- stable/10/sys/kern/link_elf.c Fri Nov 13 01:03:59 2015 (r290736) +++ stable/10/sys/kern/link_elf.c Fri Nov 13 01:25:02 2015 (r290737) @@ -1544,6 +1544,10 @@ elf_lookup(linker_file_t lf, Elf_Size sy } addr = ((Elf_Addr)linker_file_lookup_symbol(lf, symbol, deps)); + if (addr == 0 && ELF_ST_BIND(sym->st_info) != STB_WEAK) { + *res = 0; + return (EINVAL); + } if (elf_set_find(&set_pcpu_list, addr, &start, &base)) addr = addr - start + base;