From patchwork Mon Oct 21 09:54:32 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 11201761 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 000A413B1 for ; Mon, 21 Oct 2019 09:55:54 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 09AC32070B for ; Mon, 21 Oct 2019 09:55:53 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="WAzs4Kqh"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="e1AsVdc8" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 09AC32070B Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-devel-bounces@alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id C827615E2; Mon, 21 Oct 2019 11:55:01 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz C827615E2 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1571651751; bh=FRKRZWr2Zk7aijmj/K5y2yp7T5qtWgocH1WNk/6tTLQ=; h=From:To:Date:Cc:Subject:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From; b=WAzs4KqhOnGOvoS/YyTFbegiu1R64Ndo6E5JyN+u1Somh4AKr5yH9tPF182B9USYj JMP9Vh+/y2n78wj+miS6aOtIrkz8JKCt+nWISuJ2O+6ZmjB161FeIaVtU1R6p3Hdnm k6GU3ndUFU/my4sFV9p9PmLXvB4uOxdCUV668kk8= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 32E17F80321; Mon, 21 Oct 2019 11:55:01 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id 85403F80368; Mon, 21 Oct 2019 11:54:59 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on alsa1.perex.cz X-Spam-Level: X-Spam-Status: No, score=-0.1 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from mail-wm1-x342.google.com (mail-wm1-x342.google.com [IPv6:2a00:1450:4864:20::342]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id E08EFF80112 for ; Mon, 21 Oct 2019 11:54:56 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz E08EFF80112 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="e1AsVdc8" Received: by mail-wm1-x342.google.com with SMTP id g24so3365568wmh.5 for ; Mon, 21 Oct 2019 02:54:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=l0PmgB8vQ7ayVyix5K/Wkc67Lw4jYhDf6SJZvdZy4h8=; b=e1AsVdc8VihT2c2OlLCjWb5VLG7pyRJ4T55phPemU7G4sWlW34Lvt95lTaydF1icpA +zU5+DfY4DvLijMUV45po1l2oozJXcn5DE1oTFSzEhFSxNcYqAH7ePcLWhH3byUk0r46 7XFEtSlSvtWh7wBVMut6ZquVplJMCt+1b2XC+zhRobOyHKa2u4DLku1Bk4VNdgBgFK0E L7JEE2Uf9jYYNx1mQ/yP9gd1vEcGpH+JtGwuchn7HsqrDuDUSXRDZPVD4Nui0p8PAK4I xXp+QbWsw465VGPlmZIDxQAFJXVr5nLOzZrMV14g+HA/lgnTyFBfbrMD/OeiKt7Y+Skr T4Fg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=l0PmgB8vQ7ayVyix5K/Wkc67Lw4jYhDf6SJZvdZy4h8=; b=Uev8GyC1IGfYMZd5vOcUaUDlA/1d2S2XPoC3nLnhVJ2uLY6Hp9ZSCUEzW7aq73yl0p cRTkrIG4hM6B1JG3Fa1amGerfJTCLZEg4m0rkdB3yv4E5RGho1R5dzlkZJdejGL8H6xt BaxUOJUcSqhih4u3J7tUPElgkqJGVRNeB2FHxNi+iY7ZOmK/muYOsxxNSFaudW7dq1NM 5rQ3TDqfDb906RAYYc4dy/0eTfHlaFDqLcU9Bv1bHPFfca6qQMM3qUaeKsS2rwqbRMQZ OC5w2QsZBnhlzmGC9UZZxVfYO7NG9qp/I0lBYa+Jnj0Azokda/2x6JmW/enK3jBRtqmv lVzw== X-Gm-Message-State: APjAAAUbzglXCI2wXLYbrMPoXVxbOd7BqehZgCmoKRaiOAc5hvSVexId 1YVbu5BCRziys9iWc/aOFPf1Og== X-Google-Smtp-Source: APXvYqzPFx9XzxEnT1i23LUwKiFnLQGT3YA6PskIYIlobCBL8ThRsnhMtCJyhmLtlI0/hI9FW7aeZA== X-Received: by 2002:a1c:5609:: with SMTP id k9mr18142735wmb.103.1571651695736; Mon, 21 Oct 2019 02:54:55 -0700 (PDT) Received: from srini-hackbox.lan (cpc89974-aztw32-2-0-cust43.18-1.cable.virginm.net. [86.30.250.44]) by smtp.gmail.com with ESMTPSA id v11sm12356283wml.30.2019.10.21.02.54.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Oct 2019 02:54:54 -0700 (PDT) From: Srinivas Kandagatla To: broonie@kernel.org, vkoul@kernel.org, tiwai@suse.com Date: Mon, 21 Oct 2019 10:54:32 +0100 Message-Id: <20191021095432.5639-1-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.21.0 MIME-Version: 1.0 Cc: Srinivas Kandagatla , alsa-devel@alsa-project.org, bgoswami@codeaurora.org, Xiaojun Sang , spapothi@codeaurora.org Subject: [alsa-devel] [PATCH] ASoC: compress: fix unsigned integer overflow check X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" From: Xiaojun Sang Parameter fragments and fragment_size are type of u32. U32_MAX is the correct check. Signed-off-by: Xiaojun Sang Signed-off-by: Srinivas Kandagatla Acked-by: Vinod Koul --- 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;