From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8ADA8C41513 for ; Mon, 14 Aug 2023 14:16:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229665AbjHNOQA (ORCPT ); Mon, 14 Aug 2023 10:16:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36212 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232272AbjHNOP4 (ORCPT ); Mon, 14 Aug 2023 10:15:56 -0400 Received: from mail-wm1-x334.google.com (mail-wm1-x334.google.com [IPv6:2a00:1450:4864:20::334]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2749B19B1 for ; Mon, 14 Aug 2023 07:15:32 -0700 (PDT) Received: by mail-wm1-x334.google.com with SMTP id 5b1f17b1804b1-3fe8a1591c7so28967735e9.3 for ; Mon, 14 Aug 2023 07:15:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1692022530; x=1692627330; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=53j/5094r03iKS4uZK9mu72IHMP5gEBY2aqqyAGJwsg=; b=jQYADeKY/FfySjh679B5lqdzESsU3vaZWyIkn8/2CkdsmPygJKKPulBPVuvIK/rVJT ZYuXqhNJsmql/F6vi8zujMzC4xtzqhgWLQRfBoaxCl2JWsNrIua1zi4ySrgKq1+nL5V8 taqIUgJmfSw7Mje+yOybUDxE97OjiEZsWm1/XfS5mDQWhw47SxQqItQ4CkqCKtGFuydy DqOoNwL6eenKYoGIaVKJOm5Nxnh2Zq+Mv7fzdgda1l8uCC6DH/pap+U9rN2CUbWShxxn W2vo2JfTP2EudCJJ0jUwI4kBCRKJE/xPvDS1b0zjobpxLuXKBQwUXNLTqcDmQmZcX9+k x3dw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692022530; x=1692627330; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=53j/5094r03iKS4uZK9mu72IHMP5gEBY2aqqyAGJwsg=; b=OiUcc3ODlXTJMzDGqH1KvaJW5LYtcf3vI145SwnnYM7XJ/GC3kT9aKGlT+j0DLfipr utxyh7o0w6CB9Q8YpNYOtgbtnrlsGCqi8Xv/4BrZfcbOKaLPhOi1jbP0JEfYTj810826 cAV/IaDdFmb1yIl9B/lka7m26Q0PJIe8oFUEaQhDqMWhvMWC/8aLTI+cxmarPH+twlzl SqdCIAhQlJz8uS1vi3DQE8iJZa4a+NSUjQ/d8G1imdJZ14HMEM16ouqQj5KcgaoE8Hk0 drzgC52T3Icb/ZZmFkxdXlK2OYJSpYC/KkE5xxSli9VulgWmsQvgZ561yFq/EdAOvTgb 4hVw== X-Gm-Message-State: AOJu0YyDrc6Ec6T4kQ3DY8hMfQL4xKHvkf9e5CuRMNEYllWX63V7sCib ffECskaNW0ZO0RRfTbClliFptw== X-Google-Smtp-Source: AGHT+IGq98nhB7kEk3xjrvjG0zOByhEQOpwZY9relAnXA4NePzVIuBzhokeQ9etQcTU1AAyA7ZN+Mg== X-Received: by 2002:a05:600c:230f:b0:3fa:964e:e85 with SMTP id 15-20020a05600c230f00b003fa964e0e85mr7764653wmo.5.1692022530328; Mon, 14 Aug 2023 07:15:30 -0700 (PDT) Received: from [192.168.0.162] (188-141-3-169.dynamic.upc.ie. [188.141.3.169]) by smtp.gmail.com with ESMTPSA id l18-20020a5d4112000000b003144b95e1ecsm14414401wrp.93.2023.08.14.07.15.29 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 14 Aug 2023 07:15:29 -0700 (PDT) Message-ID: Date: Mon, 14 Aug 2023 15:15:28 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.8.0 Subject: Re: [PATCH v2 4/4] venus: hfi_parser: Add check to keep the number of codecs within range Content-Language: en-US To: Vikash Garodia , stanimir.k.varbanov@gmail.com, agross@kernel.org, andersson@kernel.org, konrad.dybcio@linaro.org, mchehab@kernel.org, hans.verkuil@cisco.com, tfiga@chromium.org Cc: linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org References: <1691634304-2158-1-git-send-email-quic_vgarodia@quicinc.com> <1691634304-2158-5-git-send-email-quic_vgarodia@quicinc.com> <2214c31b-eca2-012e-a100-21252a724e7c@quicinc.com> <8b72ce47-c338-2061-f11a-c0a608686d8c@linaro.org> <8f1a4ca0-dde8-fa5d-bca3-d317886609de@linaro.org> <060f4dbe-63d6-1c60-14ca-553bf1536e5a@quicinc.com> From: Bryan O'Donoghue In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org On 14/08/2023 07:34, Vikash Garodia wrote: >> We have two loops that check for up to 32 indexes per loop. Why not have a >> capabilities index that can accommodate all 64 bits ? > Max codecs supported can be 32, which is also a very high number. At max the > hardware supports 5-6 codecs, including both decoder and encoder. 64 indices is > would not be needed. > But the bug you are fixing here is an overflow where we have received a full range 32 bit for each decode and encode. How is the right fix not to extend the storage to the maximum possible 2 x 32 ? Or indeed why not constrain the input data to 32/2 for each encode/decode path ? The bug here is that we can copy two arrays of size X into one array of size X. Please consider expanding the size of the storage array to accommodate the full size the protocol supports 2 x 32. --- bod