From: Richard Weinberger <richard@nod.at>
To: Tetsuo Handa <penguin-kernel@i-love.sakura.ne.jp>
Cc: viro@zeniv.linux.org.uk, akpm@linux-foundation.org,
linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org
Subject: Re: [PATCH][Resend v2] Fix infinite loop in search_binary_handler()
Date: Mon, 4 Jul 2011 16:59:32 +0200 [thread overview]
Message-ID: <201107041659.32707.richard@nod.at> (raw)
In-Reply-To: <201107042342.HDH34381.OFtHSLOMVFJFOQ@I-love.SAKURA.ne.jp>
Am Montag 04 Juli 2011, 16:42:09 schrieb Tetsuo Handa:
> Richard Weinberger wrote:
> > > That's strange... Would you show us printk() output like
> > >
> > > printk(KERN_INFO "Calling request_module()\n");
> > > request_module("binfmt-%04x", *(unsigned short *)(&bprm->buf[2]));
> > > printk(KERN_INFO "Returned from request_module()\n");
> > >
> > > for demonstrating that __request_module() cannot stop at
> > > MAX_KMOD_CONCURRENT levels of nesting?
> >
> > There you go!
> > http://userweb.kernel.org/~rw/boot.log
> >
> > I did not count all messages, but they are more than 50. :-)
>
> Thank you.
>
> $ grep -F 'Calling request_module()' boot.log | wc -l
> 25819
> $ grep -F 'Returned from request_module()' boot.log | wc -l
> 25770
Ahh, the dela is 49. Got it!
> So, __request_module() is stopping at MAX_KMOD_CONCURRENT levels
> of nesting. Eventually the process that triggered the first
> request_module() will return from search_binary_handler().
> I don't think this is an infinite loop inside search_binary_handler().
>
> But it would look like an infinite loop bug if the caller of execve()
> repeats forever. Printing additional information like
>
> printk(KERN_INFO "Calling request_module() %s %d %s %d %d\n",
> current->comm, current->pid, bprm->filename, bprm->argc, bprm->envc);
>
> would help.
Here the second boot log:
http://userweb.kernel.org/~rw/boot2.log
The interesting part is:
---cut---
VFS: Mounted root (ext2 filesystem) readonly on device 98:0.
Calling request_module() swapper 1 /sbin/init 1 3
Calling request_module() kworker/u:0 211 /sbin/modprobe 4 3
...
Calling request_module() kworker/u:0 8741 /sbin/modprobe 4 3
---cut---
After the last "Calling request_module..." message no more messages appear and
the kernel seems to loop for ever.
Maybe it takes just very long until all calls to /sbin/modprobe terminate?
Thanks,
//richard
next prev parent reply other threads:[~2011-07-04 14:59 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-07-04 11:30 [PATCH][Resend v2] Fix infinite loop in search_binary_handler() Richard Weinberger
2011-07-04 11:51 ` Tetsuo Handa
2011-07-04 11:57 ` Richard Weinberger
2011-07-04 12:10 ` Tetsuo Handa
2011-07-04 12:20 ` Richard Weinberger
2011-07-04 14:42 ` Tetsuo Handa
2011-07-04 14:59 ` Richard Weinberger [this message]
2011-07-04 15:07 ` Richard Weinberger
2011-07-04 22:03 ` Tetsuo Handa
2011-07-04 22:17 ` Richard Weinberger
2011-07-05 1:24 ` Tetsuo Handa
2011-07-05 9:55 ` Richard Weinberger
2011-07-05 12:02 ` Tetsuo Handa
2011-07-05 12:21 ` Richard Weinberger
2011-07-06 11:28 ` Tetsuo Handa
2011-07-06 11:36 ` Richard Weinberger
2011-07-06 20:21 ` Andrew Morton
2011-07-07 4:04 ` Tetsuo Handa
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=201107041659.32707.richard@nod.at \
--to=richard@nod.at \
--cc=akpm@linux-foundation.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=penguin-kernel@i-love.sakura.ne.jp \
--cc=viro@zeniv.linux.org.uk \
/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