All of lore.kernel.org
 help / color / mirror / Atom feed
* dvb shared datastructure bug?
@ 2007-02-13  7:47 Arjan van de Ven
  2007-02-13  8:49 ` [v4l-dvb-maintainer] " Manu Abraham
  2007-02-13 11:04 ` Marcel Siegert
  0 siblings, 2 replies; 11+ messages in thread
From: Arjan van de Ven @ 2007-02-13  7:47 UTC (permalink / raw)
  To: mchehab, v4l-dvb-maintainer; +Cc: linux-kernel

Hi,

while working on the last pieces of the file_ops constantification, DVB
is the small village in France that is holding the Romans at bay... but
I think I found the final flaw in it now: 

       *pdvbdev = dvbdev = kmalloc(sizeof(struct dvb_device), GFP_KERNEL);

        if (!dvbdev) {
                mutex_unlock(&dvbdev_register_lock);
                return -ENOMEM;
        }

        memcpy(dvbdev, template, sizeof(struct dvb_device));
        dvbdev->type = type;
        dvbdev->id = id;
        dvbdev->adapter = adap;
        dvbdev->priv = priv;

        dvbdev->fops->owner = adap->module;


this is the place in DVB that is writing to a struct file_operations.
But as with almost all such cases in the kernel, this one is buggy:
While the code nicely copies a template dvbdev, that template only has a
pointer to a *shared* fops struct, the copy doesn't help that. So this
code is overwriting the fops owner field for ALL active devices, not
just the ones the copy of the template is for....

I'm lost in the maze of this part of DVB (it seems to have some magic
potion to resist me) but I was hoping some of the local citizens could
take a look at this buglet...

Greetings,
    Arjan van de Ven
-- 
if you want to mail me at work (you don't), use arjan (at) linux.intel.com
Test the interaction between Linux and your BIOS via http://www.linuxfirmwarekit.org


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2007-02-13 13:21 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-02-13  7:47 dvb shared datastructure bug? Arjan van de Ven
2007-02-13  8:49 ` [v4l-dvb-maintainer] " Manu Abraham
2007-02-13 11:04 ` Marcel Siegert
2007-02-13 11:14   ` Manu Abraham
2007-02-13 11:35     ` Jakub Jelinek
2007-02-13 12:02       ` Marcel Siegert
2007-02-13 13:09       ` [v4l-dvb-maintainer] " Trent Piepho
2007-02-13 13:21         ` Marcel Siegert
2007-02-13 13:21         ` Manu Abraham
2007-02-13 11:35   ` Arjan van de Ven
2007-02-13 13:05     ` Marcel Siegert

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.