From nobody Sat Feb 7 20:57:16 2026 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 904FC2EAB6F; Fri, 6 Feb 2026 22:21:54 +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=1770416514; cv=none; b=Tn0MwdUKzcIyD9+VOmE6Di8wi4TraV2WgGDXBavisjn16DretD/6KS+fXuOjA8QrlS4Su6KWMP2ZG5I7p9wI+E8ex3Q0Cjrngg1eLPaQwHFqFb7JEQmubw8IMxqRfNfDcOaQU4zbUK/KmxsRQ7Ybw5d1Y4uTfsY0Sqv/oMEALfU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770416514; c=relaxed/simple; bh=oQRJiNUzubJ19Wx1XgCCgnTsTPuzcvWNLC/cnrc8QvA=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=hnIVx0IJwh5b/4SzDAju1qF1jR7D4p9v5Dq5CoNeivpkempOFExqFDXvvYBtdYktaFcVuscPJDRWv24cba2Ik7+U2m0DtoulQ/0X1cwwTkYo1n4kVytjjyq3iOtzytZGjX31gTiv0kTKC3AOtKA99WCPgkcyQG34GCdfF9JjocI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=sclpwADi; 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="sclpwADi" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 28699C116C6; Fri, 6 Feb 2026 22:21:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1770416514; bh=oQRJiNUzubJ19Wx1XgCCgnTsTPuzcvWNLC/cnrc8QvA=; h=From:To:Cc:Subject:Date:From; b=sclpwADixRMuZ09rsS1t0+O7jiwtqiALgjAvTpNzHJe46dn1GLZrEVe3OQvWi8zaN eewMrCWCfW1ix2SlZaTLQ+8a41A5GFAREv+8nLah3M5n4njJDFD/m2Pvx2qwhs0atX pncuF/CBxCE3EkFBzSqESpEcfpBXD0eBYlczOdytUiYHpniryUqydOaCir4QefkFwl C2Dm9kVkfUNqvPhOe5NiPR5Q3vJrlTEV+nyb5vKdfK0l6CF/XCivVgsvLA0lwpe7z3 mXkOEWFoGnMprJGcq3gnn3IzFN7zJecQMVYdQG78RB1rt4djxPRxhG2RQ1QNFsue9R eu6i4u3Y4IQbA== From: Kees Cook To: Rob Clark Cc: Kees Cook , Dmitry Baryshkov , Abhinav Kumar , Jessica Zhang , Sean Paul , Marijn Suijten , David Airlie , Simona Vetter , linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org, linux-kernel@vger.kernel.org, linux-hardening@vger.kernel.org Subject: [PATCH] drm/msm: Adjust msm_iommu_pagetable_prealloc_allocate() allocation type Date: Fri, 6 Feb 2026 14:21:52 -0800 Message-Id: <20260206222151.work.016-kees@kernel.org> X-Mailer: git-send-email 2.34.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1662; i=kees@kernel.org; h=from:subject:message-id; bh=oQRJiNUzubJ19Wx1XgCCgnTsTPuzcvWNLC/cnrc8QvA=; b=owGbwMvMwCVmps19z/KJym7G02pJDJltmfU7n93tvD9HSCh32WPFpydTev27djntL71dv6nLQ klTZkJRRykLgxgXg6yYIkuQnXuci8fb9nD3uYowc1iZQIYwcHEKwER2/2Bk2G3cZGIa2u5sOuf5 Dob2quKXmfEX/ITi5S9Mm8FovvlIGcP/muT/Cwseapy52xnKmXqkIFVl1sqSU/vVRAUVd/HFNLs yAQA= X-Developer-Key: i=kees@kernel.org; a=openpgp; fpr=A5C3F68F229DD60F723E6E138972F4DFDC6DC026 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" In preparation for making the kmalloc family of allocators type aware, we need to make sure that the returned type from the allocation matches the type of the variable being assigned. (Before, the allocator would always return "void *", which can be implicitly cast to any pointer type.) The assigned type is "void **" but the returned type will be "void ***". These are the same allocation size (pointer size), but the types do not match. Adjust the allocation type to match the assignment. Signed-off-by: Kees Cook Reviewed-by: Dmitry Baryshkov --- Cc: Rob Clark Cc: Dmitry Baryshkov Cc: Abhinav Kumar Cc: Jessica Zhang Cc: Sean Paul Cc: Marijn Suijten Cc: David Airlie Cc: Simona Vetter Cc: Cc: Cc: --- drivers/gpu/drm/msm/msm_iommu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/msm/msm_iommu.c b/drivers/gpu/drm/msm/msm_iomm= u.c index d5dede4ff761..271baf4dc4e8 100644 --- a/drivers/gpu/drm/msm/msm_iommu.c +++ b/drivers/gpu/drm/msm/msm_iommu.c @@ -332,7 +332,7 @@ msm_iommu_pagetable_prealloc_allocate(struct msm_mmu *m= mu, struct msm_mmu_preall struct kmem_cache *pt_cache =3D get_pt_cache(mmu); int ret; =20 - p->pages =3D kvmalloc_array(p->count, sizeof(p->pages), GFP_KERNEL); + p->pages =3D kvmalloc_array(p->count, sizeof(*p->pages), GFP_KERNEL); if (!p->pages) return -ENOMEM; =20 --=20 2.34.1