All of lore.kernel.org
 help / color / mirror / Atom feed
From: Greg KH <greg@kroah.com>
To: kernel-janitors@vger.kernel.org
Subject: Re: exported symbols
Date: Sun, 20 Sep 2009 15:07:48 +0000	[thread overview]
Message-ID: <20090920150748.GE11621@kroah.com> (raw)
In-Reply-To: <Pine.LNX.4.64.0909182336590.4238@ask.diku.dk>

On Sun, Sep 20, 2009 at 07:21:36AM +0200, Julia Lawall wrote:
> On Sat, 19 Sep 2009, Greg KH wrote:
> 
> > On Fri, Sep 18, 2009 at 11:39:34PM +0200, Julia Lawall wrote:
> > > Functions that are exported using EXPORT_SYMBOL, and thus are presumably 
> > > freely available for use in dynamically loaded modules, do not seem to 
> > > very often check the validity of their inputs.  For a simple example, 
> > > the following code from arch/arm/mach-realview/clock.c does not even check 
> > > that clk is not NULL:
> > > 
> > >  unsigned long clk_get_rate(struct clk *clk)
> > >  {
> > >         return clk->rate;
> > >  }
> > >  EXPORT_SYMBOL(clk_get_rate);
> > > 
> > > Is this a problem?
> > 
> > No, as long as all callers are not passing NULL :)
> > 
> > Seriously, it's not an issue, putting error checking for everything
> > causes a lot of extra code for no reason, as we can easily audit all
> > callers of these symbols, it is not always necessary to check the
> > paramters.
> 
> Who is we?

Us kernel developers.

> If the symbol is exported can't anyone write a kernel module 
> that uses the function?

Yes, and we can see their code as well when it is distributed.

> Is the policy that in that case they get what they deserve?

Yes, that would be a trivial thing to debug :)

thanks,

greg k-h

      parent reply	other threads:[~2009-09-20 15:07 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-18 21:39 exported symbols Julia Lawall
2009-09-19 22:40 ` Greg KH
2009-09-20  5:21 ` Julia Lawall
2009-09-20 15:07 ` Greg KH [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=20090920150748.GE11621@kroah.com \
    --to=greg@kroah.com \
    --cc=kernel-janitors@vger.kernel.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.