linux-modules.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Lucas De Marchi <lucas.de.marchi@gmail.com>
To: Mian Yousaf Kaukab <yousaf.kaukab@suse.com>
Cc: linux-modules <linux-modules@vger.kernel.org>
Subject: Re: [PATCH] depmod: ignore related modules in depmod_report_cycles
Date: Sat, 5 Nov 2016 21:50:37 -0200	[thread overview]
Message-ID: <CAKi4VAKkpfdni-fVW+nr=at4YK3P8cvy+-mFpmJX2QURzOKMMQ@mail.gmail.com> (raw)
In-Reply-To: <1478252037-5340-1-git-send-email-yousaf.kaukab@suse.com>

Hi,

On Fri, Nov 4, 2016 at 7:33 AM, Mian Yousaf Kaukab
<yousaf.kaukab@suse.com> wrote:
> Only print actual cyclic dependencies. Don't print count of all the
> modules as it includes other modules which have dependencies but not
> necessarily cyclic.
>
> Printing related modules causes buffer overflow as m->modnamesz is not
> included in buffer size calculations (loop =3D=3D m is never true).
> This buffer overflow causes kmod to crash.
>
> Reported-by: Andreas F=C3=A4rber <afaerber@suse.de>
> Signed-off-by: Mian Yousaf Kaukab <yousaf.kaukab@suse.com>
> ---
> As count of modules in cyclic dependency chain is not known at the
> start of this function, so it is not printed anymore. The output
> when cyclic dependency is detected is changed as following:
>
> Old:
> depmod: ERROR: Found 8 modules in dependency cycles!
>
> New:
> depmod: ERROR: Modules found in dependency cycles!

I think it would be good to fix this problem, but retaining the behavior.

My first reaction to this is "how do I reproduce the issue?". This
number so far does tell us how many modules are involved in loops. So,
for example:

A -> B -> D -> A
B -> C -> B

This line should point to 4 modules. We don't know which module is
wrong. But there are 4 modules involved in the loops. D could be the
culprit.

The function should show what are the loops present (in "first found
order" - it could very well report as "B -> D -> A -> B" the line
above).

We have a testsuite to check if the loop detection is working in
depmod. See testsuite/test-depmod.c:depmod_detect_loop().
Would it be possible to add your use case there? If you tell me what
are your dependency chain and cycle I can take a look.

If I misunderstood the issue with the total number, then at least the
testsuite needs to be fixed, because right now it expects that number
to be in the output (see
testsuite/rootfs-pristine/test-depmod/detect-loop/correct.txt)


thanks
Lucas De Marchi

  reply	other threads:[~2016-11-05 23:50 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-04  9:33 [PATCH] depmod: ignore related modules in depmod_report_cycles Mian Yousaf Kaukab
2016-11-05 23:50 ` Lucas De Marchi [this message]
2016-11-07 17:27   ` Mian Yousaf Kaukab
2016-11-07 20:23     ` Bjorn Andersson
2016-11-08  9:36       ` Mian Yousaf Kaukab
2016-11-08 17:03         ` Bjorn Andersson

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='CAKi4VAKkpfdni-fVW+nr=at4YK3P8cvy+-mFpmJX2QURzOKMMQ@mail.gmail.com' \
    --to=lucas.de.marchi@gmail.com \
    --cc=linux-modules@vger.kernel.org \
    --cc=yousaf.kaukab@suse.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;
as well as URLs for NNTP newsgroup(s).