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 2B9F138F64E for ; Thu, 26 Mar 2026 19:14:10 +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=1774552451; cv=none; b=VAwBGX4svDT+PDX0ka3Yy4J/h9BwmMiHud9a9iyJ3nwA/4wFejhYP6yc44e9tU2yOCTY9+ZdA9rXOc2TYLHYkKq1FV7CfW49KBl/1U2O7ykGB71GorfkaNYgdxsCWhcVo597ACAR7r9PkRp51Jq6jJ9QRCBtcwOJt0MgVvjD/vM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774552451; c=relaxed/simple; bh=XPkKuAmS1FrAmeq9f1O5w4bxL4MZd+YzwQlOdwFrkPk=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=RVVTkjh2vxS8qgV8ESZt8+NgCpuAx15wcuq4t1ubxzWBQRw5hR9nKZujHhjwpNWGLLC9Oj7gqYvSmf//GAlnDKXvRGylpirt5+X3eZdE3ztE3DCe2MMMNrsCtEzibs37cxVeYer6w/sm19alKah+Va/oqg2vtem6P6Mh44nNybk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=KgQvVG3X; 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="KgQvVG3X" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 87833C116C6; Thu, 26 Mar 2026 19:14:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1774552450; bh=XPkKuAmS1FrAmeq9f1O5w4bxL4MZd+YzwQlOdwFrkPk=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=KgQvVG3XTA98t5PzoqUFDpF70q2V7DDzuagpZKMg0BWvc0V8aSlc8lMS+zmamJdzA KL0XM0h9wbssXGphYfGXwIZZpcukb1mPktrz1GRgafewDqqw45wChxvUKM9QV9Daib ogqrg7+SjZWBgOTo2b645BIS+fW4xN4ULZABC3mQ6Q3GV8tcJDpUYrrJoQocQFT6ms JlhjV/V89y00ClsG32bwh1S+CysEv96xb43lxCkVdjj2LQfMlcF6yOX7kupEsM7vUX k4uvw7J07BK4Pk3v6oB6V/2zQvX3fTZ5BfslWoeBvVr7EXpjuF+7xwn9JHZULNkyne KtzBMMxiE+kcw== Date: Thu, 26 Mar 2026 12:14:09 -0700 From: Drew Fustini To: Michal Wilczynski Cc: drew@pdp7.com, guoren@kernel.org, wefu@redhat.com, ulf.hansson@linaro.org, linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org, Dan Carpenter Subject: Re: [PATCH v1] firmware: thead: Fix buffer overflow and use standard endian macros Message-ID: References: <20250403131051.1097423-1-m.wilczynski@samsung.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: <20250403131051.1097423-1-m.wilczynski@samsung.com> On Thu, Apr 03, 2025 at 03:10:51PM +0200, Michal Wilczynski wrote: > Addresses two issues in the TH1520 AON firmware protocol driver: > > 1. Fix a potential buffer overflow where the code used unsafe pointer > arithmetic to access the 'mode' field through the 'resource' pointer > with an offset. This was flagged by Smatch static checker as: > "buffer overflow 'data' 2 <= 3" > > 2. Replace custom RPC_SET_BE* and RPC_GET_BE* macros with standard > kernel endianness conversion macros (cpu_to_be16, etc.) for better > portability and maintainability. > > The functionality was re-tested with the GPU power-up sequence, > confirming the GPU powers up correctly and the driver probes > successfully. > > [ 12.702370] powervr ffef400000.gpu: [drm] loaded firmware > powervr/rogue_36.52.104.182_v1.fw > [ 12.711043] powervr ffef400000.gpu: [drm] FW version v1.0 (build > 6645434 OS) > [ 12.719787] [drm] Initialized powervr 1.0.0 for ffef400000.gpu on > minor 0 > > Fixes: e4b3cbd840e5 ("firmware: thead: Add AON firmware protocol driver") > Reported-by: Dan Carpenter > Closes: https://lore.kernel.org/all/17a0ccce-060b-4b9d-a3c4-8d5d5823b1c9@stanley.mountain/ > Signed-off-by: Michal Wilczynski Acked-by: Drew Fustini Is Ulf the person that would take this fix? Thanks, Drew