From owner-svn-src-all@freebsd.org Thu Jun 14 23:10:12 2018 Return-Path: Delivered-To: svn-src-all@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 E9B9A10162C6; Thu, 14 Jun 2018 23:10:11 +0000 (UTC) (envelope-from cognet@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 9F9BE69A68; Thu, 14 Jun 2018 23:10:11 +0000 (UTC) (envelope-from cognet@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 78E74748C; Thu, 14 Jun 2018 23:10:11 +0000 (UTC) (envelope-from cognet@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5ENABEw074458; Thu, 14 Jun 2018 23:10:11 GMT (envelope-from cognet@FreeBSD.org) Received: (from cognet@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5ENABG6074457; Thu, 14 Jun 2018 23:10:11 GMT (envelope-from cognet@FreeBSD.org) Message-Id: <201806142310.w5ENABG6074457@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cognet set sender to cognet@FreeBSD.org using -f From: Olivier Houchard Date: Thu, 14 Jun 2018 23:10:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335182 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: cognet X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 335182 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jun 2018 23:10:12 -0000 Author: cognet Date: Thu Jun 14 23:10:10 2018 New Revision: 335182 URL: https://svnweb.freebsd.org/changeset/base/335182 Log: Use M_EXEC when calling malloc() to allocate the memory to store the module, as it'll contain executable code. Modified: head/sys/kern/link_elf.c Modified: head/sys/kern/link_elf.c ============================================================================== --- head/sys/kern/link_elf.c Thu Jun 14 22:31:30 2018 (r335181) +++ head/sys/kern/link_elf.c Thu Jun 14 23:10:10 2018 (r335182) @@ -945,7 +945,7 @@ link_elf_load_file(linker_class_t cls, const char* fil goto out; } #else - ef->address = malloc(mapsize, M_LINKER, M_WAITOK); + ef->address = malloc(mapsize, M_LINKER, M_EXEC | M_WAITOK); #endif mapbase = ef->address;