From owner-svn-src-head@FreeBSD.ORG Thu Apr 12 15:10:14 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 37774106566B; Thu, 12 Apr 2012 15:10:14 +0000 (UTC) (envelope-from pluknet@gmail.com) Received: from mail-lb0-f182.google.com (mail-lb0-f182.google.com [209.85.217.182]) by mx1.freebsd.org (Postfix) with ESMTP id C39AB8FC16; Thu, 12 Apr 2012 15:10:12 +0000 (UTC) Received: by lbbgj3 with SMTP id gj3so2149898lbb.13 for ; Thu, 12 Apr 2012 08:10:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=noNGpKtSKe2oZETelh9Dap35voQJ813oOFkpFkC8MCo=; b=nT4kK/Ye/c+yxJnOJdmDziNlCRnr/9dKbeKUlkrv5NRfVuR569XtmwS5og4u+KMaG1 +jDZ5nm0SrVVoqoNuaUDpASBTdWl/jZJubK9uNbCkJNFjvLmcSPGKifRbWSglgh9n9+u J88MvPxyxDZW+cw/w6OXn+N43GYQpIQ8GV1RhSwly32AH+fHpLPxJXXPY3aKjvfXXI9Q O0aCDfQPkZy1HzkSvSE0vuBq0C2OJS8YQX3OB43fdrTOFbMIfWtevFmo6buMH43OZgmC EOpnjlTBfvDBzBwNt2HOinoFmXciSTlIBJpB5C4jKx9BgurXwC1Kx3OPs86dshxNnO68 uCmQ== MIME-Version: 1.0 Received: by 10.152.104.109 with SMTP id gd13mr2574645lab.9.1334243410321; Thu, 12 Apr 2012 08:10:10 -0700 (PDT) Sender: pluknet@gmail.com Received: by 10.152.25.69 with HTTP; Thu, 12 Apr 2012 08:10:10 -0700 (PDT) In-Reply-To: References: <201204121449.q3CEnP8L033082@svn.freebsd.org> Date: Thu, 12 Apr 2012 19:10:10 +0400 X-Google-Sender-Auth: GJ7_tIl3pIfWNIXhxz-42RZkoII Message-ID: From: Sergey Kandaurov To: John Baldwin Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r234186 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 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: Thu, 12 Apr 2012 15:10:14 -0000 On 12 April 2012 19:06, Sergey Kandaurov wrote: > On 12 April 2012 18:49, John Baldwin wrote: >> Author: jhb >> Date: Thu Apr 12 14:49:25 2012 >> New Revision: 234186 >> URL: http://svn.freebsd.org/changeset/base/234186 >> >> Log: >> =A0If a linker file contains at least one module, but all of the modules >> =A0fail to load (the MOD_LOAD event fails) during a kldload(2), unload t= he >> =A0linker file and fail the kldload(2) with ENOEXEC. >> >> =A0Reported by: =A0gcooper >> =A0MFC after: =A0 =A01 week >> >> Modified: >> =A0head/sys/kern/kern_linker.c >> >> Modified: head/sys/kern/kern_linker.c >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D >> --- head/sys/kern/kern_linker.c Thu Apr 12 14:06:05 2012 =A0 =A0 =A0 =A0= (r234185) >> +++ head/sys/kern/kern_linker.c Thu Apr 12 14:49:25 2012 =A0 =A0 =A0 =A0= (r234186) >> @@ -380,7 +380,7 @@ linker_load_file(const char *filename, l >> =A0{ >> =A0 =A0 =A0 =A0linker_class_t lc; >> =A0 =A0 =A0 =A0linker_file_t lf; >> - =A0 =A0 =A0 int foundfile, error; >> + =A0 =A0 =A0 int foundfile, error, modules; >> >> =A0 =A0 =A0 =A0/* Refuse to load modules if securelevel raised */ >> =A0 =A0 =A0 =A0if (prison0.pr_securelevel > 0) >> @@ -419,11 +419,22 @@ linker_load_file(const char *filename, l >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0linker_fi= le_unload(lf, LINKER_UNLOAD_FORCE); >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0return (e= rror); >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0} >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 modules =3D !TAILQ_EMPTY(&= lf->modules); >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0KLD_UNLOCK(); >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0linker_file_register_sysc= tls(lf); >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0linker_file_sysinit(lf); >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0KLD_LOCK(); >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0lf->flags |=3D LINKER_FIL= E_LINKED; >> + >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 /* >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0* If all of the modules= in this file failed >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0* to load, unload the f= ile and return an >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0* error of ENOEXEC. >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0*/ >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (modules && TAILQ_EMPTY= (&lf->modules)) { >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 linker_fil= e_unload(lf, LINKER_UNLOAD_FORCE); >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 return (EN= OEXEC); >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 } >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0*result =3D lf; >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0return (0); >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0} >> @@ -627,7 +638,7 @@ linker_file_unload(linker_file_t file, i >> >> =A0 =A0 =A0 =A0/* >> =A0 =A0 =A0 =A0 * Inform any modules associated with this file that they= are >> - =A0 =A0 =A0 =A0* being be unloaded. >> + =A0 =A0 =A0 =A0* being unloaded. >> =A0 =A0 =A0 =A0 */ >> =A0 =A0 =A0 =A0MOD_XLOCK; >> =A0 =A0 =A0 =A0for (mod =3D TAILQ_FIRST(&file->modules); mod; mod =3D ne= xt) { > > Thanks. I have had exactly this change in my local tree, > but I didn't commit it for some reasons I don't recall... Doh, I have had something different.. Sorry. --=20 wbr, pluknet