ALSA: rawmidi: fix oops (use after free) when unloading a driver module
commit aa73aec6 upstream. 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 9a1b64ca.) Signed-off-by:Clemens Ladisch <clemens@ladisch.de> Reported-by:
Krzysztof Foltman <wdev@foltman.com> Signed-off-by:
Takashi Iwai <tiwai@suse.de> Signed-off-by:
Greg Kroah-Hartman <gregkh@suse.de>
Showing
Please register or sign in to comment