Re: [PATCH] Reset file->f_op in snd_card_file_remove(). Take 2

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



At Fri, 29 Sep 2006 14:29:20 +0200,
Karsten Wiese wrote:
> 
> Am Freitag, 29. September 2006 12:48 schrieb Takashi Iwai:
> > At Thu, 28 Sep 2006 22:28:02 +0200,
> > Karsten Wiese wrote:
> > > 
> > > Hi
> > > 
> > > It oopses with 2.6.18-rt4 + alsa-kernel-1.0.13rc3 now.
> > > I wrote before, 2.6.18-rt3 + alsa-driver-1.0.13rc3 would be ok,
> > > but its not. bug showed again reliably under memory-pressure.
> > > 
> > >       Karsten
> > > 
> > > ===
> > > 
> > > Reset file->f_op in snd_card_file_remove(). Take 2
> > > 
> > > 
> > > i think what happens here is:
> > > 
> > >   us428control runs, kernel has allocated a struct file for /dev/hwC1D0.
> > > 
> > >   usb disconnect
> > > 
> > >   snd_usb_usx2y calls snd_card_disconnect,
> > >   tells us428control to exit.
> > > 
> > >   snd_card_disconnect replaces /dev/hwC1D0's file->f_op
> > >   with a kmalloc()ed version, that would only allow releases.
> > > 
> > >   us428control starts exiting
> > > 
> > >   __fput is called with struct file for /dev/hwC1D0.
> > > 
> > >   snd_card_file_remove() is called, alsa notices struct file
> > >   for /dev/hwC1D0 is about to be closed.
> > >   with patch below, file->f_op would be set NULL now.
> > > 
> > >   snd_usb_usx2y's free()s snd_card instance and /dev/hwC1D0's
> > >   file->f_ops, those that would only allow releases.
> > > 
> > >   for reason I would like to know,
> > >   __fput is called again with struct file for /dev/hwC1D0
> > >   from us428control's do_exit().
> > >   __fput see's file->f_op is still set.
> > >   Without patch and under memory pressure, file->f_op can
> > >   point to anything now.
> > > 
> > > 
> > > Signed-off-by: Karsten Wiese <annabellesgarden@xxxxxxxx>
> > 
> > I guess this bug is fixed by Florin's patch below, juding from your
> > explanation.  Could you check it?
> > 
> Florin's patch fixes it.
> 
> This one for immediate consumation by mainline, mm, rt,
> and the stable teams, hmm?

It'll be pushed to mainline soon together with other ALSA fixes.  Then
I'll forward to stable, too.


Takashi

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Alsa-devel mailing list
Alsa-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.sourceforge.net/lists/listinfo/alsa-devel

[Index of Archives]     [ALSA User]     [Linux Audio Users]     [Kernel Archive]     [Asterisk PBX]     [Photo Sharing]     [Linux Sound]     [Video 4 Linux]     [Gimp]     [Yosemite News]

  Powered by Linux