[lkml]   [2007]   [Feb]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Subjectdvb shared datastructure bug?

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) {
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...

Arjan van de Ven
if you want to mail me at work (you don't), use arjan (at)
Test the interaction between Linux and your BIOS via

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

 \ /
  Last update: 2007-02-13 08:51    [W:0.122 / U:0.116 seconds]
©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site