]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commitdiff
ASoC: compress: fix unsigned integer overflow check
authorXiaojun Sang <xsang@codeaurora.org>
Mon, 21 Oct 2019 09:54:32 +0000 (10:54 +0100)
committerMark Brown <broonie@kernel.org>
Mon, 21 Oct 2019 12:50:19 +0000 (13:50 +0100)
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.org
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/core/compress_offload.c

index 99b8821587053da0336e58586ca2ec55bff5f0e3..942af8c29b79f6a87331874898732eb6434c5335 100644 (file)
@@ -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;