Red Hat axp-list: Linux on Alpha (1995-2022)
 help / color / mirror / Atom feed
From: "Steven N. Hirsch" <shirsch@ibm.net>
To: "Adam J. Richter" <adam@yggdrasil.com>
Cc: gaz@andrew.cmu.edu, shirsch@ibm.net, axp-list@redhat.com,
	linux-kernel@vger.rutgers.edu, Mikael.Pettersson@sophia.inria.fr
Subject: Re: daemon-less kmod & Alpha no-go!
Date: Mon, 20 Apr 1998 22:48:21 -0400 (EDT)	[thread overview]
Message-ID: <Pine.LNX.3.95.980420224137.2315A-200000@air.steve.net> (raw)
In-Reply-To: <199804210131.SAA05828@adam.yggdrasil.com>

[-- Attachment #1: Type: TEXT/PLAIN, Size: 1100 bytes --]



On Mon, 20 Apr 1998, Adam J. Richter wrote:

> How about trying the following:

(snip)

Actually, needs to be:

#!/bin/sh
echo logging_modprobe $* > /tmp/modprobe.log.$$
/usr/bin/strace /sbin/modprobe $* >> /tmp/modprobe.log.$$ 2>&1

as 'strace' writes to stderr.

Interestingly enough, it starts working when run indirectly <g>.  The
trace is attached for loading of the SCSI tape driver.

> You might also try modifying that shell script to echo something
> to standard output, so that you can verify that modprobe has gotten
> init's file descriptors.

I did this.  Nothing makes it to the screen or logs.

The success of modprobe under the shell script started me thinking.  I
renamed /sbin/modprobe to /sbin/modprobe.real and created a stub
/sbin/modprobe like this:

#!/bin/sh
shift
/sbin/modprobe.real $*


Lo and behold, this does the trick.  Sort of bizarre (and possibly a
security hole?), but functional.  The question of the hour is:

What is so different about the environment under a subshell?

Perhaps those more knowledgeable can glean some clues from the strace
output.

Steve





[-- Attachment #2: Type: TEXT/PLAIN, Size: 5355 bytes --]

logging_modprobe -s -k char-major-9
execve("/sbin/modprobe", ["/sbin/modprobe", "-s", "-k", "char-major-9"], [/* 8 vars */]) = 0
brk(0)                                  = 0x12010857c
open("/etc/ld.so.preload", O_RDONLY)    = -1 ENOENT (No such file or directory)
open("/etc/ld.so.cache", O_RDONLY)      = 0
fstat(0, {st_mode=01, st_size=893125961, ...}) = 0
mmap(0, 4831835984, PROT_READ, 0 /* MAP_??? */, 0, 0) = 0x20000010000
close(0)                                = 0
open("/lib/libc.so.6.1", O_RDONLY)      = 0
mmap(0, 0, PROT_NONE, 0 /* MAP_??? */, 0, 0) = 0x20000012000
mmap(0, 0, PROT_NONE, 0 /* MAP_??? */, 0, 0) = 0x20000014000
munmap(0x20000012000, 8192)             = 0
mmap(0, 8192, PROT_NONE, 0 /* MAP_??? */, 0, 0) = 0x20000110000
mprotect(0x200001dc000, 1154856, PROT_NONE) = 0
mmap(0x200002d0000, 1154856, PROT_NONE, 0 /* MAP_??? */, 0, 0) = 0x200002d0000
mmap(0x200002ec000, 1154856, PROT_NONE, 0 /* MAP_??? */, 0, 0) = 0x200002ec000
close(0)                                = 0
personality(0 /* PER_??? */)            = 0
osf_getsysinfo(0x2d, 0x11ffffd90, 0x11ffffe10, 0, 0x300000000) = 0
osf_setsysinfo(0xe, 0x11ffffd90, 0x11ffffe10, 0, 0x300000000) = 0
getxpid()                               = 547
brk(0)                                  = 0x12010857c
brk(0x1201085bc)                        = 0x1201085bc
brk(0x12010a000)                        = 0x12010a000
uname({sys="Linux", node="alpha.fast.net", ...}) = 0
access("/etc/modules.conf", R_OK)       = 0
stat("/etc/modules.conf", {st_mode=01, st_size=893125769, ...}) = 0
open("/etc/modules.conf", O_RDONLY)     = 0
fstat(0, {st_mode=01, st_size=893125769, ...}) = 0
mmap(0, 4831828304, PROT_WRITE|PROT_EXEC|0x1b0, 0 /* MAP_??? */, 12884901888, 0) = 0x20000012000
read(0, "alias eth0 tulip\nalias eth1 tul"..., 8192) = 117
read(0, "", 8192)                       = 0
close(0)                                = 0
munmap(0x20000012000, 8192)             = 0
uname({sys="Linux", node="alpha.fast.net", ...}) = 0
stat("/lib/modules/2.1.97/modules.dep", {st_mode=01, st_size=893125769, ...}) = 0
open("/lib/modules/2.1.97/modules.dep", O_RDONLY) = 0
fstat(0, {st_mode=01, st_size=893125769, ...}) = 0
mmap(0, 4831828720, PROT_WRITE|PROT_EXEC|0x1b0, 0 /* MAP_??? */, 12884901888, 0) = 0x20000012000
read(0, "/lib/modules/2.1.97/fs/binfmt_mi"..., 8192) = 680
read(0, "", 8192)                       = 0
close(0)                                = 0
munmap(0x20000012000, 8192)             = 0
SYS_347(0, 0, 0, 0, 0)                  = 0
open("/lib/modules/2.1.97/ipv6", O_RDONLY|O_NONBLOCK) = -1 ENOENT (No such file or directory)
open("/lib/modules/2.1.97/ipv4", O_RDONLY|O_NONBLOCK) = -1 ENOENT (No such file or directory)
open("/lib/modules/2.1.97/cdrom", O_RDONLY|O_NONBLOCK) = 0
fcntl(0, F_SETFD, FD_CLOEXEC)           = 0
fstat(0, {st_mode=02, st_size=893125769, ...}) = 0
brk(0x12010e000)                        = 0x12010e000
lseek(0, 0, SEEK_CUR)                   = 0
getdents(0, /* 3 entries */, 7944)      = 80
stat("/lib/modules/2.1.97/cdrom/.", {st_mode=02, st_size=893125961, ...}) = 0
stat("/lib/modules/2.1.97/cdrom/..", {st_mode=010, st_size=893031120, ...}) = 0
stat("/lib/modules/2.1.97/cdrom/cdrom.o", {st_mode=01, st_size=1524253315, ...}) = 0
access("/lib/modules/2.1.97/cdrom/cdrom.o", R_OK) = 0
lseek(0, 0, SEEK_CUR)                   = 1024
getdents(0, /* 0 entries */, 7944)      = 0
open("/lib/modules/2.1.97/block", O_RDONLY|O_NONBLOCK) = 3
fcntl(3, F_SETFD, FD_CLOEXEC)           = 0
fstat(3, {st_mode=02, st_size=893125769, ...}) = 0
lseek(3, 0, SEEK_CUR)                   = 0
getdents(3, /* 4 entries */, 7944)      = 104
stat("/lib/modules/2.1.97/block/.", {st_mode=02, st_size=893125961, ...}) = 0
stat("/lib/modules/2.1.97/block/..", {st_mode=010, st_size=893031120, ...}) = 0
stat("/lib/modules/2.1.97/block/rd.o", {st_mode=01, st_size=1524253315, ...}) = 0
access("/lib/modules/2.1.97/block/rd.o", R_OK) = 0
stat("/lib/modules/2.1.97/block/loop.o", {st_mode=01, st_size=1524253315, ...}) = 0
access("/lib/modules/2.1.97/block/loop.o", R_OK) = 0
lseek(3, 0, SEEK_CUR)                   = 1024
getdents(3, /* 0 entries */, 7944)      = 0
open("/lib/modules/2.1.97/scsi", O_RDONLY|O_NONBLOCK) = 4
fcntl(4, F_SETFD, FD_CLOEXEC)           = 0
fstat(4, {st_mode=02, st_size=893125769, ...}) = 0
brk(0x120112000)                        = 0x120112000
lseek(4, 0, SEEK_CUR)                   = 0
getdents(4, /* 4 entries */, 7944)      = 104
stat("/lib/modules/2.1.97/scsi/.", {st_mode=02, st_size=893125961, ...}) = 0
stat("/lib/modules/2.1.97/scsi/..", {st_mode=010, st_size=893031120, ...}) = 0
stat("/lib/modules/2.1.97/scsi/st.o", {st_mode=01, st_size=1524253315, ...}) = 0
access("/lib/modules/2.1.97/scsi/st.o", R_OK) = 0
SYS_347(0, 0x1, 0x12010f800, 0x400, 0x11ffffcb0) = 0
sigaction(SIGINT, {SIG_IGN}, {SIG_DFL}) = 0
sigaction(SIGQUIT, {SIG_IGN}, {SIG_DFL}) = 0
sigprocmask(SIG_BLOCK, [CHLD])          = 0 (old mask [])
fork()                                  = 548
wait4(548, [WIFEXITED(s) && WEXITSTATUS(s) == 0], 0, NULL) = 548
sigaction(SIGINT, {SIG_DFL}, NULL)      = 0
sigaction(SIGQUIT, {SIG_DFL}, NULL)     = 0
sigprocmask(SIG_SETMASK, [])            = 0x80000 (old mask [CHLD])
--- SIGCHLD (Child exited) ---
exit(0)                                 = ?

       reply	other threads:[~1998-04-21  2:47 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <199804210131.SAA05828@adam.yggdrasil.com>
1998-04-21  2:48 ` Steven N. Hirsch [this message]
     [not found] <199804210917.LAA00234@zephir.inria.fr>
1998-04-21 12:01 ` daemon-less kmod & Alpha no-go! Steven N. Hirsch
1998-04-21 19:41   ` 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] <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