From owner-svn-src-stable-9@FreeBSD.ORG Sat Dec 31 15:08:34 2011 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5C34E1065672; Sat, 31 Dec 2011 15:08:34 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 458488FC15; Sat, 31 Dec 2011 15:08:34 +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 pBVF8YOV070045; Sat, 31 Dec 2011 15:08:34 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pBVF8Y4I070041; Sat, 31 Dec 2011 15:08:34 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201112311508.pBVF8Y4I070041@svn.freebsd.org> From: Nathan Whitehorn Date: Sat, 31 Dec 2011 15:08:34 +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: r229113 - in stable/9/libexec/rtld-elf: powerpc powerpc64 X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 31 Dec 2011 15:08:34 -0000 Author: nwhitehorn Date: Sat Dec 31 15:08:33 2011 New Revision: 229113 URL: http://svn.freebsd.org/changeset/base/229113 Log: MFC r228646: Additional icache paranoia: non-PLT relocations can modify the text segment. It is then important to make sure the icache is synchronized again to prevent (rare) random seg faults and illegal instructions. Modified: stable/9/libexec/rtld-elf/powerpc/reloc.c stable/9/libexec/rtld-elf/powerpc64/reloc.c Directory Properties: stable/9/libexec/rtld-elf/ (props changed) Modified: stable/9/libexec/rtld-elf/powerpc/reloc.c ============================================================================== --- stable/9/libexec/rtld-elf/powerpc/reloc.c Sat Dec 31 15:03:29 2011 (r229112) +++ stable/9/libexec/rtld-elf/powerpc/reloc.c Sat Dec 31 15:08:33 2011 (r229113) @@ -317,6 +317,10 @@ reloc_non_plt(Obj_Entry *obj, Obj_Entry done: if (cache != NULL) free(cache); + + /* Synchronize icache for text seg in case we made any changes */ + __syncicache(obj->mapbase, obj->textsize); + return (r); } Modified: stable/9/libexec/rtld-elf/powerpc64/reloc.c ============================================================================== --- stable/9/libexec/rtld-elf/powerpc64/reloc.c Sat Dec 31 15:03:29 2011 (r229112) +++ stable/9/libexec/rtld-elf/powerpc64/reloc.c Sat Dec 31 15:08:33 2011 (r229113) @@ -313,9 +313,12 @@ reloc_non_plt(Obj_Entry *obj, Obj_Entry } r = 0; done: - if (cache) { + if (cache) munmap(cache, bytes); - } + + /* Synchronize icache for text seg in case we made any changes */ + __syncicache(obj->mapbase, obj->textsize); + return (r); }