From: Keith Owens <kaos@ocs.com.au>
To: Mike Castle <dalgoda@ix.netcom.com>
Cc: Linux Kernel List <linux-kernel@vger.kernel.org>
Subject: Re: modprobe problem with block-major-11
Date: Thu, 25 Oct 2001 23:03:56 +1000 [thread overview]
Message-ID: <27036.1004015036@ocs3.intra.ocs.com.au> (raw)
In-Reply-To: Your message of "Thu, 25 Oct 2001 00:52:03 MST." <20011025005202.A24125@thune.mrc-home.com>
On Thu, 25 Oct 2001 00:52:03 -0700,
Mike Castle <dalgoda@ix.netcom.com> wrote:
>alias block-major-11 sr_mod # load sr_mod upon access of scd0
>pre-install sr_mod modprobe ide-scsi # load ide-scsi before sr_mod
* User does 'head /dev/scd0'.
* The kernel runs modprobe block-major-11. modprobe is running
setuid(0) because the original user was not root.
* modprobe maps block-major-11 to sr_mod.
* modprobe sees a pre-install command for sr_mod and uses system() to
invoke the command.
* The system() function issues '/bin/sh -c "command"', sh is linked to
bash.
* Bash detects that it was invoked as 'sh' and is running setuid. Bash
silently turns off the setuid privilege before running the command.
WRONG!!
* The second command (modprobe ide-scsi) needs root authority but bash
has removed the authority. modprobe fails :(
The problem is caused by a bash "feature", it was added in bash 2.01.
I cannot fix it without writing my own replacement for the system()
function. Doing setuid(0) in modprobe before calling system() would
reopen the security exposure that was closed in modutils 2.3.21, that
is not an option.
Workaround: Replace
pre-install foo modprobe bar
with
before foo bar
That does all the work internally without using the system() function
and falling foul of the bash feature. It is also faster and it lets
modprobe maintain the chain of modules for unload.
BTW, users can never run rmmod, only root can do that.
next prev parent reply other threads:[~2001-10-25 13:04 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-10-25 4:53 modprobe problem with block-major-11 Mike Castle
2001-10-25 5:51 ` Keith Owens
2001-10-25 7:52 ` Mike Castle
2001-10-25 13:03 ` Keith Owens [this message]
2001-10-25 16:39 ` Mike Castle
2001-10-25 18:20 ` Mike Castle
2001-10-25 18:51 ` Mike Castle
2001-10-25 8:09 ` Mike Castle
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=27036.1004015036@ocs3.intra.ocs.com.au \
--to=kaos@ocs.com.au \
--cc=dalgoda@ix.netcom.com \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.