[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAK7LNAQ7Q4jbLXCs-8xtDAF_YPBtcy6g6ABZ19pZ08RN6j52hw@mail.gmail.com>
Date: Sat, 18 May 2019 01:21:53 +0900
From: Masahiro Yamada <yamada.masahiro@...ionext.com>
To: Lucas De Marchi <lucas.de.marchi@...il.com>
Cc: Greg KH <gregkh@...uxfoundation.org>,
Linux Kbuild mailing list <linux-kbuild@...r.kernel.org>,
Sam Ravnborg <sam@...nborg.org>, Arnd Bergmann <arnd@...db.de>,
Jessica Yu <jeyu@...nel.org>,
Stephen Rothwell <sfr@...b.auug.org.au>,
Michael Schmitz <schmitzmic@...il.com>,
Linus Torvalds <torvalds@...ux-foundation.org>,
Rusty Russell <rusty@...tcorp.com.au>,
Kees Cook <keescook@...omium.org>,
Michal Marek <michal.lkml@...kovi.net>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v2] kbuild: check uniqueness of module names
On Fri, May 17, 2019 at 2:46 PM Lucas De Marchi
<lucas.de.marchi@...il.com> wrote:
>
> On Thu, May 16, 2019 at 10:37 PM Greg KH <gregkh@...uxfoundation.org> wrote:
> >
> > On Fri, May 17, 2019 at 01:45:11PM +0900, Masahiro Yamada wrote:
> > > On Fri, May 17, 2019 at 1:29 PM Masahiro Yamada
> > > <yamada.masahiro@...ionext.com> wrote:
> > > >
> > > > In the recent build test of linux-next, Stephen saw a build error
> > > > caused by a broken .tmp_versions/*.mod file:
> > > >
> > > > https://lkml.org/lkml/2019/5/13/991
> > > >
> > > > drivers/net/phy/asix.ko and drivers/net/usb/asix.ko have the same
> > > > basename, and there is a race in generating .tmp_versions/asix.mod
> > > >
> > > > Kbuild has not checked this before, and it suddenly shows up with
> > > > obscure error message when this kind of race occurs.
> > > >
> > > > Non-unique module names cause various sort of problems, but it is
> > > > not trivial to catch them by eyes.
> > > >
> > > > Hence, this script.
> > > >
> > > > It checks not only real modules, but also built-in modules (i.e.
> > > > controlled by tristate CONFIG option, but currently compiled with =y).
> > > > Non-unique names for built-in modules also cause problems because
> > > > /sys/modules/ would fall over.
> > > >
> > > > I tested allmodconfig on the latest kernel, and it detected the
> > > > following:
> > > >
> > > > warning: same basename if the following are built as modules:
> > > > drivers/regulator/88pm800.ko
> > > > drivers/mfd/88pm800.ko
> > > > warning: same basename if the following are built as modules:
> > > > drivers/gpu/drm/bridge/adv7511/adv7511.ko
> > > > drivers/media/i2c/adv7511.ko
> > > > warning: same basename if the following are built as modules:
> > > > drivers/net/phy/asix.ko
> > > > drivers/net/usb/asix.ko
> > > > warning: same basename if the following are built as modules:
> > > > fs/coda/coda.ko
> > > > drivers/media/platform/coda/coda.ko
> > > > warning: same basename if the following are built as modules:
> > > > drivers/net/phy/realtek.ko
> > > > drivers/net/dsa/realtek.ko
> > > >
> > > > Reported-by: Stephen Rothwell <sfr@...b.auug.org.au>
> > > > Signed-off-by: Masahiro Yamada <yamada.masahiro@...ionext.com>
> > > > Reviewed-by: Kees Cook <keescook@...omium.org>
> > > > ---
> > >
> > >
> > > One more question popped up.
> > >
> > > External modules are out of scope of the community,
> > > but it is possible that people create an external module
> > > that happens to have the same name as an upstream driver.
> >
> > That is their bug, nothing we can do about that :)
>
> It's actually not a bug. For external modules it works pretty much as
> intended. See DEPMOD.D(5): the search directive tells what's the
> preference among the directories for modules with the same name.
> depmod respects that order and put the right one into your
> modules.dep.
>
> This allows to put external modules in a different dir and also to
> make backports of modules from recent to ancient kernels. These
> modules with the same name are usually the same module, with a
> different version. Of course what we have here and you are fixing is a
> different story.
OK, so external modules should not be checked.
Thanks for the explanation!
> Reviewed-by: Lucas De Marchi <lucas.demarchi@...el.com>
>
>
> Lucas De Marchi
--
Best Regards
Masahiro Yamada
Powered by blists - more mailing lists