kernel-hacking-2024-linux-s.../sound/core
Takashi Iwai 399ccdc1cd ALSA: fix locking in snd_pcm_open*() and snd_rawmidi_open*()
The PCM and rawmidi open callbacks have a lock against card->controls_list
but it takes a wrong one, card->controls_rwsem, instead of a right one
card->ctl_files_rwlock.  This patch fixes them.

This change also fixes automatically the potential deadlocks due to
mm->mmap_sem in munmap and copy_from/to_user, reported by Sitsofe
Wheeler:

  A: snd_ctl_elem_user_tlv(): card->controls_rwsem => mm->mmap_sem
  B: snd_pcm_open(): card->open_mutex => card->controls_rwsem
  C: munmap: mm->mmap_sem => snd_pcm_release(): card->open_mutex

The patch breaks the chain.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2008-09-25 14:51:03 +02:00
..
oss
seq sound: ensure device number is valid in snd_seq_oss_synth_make_info 2008-08-04 17:03:26 -07:00
control.c ALSA: make snd_ctl_elem_read() and snd_ctl_elem_write() static 2008-06-13 16:48:49 +02:00
control_compat.c
device.c
hwdep.c
hwdep_compat.c
info.c PAGE_ALIGN(): correctly handle 64-bit values on 32-bit architectures 2008-07-24 10:47:21 -07:00
info_oss.c
init.c device create: sound: convert device_create to device_create_drvdata 2008-07-21 21:54:44 -07:00
isadma.c
Kconfig
Makefile
memalloc.c
memory.c
misc.c
pcm.c ALSA: fix locking in snd_pcm_open*() and snd_rawmidi_open*() 2008-09-25 14:51:03 +02:00
pcm_compat.c
pcm_lib.c
pcm_memory.c
pcm_misc.c
pcm_native.c Revert "pcm_native.c: remove unused label" 2008-08-06 19:26:20 -07:00
pcm_timer.c
rawmidi.c ALSA: fix locking in snd_pcm_open*() and snd_rawmidi_open*() 2008-09-25 14:51:03 +02:00
rawmidi_compat.c
rtctimer.c
sgbuf.c
sound.c Merge branch 'bkl-removal' of git://git.lwn.net/linux-2.6 2008-07-14 14:48:31 -07:00
sound_oss.c
timer.c ALSA: remove CONFIG_KMOD from sound 2008-07-10 09:32:58 +02:00
timer_compat.c
vmaster.c