From owner-svn-src-head@FreeBSD.ORG Wed Dec 3 22:14:14 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 81C0BB3D; Wed, 3 Dec 2014 22:14:14 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 543CD640; Wed, 3 Dec 2014 22:14:14 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sB3MEEbt054573; Wed, 3 Dec 2014 22:14:14 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB3MEEWh054572; Wed, 3 Dec 2014 22:14:14 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201412032214.sB3MEEWh054572@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Wed, 3 Dec 2014 22:14:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275469 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Dec 2014 22:14:14 -0000 Author: imp Date: Wed Dec 3 22:14:13 2014 New Revision: 275469 URL: https://svnweb.freebsd.org/changeset/base/275469 Log: Const poison in a few places to ensure we don't modify things through the module data pointer. Modified: head/sys/kern/kern_linker.c Modified: head/sys/kern/kern_linker.c ============================================================================== --- head/sys/kern/kern_linker.c Wed Dec 3 21:55:44 2014 (r275468) +++ head/sys/kern/kern_linker.c Wed Dec 3 22:14:13 2014 (r275469) @@ -139,8 +139,8 @@ static caddr_t linker_file_lookup_symbol const char* name, int deps); static int linker_load_module(const char *kldname, const char *modname, struct linker_file *parent, - struct mod_depend *verinfo, struct linker_file **lfpp); -static modlist_t modlist_lookup2(const char *name, struct mod_depend *verinfo); + const struct mod_depend *verinfo, struct linker_file **lfpp); +static modlist_t modlist_lookup2(const char *name, const struct mod_depend *verinfo); static void linker_init(void *arg) @@ -1353,7 +1353,7 @@ modlist_lookup(const char *name, int ver } static modlist_t -modlist_lookup2(const char *name, struct mod_depend *verinfo) +modlist_lookup2(const char *name, const struct mod_depend *verinfo) { modlist_t mod, bestmod; int ver; @@ -1426,7 +1426,7 @@ linker_preload(void *arg) linker_file_list_t depended_files; struct mod_metadata *mp, *nmp; struct mod_metadata **start, **stop, **mdp, **nmdp; - struct mod_depend *verinfo; + const struct mod_depend *verinfo; int nver; int resolves; modlist_t mod; @@ -1716,7 +1716,7 @@ linker_lookup_file(const char *path, int */ static char * linker_hints_lookup(const char *path, int pathlen, const char *modname, - int modnamelen, struct mod_depend *verinfo) + int modnamelen, const struct mod_depend *verinfo) { struct thread *td = curthread; /* XXX */ struct ucred *cred = td ? td->td_ucred : NULL; @@ -1849,7 +1849,7 @@ bad: */ static char * linker_search_module(const char *modname, int modnamelen, - struct mod_depend *verinfo) + const struct mod_depend *verinfo) { char *cp, *ep, *result; @@ -1953,7 +1953,7 @@ linker_hwpmc_list_objects(void) */ static int linker_load_module(const char *kldname, const char *modname, - struct linker_file *parent, struct mod_depend *verinfo, + struct linker_file *parent, const struct mod_depend *verinfo, struct linker_file **lfpp) { linker_file_t lfdep; @@ -2027,7 +2027,7 @@ linker_load_dependencies(linker_file_t l linker_file_t lfdep; struct mod_metadata **start, **stop, **mdp, **nmdp; struct mod_metadata *mp, *nmp; - struct mod_depend *verinfo; + const struct mod_depend *verinfo; modlist_t mod; const char *modname, *nmodname; int ver, error = 0, count;