From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9294A3A1E7F for ; Wed, 13 May 2026 17:16:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778692562; cv=none; b=WpqCeZUn+VTink9tPqPpXTtAtX4VdFKZXmL7fiwPQlqcaX3pjcN5nCoWNC5Wkw+/H8F7XI1Grcs+a9g2PmWZ3n76ZwX4Zld3M5hE2LyjJ30FJ7sLXTGR9rPAZXtFse7dI+yksB4zsToBxzlnEckIbbliIPVSOBwBrhU3wMHdA4M= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778692562; c=relaxed/simple; bh=nRZP6LKuEzzracjuGw68q45/oGYJDcvKC/EhfBOCW8Q=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=sSNQ+VIJKjpmvvlYtxVv0SSLxnOQedkgsM6sOPt57Jsv3VIkib5jY1EZ8Qe8jafp0ppH8nfVnzHsRVbVLKxcGKwlSWKkZmJaFjgeuec4bk/oQ8DpYrMe5XGCoawTYWQK9c2rBbtcjH9EYA/xoHvks+5SyHSR24J7RlQ6yY0WcNk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=G87FR0co; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="G87FR0co" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 32C0EC19425; Wed, 13 May 2026 17:16:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1778692562; bh=nRZP6LKuEzzracjuGw68q45/oGYJDcvKC/EhfBOCW8Q=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=G87FR0co1Q1SO5vv4csjGaFLr7HFN8TB7qOraNCmPluF3HE/qCp6hkiCIsYvlYK3i iEyjxFRgvnjyXZHsQHc/eUYjIF53xoi5nElH7KZVnGltA/8FDku4CqEH2LlEv6SwDS m0HcgNBcB7lebY+hOddUGHsGFeSDDm2Ek64M7L0nvOjyJ/JDh1+ElGz45J35Y1J3lu bGbQJimAzo8G7l/6fKbdLHUDqOeF/FcbhDYx1FKEv1jlfeh6SokAxljAkoqQsEcCo9 6LMuqrbE4InDFKcVwKaUAc6s2Nwgqp8yp6CV3MtJM1WCQX78M+bnE5Sy7yEwEF9Isp J6yf1E5f38aiA== Date: Wed, 13 May 2026 18:15:58 +0100 From: Sudeep Holla To: Jamie Nguyen Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Sudeep Holla Subject: Re: [PATCH] firmware: arm_ffa: honor descriptor size in PARTITION_INFO_GET_REGS Message-ID: <20260513-tremendous-conscious-sunfish-06eecb@sudeepholla> References: <20260513032800.68807-1-jamien@nvidia.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20260513032800.68807-1-jamien@nvidia.com> On Tue, May 12, 2026 at 08:28:00PM -0700, Jamie Nguyen wrote: > __ffa_partition_info_get_regs() walks the response with a hardcoded > 24-byte stride (regs += 3) even though the SPMC tells us the actual > per-descriptor size via PARTITION_INFO_SZ in x2[63:48]. The size is > read into buf_sz and then thrown away. > > That works while every SPMC returns the FF-A v1.1 layout, but it falls > apart against a v1.3 SPMC returning the 48-byte descriptor. The loop > strides over half a descriptor at a time and ends up parsing every > other entry from a slice of two adjacent ones. > > The FF-A spec (v1.2, section 18.5) says that the producer should > report the descriptor size, and the consumer is supposed to stride by > that size and ignore any trailing fields it doesn't understand. The > non-REGS path (__ffa_partition_info_get) does this already, and the > REGS path should match. > > Use buf_sz for the stride, and bail out with -EPROTO if the SPMC > reports something we can't safely walk. > Can you check if the issue is addressed in -next by: Commit 3974ea193840 ("firmware: arm_ffa: Bound PARTITION_INFO_GET_REGS copies") -- Regards, Sudeep