All of lore.kernel.org
 help / color / mirror / Atom feed
From: Masahiro Yamada <yamada.masahiro@socionext.com>
To: Kees Cook <keescook@chromium.org>
Cc: Linux Kbuild mailing list <linux-kbuild@vger.kernel.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	Sam Ravnborg <sam@ravnborg.org>, Arnd Bergmann <arnd@arndb.de>,
	Greg KH <gregkh@linuxfoundation.org>,
	Jessica Yu <jeyu@kernel.org>,
	Lucas De Marchi <lucas.de.marchi@gmail.com>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	Rusty Russell <rusty@rustcorp.com.au>,
	Michal Marek <michal.lkml@markovi.net>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [RFC PATCH] kbuild: check uniqueness of basename of modules
Date: Fri, 17 May 2019 12:37:46 +0900	[thread overview]
Message-ID: <CAK7LNASKnWkJhw3Hn1vKK=dB_vHOo0MtMd9duTpHoQSdgYoZLA@mail.gmail.com> (raw)
In-Reply-To: <201905151130.87CDB73C0@keescook>

Hi Kees,

On Thu, May 16, 2019 at 3:31 AM Kees Cook <keescook@chromium.org> wrote:
>
> On Thu, May 16, 2019 at 03:07:54AM +0900, Masahiro Yamada wrote:
> > On Wed, May 15, 2019 at 4:40 PM Masahiro Yamada
> > <yamada.masahiro@socionext.com> wrote:
> >
> > >         $(Q)$(AWK) '!x[$$0]++' $^ > $(objtree)/modules.builtin
> > > diff --git a/scripts/modules-check.sh b/scripts/modules-check.sh
> > > new file mode 100755
> > > index 000000000000..944e68bd22b0
> > > --- /dev/null
> > > +++ b/scripts/modules-check.sh
> > > @@ -0,0 +1,18 @@
> > > +#!/bin/sh
> > > +# SPDX-License-Identifier: GPL-2.0
> > > +
> > > +# Warn if two or more modules have the same basename
> > > +check_same_name_modules()
> > > +{
> > > +       same_name_modules=$(cat modules.order modules.builtin | \
> > > +                               xargs basename -a | sort | uniq -d)
> >
> >
> > I noticed a bug here.
> >
> >
> > allnoconfig + CONFIG_MODULES=y
> > will create empty modules.order and modules.builtin.
> >
> > Then, 'basename -a' will emit the error messages
> > since it receives zero arguments.
>
> You can skip running it by adding "-r" to xargs:
>
>        -r, --no-run-if-empty
>               If the standard input does not contain any nonblanks, do not run
>               the command.  Normally, the command is run once even if there is
>               no input.  This option is a GNU extension.

Good idea!

I will use this in v2.

Thanks.


-- 
Best Regards
Masahiro Yamada

      reply	other threads:[~2019-05-17  3:38 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-15  7:38 [RFC PATCH] kbuild: check uniqueness of basename of modules Masahiro Yamada
2019-05-15  7:53 ` Masahiro Yamada
2019-05-15 16:20   ` Kees Cook
2019-05-15 17:55     ` Masahiro Yamada
2019-05-15 18:38       ` Kees Cook
2019-05-17  3:39         ` Masahiro Yamada
2019-05-16  9:00       ` David Laight
2019-05-16  9:38         ` Masahiro Yamada
2019-05-15  8:08 ` Arnd Bergmann
2019-05-15  8:14   ` Greg KH
2019-05-15  8:57     ` Masahiro Yamada
2019-05-15 11:31       ` Greg KH
2019-05-15 11:42         ` Masahiro Yamada
2019-05-15 18:07 ` Masahiro Yamada
2019-05-15 18:31   ` Kees Cook
2019-05-17  3:37     ` Masahiro Yamada [this message]

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='CAK7LNASKnWkJhw3Hn1vKK=dB_vHOo0MtMd9duTpHoQSdgYoZLA@mail.gmail.com' \
    --to=yamada.masahiro@socionext.com \
    --cc=akpm@linux-foundation.org \
    --cc=arnd@arndb.de \
    --cc=gregkh@linuxfoundation.org \
    --cc=jeyu@kernel.org \
    --cc=keescook@chromium.org \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lucas.de.marchi@gmail.com \
    --cc=michal.lkml@markovi.net \
    --cc=rusty@rustcorp.com.au \
    --cc=sam@ravnborg.org \
    --cc=torvalds@linux-foundation.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.