From owner-freebsd-hackers@FreeBSD.ORG Mon Jul 19 07:23:58 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id A2B8216A4CE; Mon, 19 Jul 2004 07:23:58 +0000 (GMT) Received: from cell.sick.ru (cell.sick.ru [217.72.144.68]) by mx1.FreeBSD.org (Postfix) with ESMTP id CE98043D3F; Mon, 19 Jul 2004 07:23:57 +0000 (GMT) (envelope-from glebius@freebsd.org) Received: from cell.sick.ru (glebius@localhost [127.0.0.1]) by cell.sick.ru (8.12.11/8.12.8) with ESMTP id i6J7NpSX045781 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 19 Jul 2004 11:23:52 +0400 (MSD) (envelope-from glebius@freebsd.org) Received: (from glebius@localhost) by cell.sick.ru (8.12.11/8.12.11/Submit) id i6J7NptH045780; Mon, 19 Jul 2004 11:23:51 +0400 (MSD) (envelope-from glebius@freebsd.org) X-Authentication-Warning: cell.sick.ru: glebius set sender to glebius@freebsd.org using -f Date: Mon, 19 Jul 2004 11:23:51 +0400 From: Gleb Smirnoff To: Julian Elischer Message-ID: <20040719072351.GC45598@cell.sick.ru> References: <40FB533D.2080208@elischer.org> Mime-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline In-Reply-To: <40FB533D.2080208@elischer.org> User-Agent: Mutt/1.5.6i cc: hackers@freebsd.org cc: Robert Watson Subject: Re: linker_load_module(NULL, "modname", ...) from thread with no user process X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Jul 2004 07:23:58 -0000 On Sun, Jul 18, 2004 at 09:51:09PM -0700, Julian Elischer wrote: J> >> there is problem when linker_load_module() is called from a kernel J> >>thread with no associated user process, and it asks to load module by J> >>name, not by filename. With such parameters it requires looking through J> >>device.hints file. And vn_open() assumes that J> >>ndp->ni_cnd->cn_thread->td_proc is valid. J> >> J> >>Any ideas how to solve this? J> >> J> >> J> > J> >Generally speaking, attempting to perform file I/O from an interrupt J> >thread or software interrupt is a really bad idea. There are a number of J> >reasons this is the case, not least that lookups and file operations occur J> >in the context of a process with a root directory, current working J> >directory, etc, and that a network swi or ithread doesn't have said J> >context (and may execute before that's available). Also, stalling the J> >netisr or an ithread on disk I/O seems to be a bad idea as well, not to J> >mention the NFS root file system case. So the question would seem to be J> >"Can we avoid it entirely?". I'm not quite sure what the answer here is, J> >but most similar cases I know of involve an asynchronous upcall message to J> >user space to load the module, or it being pushed from user space to J> >kernel without an upcall. Vis., devd loading a module in response to a J> >device event, etc. Adopting something more like that would help to avoid J> >this situation. I've seen similar reports a couple of times in the past, J> >and each time it worries me :-). J> > J> > J> Probably the onl thing to do is to refuse to try an load the modules if J> you are not running J> in the context of a process.. J> the question is: J> J> "What were you doing when this happenned?" Run mpd as PPPoE server. Ensure that ng_tee is not loaded, yet. Connect to this server. I have hit this panic with ngctl also, but can't remember hot to reproduce it. What is the correct way to determine whether we are in interrupt thread or not? -- Totus tuus, Glebius. GLEBIUS-RIPN GLEB-RIPE