From owner-freebsd-hackers Tue Oct 28 03:24:07 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.7/8.8.7) id DAA15827 for hackers-outgoing; Tue, 28 Oct 1997 03:24:07 -0800 (PST) (envelope-from owner-freebsd-hackers) Received: from server.local.sunyit.edu (A-T34.rh.sunyit.edu [150.156.210.241]) by hub.freebsd.org (8.8.7/8.8.7) with ESMTP id DAA15821 for ; Tue, 28 Oct 1997 03:24:03 -0800 (PST) (envelope-from perlsta@cs.sunyit.edu) Received: from localhost (perlsta@localhost) by server.local.sunyit.edu (8.8.7/8.8.5) with SMTP id HAA02900; Tue, 28 Oct 1997 07:28:50 -0500 (EST) X-Authentication-Warning: server.local.sunyit.edu: perlsta owned process doing -bs Date: Tue, 28 Oct 1997 07:28:50 -0500 (EST) From: Alfred Perlstein X-Sender: perlsta@server.local.sunyit.edu To: Niall Smart cc: freebsd-hackers@FreeBSD.ORG Subject: Re: Loading code from userland In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-hackers@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk this seems like a bad idea, you would have arbitrary user code being executed at a privledged level, it's better to make seperate lkms for each method. you might be able to set something up alongs the lines that the kernel calls a procedure in your program to do something, however no rights should be given to the user code that could compromise the system. > Hi, > > I was wondering how I can load code from user-land into the kernel in > a manner similar to dlopen() and dlsym()? For example, if I had an > encrypted file system then I might want to allow the user to load their > own encryption module which defined a set of operations such as > initialise(), encrypt_block(), decrypt_block() etc. > > I think this can be achieved using lkm's - is this correct? I was > thinking that the module would call a function in the main body of the > encrypted file system code to pass it an array of entry points into > the module. > > Finally, can lkm's be compiled completely separately from the kernel or > are they specific to a particular kernel configuration? > > > Many thanks, > > > > Niall Smart >