ALSA: compress: Prevent bypasses of set_params
authorCharles Keepax <ckeepax@opensource.cirrus.com>
Mon, 22 Jul 2019 09:24:34 +0000 (10:24 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 25 Aug 2019 08:51:27 +0000 (10:51 +0200)
commit8d25080f4d84654929a7eca15cb2eddbd6337bfc
treef6301da6536167110af8a74e0b3171a82f8f36b1
parentdaa60696bdf4e59fcb304b3601b1e3f8cdb4f412
ALSA: compress: Prevent bypasses of set_params

[ Upstream commit 26c3f1542f5064310ad26794c09321780d00c57d ]

Currently, whilst in SNDRV_PCM_STATE_OPEN it is possible to call
snd_compr_stop, snd_compr_drain and snd_compr_partial_drain, which
allow a transition to SNDRV_PCM_STATE_SETUP. The stream should
only be able to move to the setup state once it has received a
SNDRV_COMPRESS_SET_PARAMS ioctl. Fix this issue by not allowing
those ioctls whilst in the open state.

Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Acked-by: Vinod Koul <vkoul@kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
sound/core/compress_offload.c