Received: by 2002:a05:7412:bb8d:b0:d7:7d3a:4fe2 with SMTP id js13csp27174rdb; Mon, 14 Aug 2023 08:32:52 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFvvsT6tIiS1TuhXeBxFVREetutce69hoT2rrCwhCYmOIexdDDAaDCu3ccWrL7FUC48mVfb X-Received: by 2002:a17:902:cec7:b0:1bc:671d:6d2d with SMTP id d7-20020a170902cec700b001bc671d6d2dmr17516782plg.21.1692027171889; Mon, 14 Aug 2023 08:32:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1692027171; cv=none; d=google.com; s=arc-20160816; b=yt/vqwjAHBT88shSJEp1zFu4yoaYZtEgkO8TJrliZf1x0ZQaUep/shZLgwNhSrz7nW ArwGqWtgKfJqWgzl3SjGi3Z+Owch2Moa5Bo8IwfDq8cb5K0Tk5/+A2a/bg8eezBbrMc9 1BiK5yyI4P5HaGlKhhE2CL2L6x7JAqa+gb7cun9fGNRsGMIXc6Ple49ZGvcuRKZruq73 YW9bEugdxiRx/BiJ+y6dXY4Ps4b0II/3Y5CxcUtLIbJGkQnbkKRh/vw57RaK8cdiiKov 3yN8cN3MBLeEl7l1Ilnk5lu4udYPhja/hvcSZb+S5Gjg3tb8QhvaA6dqMQlIaERSRHec LGLw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=53j/5094r03iKS4uZK9mu72IHMP5gEBY2aqqyAGJwsg=; fh=U78sclg0Y4Gxw/OVnaUghVFQGh/K/BlwQoZ5+9IUuFc=; b=LYBA58T0vWXxx7iGB1zC2sYH/97eA1g363tMiBe+CLsp8g25jGvIBGr35fhLpNepF9 ZpxjkB9LRZd38q2C3jWUoe5FPvjvi8jmx1j5UlQ0NPyPZDvv6iSlhCrq3zV+PV8D4y2j uMPelP/DgRMtCzJxjUt3LAS0NraBeQE2M/7bttxNtZETwuJB31VDnaoGt6KHZ1tW6049 RZZCXN/KWbYVaRMATnxh08QLwxjoVDUuGYKvdRi5szrKmQwmO6Nd626Te+uVOKo1hmBd FWyLMSti8NogUGh/YXhC1auWGruRfuaGo3uxMZHmz1fqixvG38Z5U7UiaABHlz0KnXNl SDSQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=jQYADeKY; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s20-20020a170903215400b001bd9c43c88csi7900127ple.204.2023.08.14.08.32.38; Mon, 14 Aug 2023 08:32:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=jQYADeKY; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229882AbjHNOQB (ORCPT + 99 others); Mon, 14 Aug 2023 10:16:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36156 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232295AbjHNOP4 (ORCPT ); Mon, 14 Aug 2023 10:15:56 -0400 Received: from mail-wm1-x332.google.com (mail-wm1-x332.google.com [IPv6:2a00:1450:4864:20::332]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C6FB719B5 for ; Mon, 14 Aug 2023 07:15:32 -0700 (PDT) Received: by mail-wm1-x332.google.com with SMTP id 5b1f17b1804b1-3fe45481edfso44445265e9.1 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=chof9L9lKnw87LRI12ETrWdRSM5jWOMG4iSq3/eWWK0wTZb9JiQd8pUSB751X1sgBA mrcn6uDBQPc7apK6Y7Bkgwom5R9sWQkzYZQLmABhX5oR+JShqxM3GprepSyYS7L73Qrq 2AkSfPXZZsumzb8wR/pT7vSdHWEBphKO8Jou26xu8Nqyk8MTuUxF5gsHlKKnOCKDHUvA jWJud7D1mrrYaiQxDgFSriqUGI1sC1ZBtFtA0ASxhzUEIVsy0+OUezHZM1ZTodhcsY8H fM2qIoN4z0AhkDpD0TPpXxCvgnKkfsJW1zqRhmrJF0ZZdHX6JwvgZZGNMpxWTSaeqYxz 7xMA== X-Gm-Message-State: AOJu0Yy1KbG6pEZYW7LDxZoybqy+UEV1VDQ6SUhD1pK82MbXVkREuv+t B7ozh6aJuYGXRg+lDx9xlXKTcQ== 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 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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