mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Takashi Iwai <tiwai@suse.de>
To: Rusty Russell <rusty@rustcorp.com.au>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH] modpost: abort if a module symbol is too long
Date: Fri, 07 Aug 2015 07:36:09 +0200	[thread overview]
Message-ID: <s5h1tffd5iu.wl-tiwai@suse.de> (raw)
In-Reply-To: <871tfgcefb.fsf@rustcorp.com.au>

On Thu, 06 Aug 2015 23:09:12 +0200,
Rusty Russell wrote:
> 
> Takashi Iwai <tiwai@suse.de> writes:
> > Module symbols have a limited length, but currently the build system
> > allows the build finishing even if the driver code contains a too long
> > symbol name, which eventually overflows the modversion_info[] item.
> > The compiler may catch at compiling *.mod.c like
> >   CC      xxx.mod.o
> >   xxx.mod.c:18:16: warning: initializer-string for array of chars is too long
> > but it's merely a warning.
> >
> > This patch adds the check of the symbol length in modpost and stops
> > the build properly.
> >
> > As of now, MODULE_NAME_LEN is copied in modpost.c.  At best, this
> > should be read directly from kernel headers.  But including
> > linux/module.h is too troublesome for now, so just paper over it.
> >
> > Signed-off-by: Takashi Iwai <tiwai@suse.de>
> > ---
> >  scripts/mod/modpost.c | 9 +++++++++
> >  1 file changed, 9 insertions(+)
> >
> > diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c
> > index 12d3db3bd46b..25bda9d2868c 100644
> > --- a/scripts/mod/modpost.c
> > +++ b/scripts/mod/modpost.c
> > @@ -2133,6 +2133,9 @@ static void add_staging_flag(struct buffer *b, const char *name)
> >  		buf_printf(b, "\nMODULE_INFO(staging, \"Y\");\n");
> >  }
> >  
> > +/* FIXME: better to be included from kernel header */
> > +#define MODULE_NAME_LEN (64 - sizeof(unsigned long))
> 
> This isn't quite right, since modpost handles cross-compilation.
> 
> #define MODULE_NAME_LEN (64 - sizeof(Elf_Addr))
> 
> Should work...

Alright, I'll resubmit with this fix.


Thanks!

Takashi

      reply	other threads:[~2015-08-07  5:36 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-06 15:53 Takashi Iwai
2015-08-06 21:09 ` Rusty Russell
2015-08-07  5:36   ` Takashi Iwai [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=s5h1tffd5iu.wl-tiwai@suse.de \
    --to=tiwai@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rusty@rustcorp.com.au \
    /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

Powered by JetHome