[alsa-devel] [PATCH] ASoC: compress: fix unsigned integer overflow check
From: Xiaojun Sang xsang@codeaurora.org
Parameter fragments and fragment_size are type of u32. U32_MAX is the correct check.
Signed-off-by: Xiaojun Sang xsang@codeaurora.org Signed-off-by: Srinivas Kandagatla srinivas.kandagatla@linaro.org --- sound/core/compress_offload.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sound/core/compress_offload.c b/sound/core/compress_offload.c index 41905afada63..f34ce564d92c 100644 --- a/sound/core/compress_offload.c +++ b/sound/core/compress_offload.c @@ -528,7 +528,7 @@ static int snd_compress_check_input(struct snd_compr_params *params) { /* first let's check the buffer parameter's */ if (params->buffer.fragment_size == 0 || - params->buffer.fragments > INT_MAX / params->buffer.fragment_size || + params->buffer.fragments > U32_MAX / params->buffer.fragment_size || params->buffer.fragments == 0) return -EINVAL;
On 21-10-19, 10:54, Srinivas Kandagatla wrote:
From: Xiaojun Sang xsang@codeaurora.org
Parameter fragments and fragment_size are type of u32. U32_MAX is the correct check.
Acked-by: Vinod Koul vkoul@kernel.org
Signed-off-by: Xiaojun Sang xsang@codeaurora.org Signed-off-by: Srinivas Kandagatla srinivas.kandagatla@linaro.org
sound/core/compress_offload.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sound/core/compress_offload.c b/sound/core/compress_offload.c index 41905afada63..f34ce564d92c 100644 --- a/sound/core/compress_offload.c +++ b/sound/core/compress_offload.c @@ -528,7 +528,7 @@ static int snd_compress_check_input(struct snd_compr_params *params) { /* first let's check the buffer parameter's */ if (params->buffer.fragment_size == 0 ||
params->buffer.fragments > INT_MAX / params->buffer.fragment_size ||
return -EINVAL;params->buffer.fragments > U32_MAX / params->buffer.fragment_size || params->buffer.fragments == 0)
-- 2.21.0
The patch
ASoC: compress: fix unsigned integer overflow check
has been applied to the asoc tree at
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-5.4
All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying to this mail.
Thanks, Mark
From d3645b055399538415586ebaacaedebc1e5899b0 Mon Sep 17 00:00:00 2001
From: Xiaojun Sang xsang@codeaurora.org Date: Mon, 21 Oct 2019 10:54:32 +0100 Subject: [PATCH] ASoC: compress: fix unsigned integer overflow check
Parameter fragments and fragment_size are type of u32. U32_MAX is the correct check.
Signed-off-by: Xiaojun Sang xsang@codeaurora.org Signed-off-by: Srinivas Kandagatla srinivas.kandagatla@linaro.org Acked-by: Vinod Koul vkoul@kernel.org Link: https://lore.kernel.org/r/20191021095432.5639-1-srinivas.kandagatla@linaro.o... Signed-off-by: Mark Brown broonie@kernel.org --- sound/core/compress_offload.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sound/core/compress_offload.c b/sound/core/compress_offload.c index 99b882158705..942af8c29b79 100644 --- a/sound/core/compress_offload.c +++ b/sound/core/compress_offload.c @@ -528,7 +528,7 @@ static int snd_compress_check_input(struct snd_compr_params *params) { /* first let's check the buffer parameter's */ if (params->buffer.fragment_size == 0 || - params->buffer.fragments > INT_MAX / params->buffer.fragment_size || + params->buffer.fragments > U32_MAX / params->buffer.fragment_size || params->buffer.fragments == 0) return -EINVAL;
participants (3)
-
Mark Brown
-
Srinivas Kandagatla
-
Vinod Koul