linux_dsm_epyc7002/sound/core
Laurent Pinchart f41ced8f10 Check fops_get() return value
Several subsystem open handlers dereference the fops_get() return value
without checking it for nullness.  This opens a race condition between the
open handler and module unloading.

A module can be marked as being unloaded (MODULE_STATE_GOING) before its
exit function is called and gets the chance to unregister the driver.
During that window open handlers can still be called, and fops_get() will
fail in try_module_get() and return a NULL pointer.

This change checks the fops_get() return value and returns -ENODEV if NULL.

Reported-by: Alan Jenkins <alan-jenkins@tuffmail.co.uk>
Signed-off-by: Laurent Pinchart <laurent.pinchart@skynet.be>
Acked-by: Takashi Iwai <tiwai@suse.de>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: Dave Airlie <airlied@linux.ie>
Acked-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-01-06 15:59:11 -08:00
..
oss [PATCH] introduce fmode_t, do annotations 2008-10-21 07:47:06 -04:00
seq ALSA: Add hrtimer backend for ALSA timer interface 2008-10-24 18:16:50 +02:00
control_compat.c ALSA: Kill snd_assert() in sound/core/* 2008-08-13 11:46:35 +02:00
control.c saner FASYNC handling on file close 2008-11-01 09:49:46 -07:00
device.c ALSA: Print function symbol in the error messages 2008-10-16 16:17:30 +02:00
hrtimer.c Merge branch 'timers-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip 2008-12-30 16:16:21 -08:00
hwdep_compat.c [PATCH] hwdep_compat missed __user annotations 2006-10-10 15:37:21 -07:00
hwdep.c ALSA: Kill snd_assert() in sound/core/* 2008-08-13 11:46:35 +02:00
info_oss.c ALSA: Kill snd_assert() in sound/core/* 2008-08-13 11:46:35 +02:00
info.c ALSA: when card identification is changed, change also /proc/asound symlink 2008-11-12 17:07:37 +01:00
init.c sound: Fix warnings relating to ignored return value in snd_card_register 2008-11-18 18:27:58 +01:00
isadma.c [ALSA] Remove sound/driver.h 2008-01-31 17:29:48 +01:00
jack.c Merge branch 'topic/jack-mechanical' into to-push 2008-12-25 11:40:29 +01:00
Kconfig ALSA: Fix a typo in Kconfig 2008-10-29 16:08:01 +01:00
Makefile ALSA: Add hrtimer backend for ALSA timer interface 2008-10-24 18:16:50 +02:00
memalloc.c Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/torvalds/linux-2.6 2008-10-11 12:39:35 -07:00
memory.c [ALSA] Remove sound/driver.h 2008-01-31 17:29:48 +01:00
misc.c [ALSA] sound: this amplifier only goes up to 7 2008-04-24 12:00:35 +02:00
pcm_compat.c ALSA: Kill snd_assert() in sound/core/* 2008-08-13 11:46:35 +02:00
pcm_lib.c ALSA: kernel docs: fix sound/core/ kernel-doc 2008-10-16 08:44:20 +02:00
pcm_memory.c ALSA: Allocate larger pages in sgbuf 2008-08-25 09:57:38 +02:00
pcm_misc.c sound: add missing pcm kernel-doc 2008-10-18 11:05:36 +02:00
pcm_native.c saner FASYNC handling on file close 2008-11-01 09:49:46 -07:00
pcm_timer.c ALSA: Kill snd_assert() in sound/core/* 2008-08-13 11:46:35 +02:00
pcm.c ALSA: Kill snd_assert() in sound/core/* 2008-08-13 11:46:35 +02:00
rawmidi_compat.c [ALSA] Remove xxx_t typedefs: Raw MIDI 2006-01-03 12:17:35 +01:00
rawmidi.c ALSA: hda - Convert from takslet_hi_schedule() to tasklet_schedule() 2008-12-18 12:17:55 +01:00
rtctimer.c ALSA: hda - Convert from takslet_hi_schedule() to tasklet_schedule() 2008-12-18 12:17:55 +01:00
sgbuf.c ALSA: Allocate larger pages in sgbuf 2008-08-25 09:57:38 +02:00
sound_oss.c ALSA: Kill snd_assert() in sound/core/* 2008-08-13 11:46:35 +02:00
sound.c Check fops_get() return value 2009-01-06 15:59:11 -08:00
timer_compat.c ALSA: Kill snd_assert() in sound/core/* 2008-08-13 11:46:35 +02:00
timer.c ALSA: hda - Convert from takslet_hi_schedule() to tasklet_schedule() 2008-12-18 12:17:55 +01:00
vmaster.c [ALSA] Keep private TLV entry in vmaster itself 2008-04-24 12:00:12 +02:00