mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Rusty Russell <rusty@rustcorp.com.au>
To: Mikael Pettersson <mikpe@user.it.uu.se>
Cc: linux-kernel@vger.kernel.org, torvalds@transmeta.com
Subject: Re: [BUG] 2.5.62 kmod rewrite broke modprobe's install command
Date: Mon, 24 Feb 2003 13:52:18 +1100	[thread overview]
Message-ID: <20030224025907.BCA452C274@lists.samba.org> (raw)
In-Reply-To: Your message of "Sun, 23 Feb 2003 14:00:04 BST." <200302231300.h1ND04Ch008890@harpo.it.uu.se>

In message <200302231300.h1ND04Ch008890@harpo.it.uu.se> you write:
> The reason this happens is that in 2.5.62, modprobe is started
> with SIGCHLD set to SIG_IGN and not blocked. The "install"
> command is run by system(), but due to SIGCHLD being SIG_IGN,
> the child (which terminates quickly) is reaped automatically.
> The parent process (modprobe) does a wait or waitpid, which fails
> with ECHILD since the child is already gone. system() returns -1,
> and modprobe logs a fatal error.

Yes.  Fixed below.

Thanks for the report!
Rusty.
--
  Anyone who quotes me in their sig is an idiot. -- Rusty Russell.

Name: Enable signals for usermode helpers
Author: Linus Torvalds
Status: Experimental

D: Stelian Pop reported that all signals are blocked in processes
D: execed from the kernel as usermode helpers.

diff -urpN --exclude TAGS -X /home/rusty/devel/kernel/kernel-patches/current-dontdiff --minimal linux-2.5.62-bk6/kernel/kmod.c working-2.5.62-bk6-usermode-sig/kernel/kmod.c
--- linux-2.5.62-bk6/kernel/kmod.c	2003-02-18 11:18:57.000000000 +1100
+++ working-2.5.62-bk6-usermode-sig/kernel/kmod.c	2003-02-24 12:18:55.000000000 +1100
@@ -152,6 +152,14 @@ static int ____call_usermodehelper(void 
 	struct subprocess_info *sub_info = data;
 	int retval;
 
+	/* Unblock all signals. */
+	flush_signals(curtask);
+	flush_signal_handlers(curtask);
+	spin_lock_irq(&curtask->sighand->siglock);
+	sigemptyset(&curtask->blocked);
+	recalc_sigpending();
+	spin_unlock_irq(&curtask->sighand->siglock);
+
 	retval = -EPERM;
 	if (current->fs->root)
 		retval = execve(sub_info->path, sub_info->argv,sub_info->envp);

  reply	other threads:[~2003-02-24  2:50 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-02-23 13:00 Mikael Pettersson
2003-02-24  2:52 ` Rusty Russell [this message]
2003-02-24 12:58 Mikael Pettersson

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=20030224025907.BCA452C274@lists.samba.org \
    --to=rusty@rustcorp.com.au \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mikpe@user.it.uu.se \
    --cc=torvalds@transmeta.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®