Revert "ALSA: pcm: Fix races among concurrent read/write and buffer changes"
This reverts commit 47711ff10c
.
It will come back after the next ABI break as it is needed to resolve
CVE-2022-1048. But for now, while testing, it can be reverted in order
to preserve the ABI.
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I5d4a52d443cffa34c8550b83c90d11a69da09cfc
This commit is contained in:
parent
f9e40dc812
commit
9f368dfefd
|
@ -1905,11 +1905,9 @@ static int wait_for_avail(struct snd_pcm_substream *substream,
|
|||
if (avail >= runtime->twake)
|
||||
break;
|
||||
snd_pcm_stream_unlock_irq(substream);
|
||||
mutex_unlock(&runtime->buffer_mutex);
|
||||
|
||||
tout = schedule_timeout(wait_time);
|
||||
|
||||
mutex_lock(&runtime->buffer_mutex);
|
||||
snd_pcm_stream_lock_irq(substream);
|
||||
set_current_state(TASK_INTERRUPTIBLE);
|
||||
switch (runtime->status->state) {
|
||||
|
@ -2203,7 +2201,6 @@ snd_pcm_sframes_t __snd_pcm_lib_xfer(struct snd_pcm_substream *substream,
|
|||
|
||||
nonblock = !!(substream->f_flags & O_NONBLOCK);
|
||||
|
||||
mutex_lock(&runtime->buffer_mutex);
|
||||
snd_pcm_stream_lock_irq(substream);
|
||||
err = pcm_accessible_state(runtime);
|
||||
if (err < 0)
|
||||
|
@ -2291,7 +2288,6 @@ snd_pcm_sframes_t __snd_pcm_lib_xfer(struct snd_pcm_substream *substream,
|
|||
if (xfer > 0 && err >= 0)
|
||||
snd_pcm_update_state(substream, runtime);
|
||||
snd_pcm_stream_unlock_irq(substream);
|
||||
mutex_unlock(&runtime->buffer_mutex);
|
||||
return xfer > 0 ? (snd_pcm_sframes_t)xfer : err;
|
||||
}
|
||||
EXPORT_SYMBOL(__snd_pcm_lib_xfer);
|
||||
|
|
Loading…
Reference in New Issue