https://github.com/torvalds/linux
Revision 399ccdc1cd4e92e541d4dacbbf18c52bd693418b authored by Takashi Iwai on 25 September 2008, 12:51:03 UTC, committed by Takashi Iwai on 25 September 2008, 12:51:03 UTC
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>
1 parent b0b8daf
History
Tip revision: 399ccdc1cd4e92e541d4dacbbf18c52bd693418b authored by Takashi Iwai on 25 September 2008, 12:51:03 UTC
ALSA: fix locking in snd_pcm_open*() and snd_rawmidi_open*()
Tip revision: 399ccdc
File Mode Size
Documentation
arch
block
crypto
drivers
firmware
fs
include
init
ipc
kernel
lib
mm
net
samples
scripts
security
sound
usr
virt
.gitignore -rw-r--r-- 867 bytes
.mailmap -rw-r--r-- 3.6 KB
COPYING -rw-r--r-- 18.3 KB
CREDITS -rw-r--r-- 90.7 KB
Kbuild -rw-r--r-- 2.4 KB
MAINTAINERS -rw-r--r-- 99.7 KB
Makefile -rw-r--r-- 55.4 KB
README -rw-r--r-- 16.5 KB
REPORTING-BUGS -rw-r--r-- 3.1 KB

README

back to top