summaryrefslogtreecommitdiffstats
path: root/sound/pci/echoaudio/darla20.c
diff options
context:
space:
mode:
authorBo Chen <chenbo@pdx.edu>2018-06-01 00:35:18 +0200
committerTakashi Iwai <tiwai@suse.de>2018-06-01 09:38:54 +0200
commita3aa60d511746bd6c0d0366d4eb90a7998bcde8b (patch)
treec680e0958aa6bee4408fdbf26254a284ba683748 /sound/pci/echoaudio/darla20.c
parentALSA: oxygen: use match_string() helper (diff)
downloadlinux-a3aa60d511746bd6c0d0366d4eb90a7998bcde8b.tar.xz
linux-a3aa60d511746bd6c0d0366d4eb90a7998bcde8b.zip
ALSA: hda - Handle kzalloc() failure in snd_hda_attach_pcm_stream()
When 'kzalloc()' fails in 'snd_hda_attach_pcm_stream()', a new pcm instance is created without setting its operators via 'snd_pcm_set_ops()'. Following operations on the new pcm instance can trigger kernel null pointer dereferences and cause kernel oops. This bug was found with my work on building a gray-box fault-injection tool for linux-kernel-module binaries. A kernel null pointer dereference was confirmed from line 'substream->ops->open()' in function 'snd_pcm_open_substream()' in file 'sound/core/pcm_native.c'. This patch fixes the bug by calling 'snd_device_free()' in the error handling path of 'kzalloc()', which removes the new pcm instance from the snd card before returns with an error code. Signed-off-by: Bo Chen <chenbo@pdx.edu> Cc: <stable@vger.kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/echoaudio/darla20.c')
0 files changed, 0 insertions, 0 deletions