summaryrefslogtreecommitdiff
path: root/sound/pci/hda/patch_realtek.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2017-12-14 16:44:12 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-12-29 17:53:46 +0100
commit065a28657370ce3a7ebbc13030ba6231db4a6138 (patch)
tree2d2b2b1236681f239a906dc77f62fda4bd280416 /sound/pci/hda/patch_realtek.c
parent637de99c7a1523b31aedb83537b0fcba8775663e (diff)
ALSA: rawmidi: Avoid racy info ioctl via ctl device
commit c1cfd9025cc394fd137a01159d74335c5ac978ce upstream. The rawmidi also allows to obtaining the information via ioctl of ctl API. It means that user can issue an ioctl to the rawmidi device even when it's being removed as long as the control device is present. Although the code has some protection via the global register_mutex, its range is limited to the search of the corresponding rawmidi object, and the mutex is already unlocked at accessing the rawmidi object. This may lead to a use-after-free. For avoiding it, this patch widens the application of register_mutex to the whole snd_rawmidi_info_select() function. We have another mutex per rawmidi object, but this operation isn't very hot path, so it shouldn't matter from the performance POV. Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'sound/pci/hda/patch_realtek.c')
0 files changed, 0 insertions, 0 deletions