Red Hat axp-list: Linux on Alpha (1995-2022)
 help / color / mirror / Atom feed
From: "Steven N. Hirsch" <shirsch@ibm.net>
To: Mikael Pettersson <Mikael.Pettersson@sophia.inria.fr>
Cc: adam@yggdrasil.com, shirsch@ibm.net, gaz@andrew.cmu.edu,
	axp-list@redhat.com
Subject: Re: daemon-less kmod & Alpha no-go!
Date: Tue, 21 Apr 1998 08:01:39 -0400 (EDT)	[thread overview]
Message-ID: <Pine.LNX.3.95.980421075503.2503E-100000@air.steve.net> (raw)
In-Reply-To: <199804210917.LAA00234@zephir.inria.fr>



On Tue, 21 Apr 1998, Mikael Pettersson wrote:

> On Mon, 20 Apr 1998, Steven H. Hirsch wrote:
> 
> > #!/bin/sh
> > echo logging_modprobe $* > /tmp/modprobe.log.$$
> > /usr/bin/strace /sbin/modprobe $* >> /tmp/modprobe.log.$$ 2>&1
> > 
> > as 'strace' writes to stderr.
> > ...
> > What is so different about the environment under a subshell?
> 
> Actually, this shell script does a user-space fork() + exec()
> to run strace. This would most likely mask any problems in
> the kernel thread we created for running the thing.
> For comparison, could you please also try running strace as follows:
> 
> #!/bin/sh
> echo logging_modprobe $* > /tmp/modprobe.log.$$
> exec /usr/bin/strace /sbin/modprobe $* >> /tmp/modprobe.log.$$ 2>&1
> 
> (I'm also worried that strace itself will fork/exec modprobe,
> but we can't do much about that, can we?)


Veerrry interesting.  This is all that ends up in the log file:

logging_modprobe -s -k char-major-9
execve("/sbin/modprobe", ["/sbin/modprobe", "-s", "-k", "char-major-9"], [/* 7 vars */]) = 0

The result suggests that execve() which is not preceeded by a fork fails
(?).  Could the kernel be getting confused; perhaps exiting from the
thread instead of running the target?


> Another interesting possibility would be to have the script
> just run insmod on some harmless module, e.g.
> 
> #!/bin/sh
> exec /sbin/insmod /lib/modules/2.1.97/misc/loop.o


It seems that anything which we try to 'exec' from the script fails.


> Also, you could try a simpler kmod without any of the safety
> features we put in, i.e. replace exec_modprobe() with:
> 

That was one of the first things I tried last weekend - no change.


Steve



       reply	other threads:[~1998-04-21 11:58 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <199804210917.LAA00234@zephir.inria.fr>
1998-04-21 12:01 ` Steven N. Hirsch [this message]
1998-04-21 19:41   ` daemon-less kmod & Alpha no-go! Richard Henderson
1998-04-22  0:53     ` Steven N. Hirsch
     [not found] <E0yRZ3z-000692-00@imladris.demon.co.uk>
1998-04-21 11:51 ` Steven N. Hirsch
1998-04-22  0:27   ` Steven N. Hirsch
     [not found] <Pine.SOL.3.95L.980420234851.24275A-100000@unix12.andrew.cmu.edu>
1998-04-21 11:17 ` Steven N. Hirsch
     [not found] <199804210131.SAA05828@adam.yggdrasil.com>
1998-04-21  2:48 ` Steven N. Hirsch
     [not found] <Pine.SOL.3.95L.980420092318.3161A-100000@unix12.andrew.cmu.edu>
1998-04-21  1:06 ` Steven N. Hirsch
1998-04-20  1:13 Steven N. Hirsch
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox