Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp1759523rwe; Fri, 2 Sep 2022 03:26:40 -0700 (PDT) X-Google-Smtp-Source: AA6agR6W3qLua/rvpmqp5XoqioSn288dBoUgG4jysYSOXHdCB40CgaBkbGo3cjbyr5kCV2KmfBEV X-Received: by 2002:a17:907:3e12:b0:738:fd2f:df80 with SMTP id hp18-20020a1709073e1200b00738fd2fdf80mr27939909ejc.29.1662114400660; Fri, 02 Sep 2022 03:26:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662114400; cv=none; d=google.com; s=arc-20160816; b=gGc9H9X4ah11HFo8wgfWAXAPoKVGn9g2VSNyspDeaVAfYyqHlGPkUu4gRZ9ztiyA4C p9LQ15WDKk1t9po9nIOt6W7i1NsNKjm2bP7ANKVjckBTv6FOUiYUfeFwuquDew9786Si 0ADRR9Y0noefZuaSWayRhpq/M0TmtAuVcG3O9NTT5r6lkFLfafEuLSJvaHX7fEPeAmpG H+1FWV50B3t4QJivd4deDbbjreckmdkzLhhbx/vrtA61zJjivIGI9g5HiptYU8W/meII mNu0iHqqEEyQsj94UqBQsNBbtbu3I5Yo2x3a647lOX5+MpH+VL5NTg9zWjl0E7exY5Ha 96tQ== 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=USfCu5JPEMwM2WiZpg8NQr50wGhXxJAKMik11VHM0fY=; b=ujxVoVd+J6tXu8V38LT268BGHqCAlUMlFGJpVWddxnwDXWaUeqRVQXBGw6/AwlqMch NvHOIFiGqfnW2VrauoIqro5/nsH3ciA0aP097FE5pb0J3dD7gqv6AtefogrTZHAYFSGd jv2uvezhiVQ8aJtTBij3axMJGCA4BYGSjF9a1P6kT74f4DmF9bj3WPTRdetwvGWl/jS1 OmMQ7ARV5PYYV8vUwyJqtAKp6IK8XcXZYidWeUsC8rbfuM0y6aynTA8HRxWkpQiBFYEk q8tjuvVUfVzSEaeHRC6q5ZEMgXJKZQjSvU3q9DdtfsBW2Q8aaDK3lagoA79d2didOEPk apJg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ofDIoyha; 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 sh15-20020a1709076e8f00b00741a0720a2dsi1843279ejc.776.2022.09.02.03.26.13; Fri, 02 Sep 2022 03:26:40 -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=ofDIoyha; 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 S235793AbiIBKCo (ORCPT + 99 others); Fri, 2 Sep 2022 06:02:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52856 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235720AbiIBKCk (ORCPT ); Fri, 2 Sep 2022 06:02:40 -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 446779D8FF for ; Fri, 2 Sep 2022 03:02:39 -0700 (PDT) Received: by mail-wm1-x334.google.com with SMTP id c131-20020a1c3589000000b003a84b160addso2328267wma.2 for ; Fri, 02 Sep 2022 03:02:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; 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; bh=USfCu5JPEMwM2WiZpg8NQr50wGhXxJAKMik11VHM0fY=; b=ofDIoyhajScZQRnDZ1bOk8ZpgKjeJC2/OgvK4HTRa8zR7RroDnBdVv0MSPwtDOIewH hUVkznmqJKhHtVHm80SC+jnetKNx7B1TGdOxWQGyv1p47mNqK3L/Sm+i9iYM9F9LpnEf CSaUyQsDC+4yY6lht4bIhSaZgmPY6ctQ/ETYm+Qe4t60Ec/AbHDPSWlZfNoxBhoJRc+e gP/KEFaYySNNuSZX8YdfDOu14Z4EXmKj2olmTCyIGxfVuvDXDpDh1fxKPpQWzS1VFtrk hVfG2B3qQGqw9nrUlLUsRuUIAJXYLaKUELdH/M9QQlv7s0cEbzqrpmIw8J8QqCTrEhL0 6mKg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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; bh=USfCu5JPEMwM2WiZpg8NQr50wGhXxJAKMik11VHM0fY=; b=mAOirgrFraMqdPFiUoHg3oeQ8gH1vvGmPue8AkGY9fNLXRHHj7DfnuLVlIrkU0En80 Z8PGGvU4tXwysVwSs93Te3Bn82qxCSq8vyaz+yoOm2b3O6b+kM0jlyyzydMSNzlIBOrV TdgEd1wCQxH6sKts/tQdnWPwrb6lI9vJG4NRgwbufL2jSEVuTHBv1H8VWvshDpo7ZW3/ c8LvA+/9UuXsCLCoYHGFtXF5qOgakNySn0vOS6nSLTK0tbaw1C5IVzPTrFy6LBlKeEnU XdzvwbznnhI70Mha5BM+5L4qBgRfboiI0hg6I7uz3FbCRX0EJFURQ065yUOb7lhSWCoM mvjw== X-Gm-Message-State: ACgBeo1JPmPvxPG0TJgLnohoyCG6rX5j6nApNofe/7BQFJq0PnAAzMhe rSDlli6oX5HwvMPReKmBOfNldw== X-Received: by 2002:a05:600c:358e:b0:3a5:f19d:28db with SMTP id p14-20020a05600c358e00b003a5f19d28dbmr2360350wmq.76.1662112957744; Fri, 02 Sep 2022 03:02:37 -0700 (PDT) Received: from [192.168.86.238] (cpc90716-aztw32-2-0-cust825.18-1.cable.virginm.net. [86.26.103.58]) by smtp.googlemail.com with ESMTPSA id 24-20020a05600c22d800b003a6125562e1sm1618072wmg.46.2022.09.02.03.02.36 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 02 Sep 2022 03:02:37 -0700 (PDT) Message-ID: <01bdf6e2-f72a-e114-f3d2-deccf55403b1@linaro.org> Date: Fri, 2 Sep 2022 11:02:35 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0 Subject: Re: [PATCH 0/3] misc: fastrpc: fix memory corruption Content-Language: en-US To: Johan Hovold , Amol Maheshwari Cc: Greg Kroah-Hartman , Arnd Bergmann , Bjorn Andersson , Manivannan Sadhasivam , linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org References: <20220829080531.29681-1-johan+linaro@kernel.org> From: Srinivas Kandagatla In-Reply-To: <20220829080531.29681-1-johan+linaro@kernel.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.1 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,T_SCC_BODY_TEXT_LINE 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 Hi Johan, On 29/08/2022 09:05, Johan Hovold wrote: > The fastrpc driver uses a fixed-sized array to store its sessions but > missing and broken sanity checks could lead to memory beyond the array > being corrupted. > > This specifically happens on SC8280XP platforms that use 14 sessions for > the compute DSP. > Thanks for doing this. I see that we hit this issue once again, and the way we are fixing it is not really scalable. We should really get rid of FASTRPC_MAX_SESSIONS. We should allocate the sessions dynamically based in the child node count and qcom,nsessions. thanks, Srini > These are all needed for 6.0. > > Johan > > > Johan Hovold (3): > misc: fastrpc: fix memory corruption on probe > misc: fastrpc: fix memory corruption on open > misc: fastrpc: increase maximum session count > > drivers/misc/fastrpc.c | 14 +++++++++----- > 1 file changed, 9 insertions(+), 5 deletions(-) >