From: Andrew Morton <akpm@linux-foundation.org>
To: Greg KH <greg@kroah.com>
Cc: Alexey Dobriyan <adobriyan@gmail.com>,
Jeff Garzik <jeff@garzik.org>, Kees Cook <kees@ubuntu.com>,
linux-kernel@vger.kernel.org, Ben Collins <bcollins@ubuntu.com>,
Michael Wu <flamingice@sourmilk.net>
Subject: Re: [PATCH] pci: fix unterminated pci_device_id lists
Date: Wed, 12 Sep 2007 16:08:27 -0700 [thread overview]
Message-ID: <20070912160827.e359a53b.akpm@linux-foundation.org> (raw)
In-Reply-To: <20070912215356.GC23294@kroah.com>
On Wed, 12 Sep 2007 14:53:56 -0700
Greg KH <greg@kroah.com> wrote:
> On Wed, Sep 12, 2007 at 03:48:49PM +0400, Alexey Dobriyan wrote:
> > On 9/12/07, Jeff Garzik <jeff@garzik.org> wrote:
> > > Kees Cook wrote:
> > > > This patch against 2.6.23-rc6 fixes a couple drivers that do not
> > > > correctly terminate their pci_device_id lists. This results in garbage
> > > > being spewed into modules.pcimap when the module happens to not have
> > > > 28 NULL bytes following the table, and/or the last PCI ID is actually
> > > > truncated from the table when calculating the modules.alias PCI aliases,
> > > > cause those unfortunate device IDs to not auto-load.
> > > >
> > > > Signed-off-by: Kees Cook <kees@ubuntu.com>
> > >
> > > ACK
> >
> > I mut say, non-terminated PCI ids lists are constant PITA. There should be
> > a way to a) put it in macro[1], so that terminator automatically added, and
> > b) still allow #ifdef inside table like, e.g. 8139too does.
> >
> > [1] or not macro, because #ifdef inside macros aren't allowed.
>
> If you know of a way to do this in an easier manner, patches are always
> gladly accepted :)
Change (ie: fix) the APIs to take a `length' arg, then fix up 10^42 drivers.
Oh, you said "easy" ;)
Perhaps there's some clever way in which we can check that the tables are
correctly terminated. I guess some static code-checker could do it. A
weaker option would be to do some runtime hack which carefully walks the
table and checks stuff.
next prev parent reply other threads:[~2007-09-12 23:08 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-09-12 6:41 [PATCH] pci: fix unterminated pci_device_id lists Kees Cook
2007-09-12 11:10 ` Jeff Garzik
2007-09-12 11:48 ` Alexey Dobriyan
2007-09-12 21:53 ` Greg KH
2007-09-12 23:08 ` Andrew Morton [this message]
2007-09-13 6:34 ` Alexey Dobriyan
2007-09-13 6:42 ` Jeff Garzik
2007-09-15 9:01 ` Jan Engelhardt
2007-09-13 6:58 ` Sam Ravnborg
2007-09-13 0:49 ` [PATCH] modpost: detect unterminated device id lists Kees Cook
2007-09-13 1:21 ` Andrew Morton
2007-09-16 22:14 ` Andrew Morton
2007-09-17 0:24 ` Satyam Sharma
2007-09-17 6:46 ` Andrew Morton
2007-09-17 21:45 ` Satyam Sharma
2007-09-17 21:50 ` Andrew Morton
2007-09-17 23:36 ` Mauro Carvalho Chehab
2007-09-17 1:22 ` Satyam Sharma
2007-09-17 3:45 ` Kees Cook
2007-09-17 6:48 ` Andrew Morton
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=20070912160827.e359a53b.akpm@linux-foundation.org \
--to=akpm@linux-foundation.org \
--cc=adobriyan@gmail.com \
--cc=bcollins@ubuntu.com \
--cc=flamingice@sourmilk.net \
--cc=greg@kroah.com \
--cc=jeff@garzik.org \
--cc=kees@ubuntu.com \
--cc=linux-kernel@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox