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: 177038 Delivered-To: patch@linaro.org Received: by 2002:a92:409a:0:0:0:0:0 with SMTP id d26csp3180917ill; Mon, 21 Oct 2019 02:55:52 -0700 (PDT) X-Google-Smtp-Source: APXvYqw57LDPmcJ4c3Crx5a5+2WTWccOecLwlNI0QehMsN5ye/DotN4HPQjfbINKsfRmfjct5l7G X-Received: by 2002:a1c:9ec6:: with SMTP id h189mr17597062wme.71.1571651752798; Mon, 21 Oct 2019 02:55:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571651752; cv=none; d=google.com; s=arc-20160816; b=O6oeSk/4KXKxEEg2ii8uQmxT7Cm1ZkWkqCYnCDA+xBSXBbwq5tmTRwvAUs+FbmWTE6 VlXd6xiNLiyQord+sO5et/PueG1u9FyovFmXKD+ndh3Pak6/vSBJFfGffyvP3F3US5pK F0H7SpnKcPQbUl3+UNyoJG9tVbV8AGKdZfvM3kF1mqpluldhmXER3aWWv31/2uFpO7dF CKmstuA+94nzJmklLfwK61X9Gq+/szFptvgdDXyuEQ4v0u6EaknSqG6767d888eO0utF 4Is2H07hjZ4iU4w04b0x+LKDPoYVtj/guVSi4tQ7qWtIDVAOCA6+g8TrFAIXeKG1aHWf +4/Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:list-subscribe:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence:subject :cc:mime-version:message-id:date:to:from:dkim-signature:dkim-filter :delivered-to:dkim-signature:dkim-filter; bh=4847MCrMcerSzLzP9eEy+7IdTUpTOpB+AnfPHJxyngI=; b=E77IKM9/u128Biw4Nnsz6uBvQOJnHbRz+tSC25BIPhVWi68WjRnqPLddZpG/1RpDrU y0E1WwNdcvG6inqVZ5dm1KN+8ik6Hc+vukfP/cL77MrZMa4PpFSinK1VBZXm9jeB2IfE Dk1egy+QNz80LnfMorAKvsZRbD0Wxvx3MhFMuTfhWTZBnWUrenbHi7H+lORVtWUkA9p9 kRP35HJhpk+IxFIgPx4zD9E/LGlEnr6wtht2h4GPDflsiZz6u74x3T2tSRhLsP+sF2n0 gfwgxoL1B0+nkhiuS4snSlVJwleO6dUSgLC56kTlTjaXeaBcbcLA0YiNFdzy7C7pa+O1 FsLA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@alsa-project.org header.s=default header.b=WAzs4Kqh; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=e1AsVdc8; spf=pass (google.com: domain of alsa-devel-bounces@alsa-project.org designates 77.48.224.243 as permitted sender) smtp.mailfrom=alsa-devel-bounces@alsa-project.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from alsa0.perex.cz (alsa0.perex.cz. [77.48.224.243]) by mx.google.com with ESMTPS id k13si11203080wmi.20.2019.10.21.02.55.52 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 21 Oct 2019 02:55:52 -0700 (PDT) Received-SPF: pass (google.com: domain of alsa-devel-bounces@alsa-project.org designates 77.48.224.243 as permitted sender) client-ip=77.48.224.243; Authentication-Results: mx.google.com; dkim=pass header.i=@alsa-project.org header.s=default header.b=WAzs4Kqh; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=e1AsVdc8; spf=pass (google.com: domain of alsa-devel-bounces@alsa-project.org designates 77.48.224.243 as permitted sender) smtp.mailfrom=alsa-devel-bounces@alsa-project.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.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-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 --- sound/core/compress_offload.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.21.0 _______________________________________________ Alsa-devel mailing list Alsa-devel@alsa-project.org https://mailman.alsa-project.org/mailman/listinfo/alsa-devel Acked-by: Vinod Koul 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;