mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* Re: OOps in exec_usermodehelper
@ 2000-11-28 18:59 Petr Vandrovec
  2000-11-29  7:19 ` Andrew Morton
  0 siblings, 1 reply; 5+ messages in thread
From: Petr Vandrovec @ 2000-11-28 18:59 UTC (permalink / raw)
  To: Andrew Morton; +Cc: linux-kernel

On 29 Nov 00 at 1:53, Andrew Morton wrote:

> hmm..  Quite a few things fixed here.
> 
> Could you please test this patch?  It's against 2.4.0-test12-pre2,
> should be OK against test11.

I upgraded to 12-pre2 already ;-) It looks like that it works.
 
> - keventd is now capable of reaping dead children.  I will be all ears
>   if someone can tell me how to get a kernel thread to accept signals
>   without having to install a handler with
> 
>     sa.sa_handler = (__sighandler_t)100;

Is there any reason why not set sa.sa_handler to SIG_IGN? According
to arch/i386/kernel/signal.c:do_signal(), signal manpage and my memory,
kernel does automatic child reaping in such configuration. So you
could even remove waitpid() loop from keventd. I did not tried it yet,
but it looks like obvious solution... 

BTW, are you sure that kernel does not try to deliver SIGSEGV to 
keventd() when signal arrives. It looks like that it should, but it
probably fails somewhere during way due to non-existent userspace for
this process.
 
> +   sa.sa.sa_handler = (__sighandler_t)100;     /* Surely there's a better way? */
> +   sa.sa.sa_flags = 0;

SA_RESTART? SA_NOCLDSTOP ?

> +   do_sigaction(SIGCHLD, &sa, (struct k_sigaction *)0);
>  
>     for (;;) {
> -       current->state = TASK_INTERRUPTIBLE;
> +       __set_task_state(curtask, TASK_INTERRUPTIBLE);
>         add_wait_queue(&context_task_wq, &wait);
>  
>         /*
> @@ -46,15 +59,19 @@
>             schedule();
>  
>         remove_wait_queue(&context_task_wq, &wait);
> -       current->state = TASK_RUNNING;
> +       __set_task_state(curtask, TASK_RUNNING);
>         run_task_queue(&tq_context);
> +       if (signal_pending(curtask)) {
> +           while (waitpid(-1, (unsigned int *)0, __WALL|WNOHANG) > 0)
> +               ;
> +           flush_signals(curtask);
> +           recalc_sigpending(curtask);
> +       }

                                                    Best regards,
                                                        Petr Vandrovec
                                                        vandrove@vc.cvut.cz
                                                        
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/

^ permalink raw reply	[flat|nested] 5+ messages in thread
* OOps in exec_usermodehelper
@ 2000-11-27 14:11 Petr Vandrovec
  2000-11-28  0:47 ` Andrew Morton
  2000-11-28 14:53 ` Andrew Morton
  0 siblings, 2 replies; 5+ messages in thread
From: Petr Vandrovec @ 2000-11-27 14:11 UTC (permalink / raw)
  To: linux-kernel

Hi,
  I have one small problem with 2.4.0-test11 and exec_usermodehelper.
When vmware modules shutdown (specifically vmnet-netifup), kernel tries
to load some module through call_usermodehelper, but unfortunately
from task which has current->files == NULL.

  So it prints message:
  
waitpid(19457) failed, -512

  and then it oopses in
  
for (i = 0; i < current->files->max_fds; i++) {
  if (current->files->fd[i]) close(i);
}

(In log, there is first waitpid, and then oopses from current->files == NULL,
which I do not quite understand).

Should I look into this more deeply, or is correct fix just add

if (current->files) {
  for (i = 0; ..... ) ...
}

into exec_usermodehelper?
                                        Best regards,
                                            Petr Vandrovec
                                            vandrove@vc.cvut.cz
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2000-11-29  7:47 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-11-28 18:59 OOps in exec_usermodehelper Petr Vandrovec
2000-11-29  7:19 ` Andrew Morton
  -- strict thread matches above, loose matches on Subject: below --
2000-11-27 14:11 Petr Vandrovec
2000-11-28  0:47 ` Andrew Morton
2000-11-28 14:53 ` Andrew Morton

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®