]> git.baikalelectronics.ru Git - kernel.git/commit
ALSA: rawmidi: fix oops (use after free) when unloading a driver module
authorClemens Ladisch <clemens@ladisch.de>
Fri, 15 Oct 2010 10:06:18 +0000 (12:06 +0200)
committerTakashi Iwai <tiwai@suse.de>
Sun, 17 Oct 2010 08:11:40 +0000 (10:11 +0200)
commit86a64c8d72c73e620e318079d850079eeaede97d
tree97ab3c6e917c2592f2c432c703a058ac0cebc574
parent13fcf89ab4ee9182a36c424ebf256a67c0661457
ALSA: rawmidi: fix oops (use after free) when unloading a driver module

When a driver module is unloaded and the last still open file is a raw
MIDI device, the card and its devices will be actually freed in the
snd_card_file_remove() call when that file is closed.  Afterwards, rmidi
and rmidi->card point into freed memory, so the module pointer is likely
to be garbage.
(This was introduced by commit 3c4c7477def325abd54b15e2b08b3dac7bb8f5f4.)

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Reported-by: Krzysztof Foltman <wdev@foltman.com>
Cc: 2.6.30-2.6.35 <stable@kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/core/rawmidi.c