From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id EBAF2C369D9 for ; Wed, 30 Apr 2025 19:06:52 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id EDEB610E0A1; Wed, 30 Apr 2025 19:06:51 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.b="lBx6xqXf"; dkim-atps=neutral Received: from nyc.source.kernel.org (nyc.source.kernel.org [147.75.193.91]) by gabe.freedesktop.org (Postfix) with ESMTPS id 9BB1910E0A1 for ; Wed, 30 Apr 2025 19:06:50 +0000 (UTC) Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by nyc.source.kernel.org (Postfix) with ESMTP id 9D4CDA4B7C4; Wed, 30 Apr 2025 19:01:18 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1458EC4CEE7; Wed, 30 Apr 2025 19:06:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1746040006; bh=54IGMiZoSITdqFuruS1CfT7kOBbA4cCLxrOaIZ38igM=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=lBx6xqXfwDFmrjbUs2hgy2zDbXK/vNdfjGIhlftSbWHOroXMr0YsmGSPUq4eq6YD8 x5newvh0h4h85IG+RYltJLxbn5aRj9gONt/DE4L/+fHLyMWheN/sWg+9HPqVmla6Gp kDBktrQ0ZytBmKKOWAzQEOQvnXduiLQswyTxOyOAixXqEXBIc1NiAR46Q1ZMPcGZzg yl/wMbQvxBTC4y+vql6tMc9EbKiIO6Bn5U9YhGajsz9LYHLSCOyqNgfn4s0FyD76hs vnQUkmvLZnC8pbVmmovexV2Q+0ct24Sd1wt3PcNAq7EVEyGlM1S4F6Rc9Gf3jJGo8c zw4hU+IXA/XmQ== Date: Wed, 30 Apr 2025 12:06:43 -0700 From: Kees Cook To: Louis Chauvet Cc: Haneen Mohammed , Simona Vetter , Melissa Wen , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, linux-hardening@vger.kernel.org Subject: Re: [PATCH] drm/vkms: Adjust vkms_state->active_planes allocation type Message-ID: <202504301205.B3AD2E7@keescook> References: <20250426061431.work.304-kees@kernel.org> <823d4d24-da80-4834-95ca-d5698edfe18f@bootlin.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <823d4d24-da80-4834-95ca-d5698edfe18f@bootlin.com> X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" On Mon, Apr 28, 2025 at 10:18:34AM +0200, Louis Chauvet wrote: > > > Le 26/04/2025 à 08:14, Kees Cook a écrit : > > 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 "struct vkms_plane_state **", but the returned type > > will be "struct drm_plane **". These are the same size (pointer size), but > > the types don't match. Adjust the allocation type to match the assignment. > > I think this is an issue, can you add the proper Fixup tag in this commit? I think trailers updating tools like b4 will pick this up: Fixes: 8b1865873651 ("drm/vkms: totally reworked crc data tracking") Would you rather I send a v2 with the Fixes added? > > With this: > > Reviewed-by: Louis Chauvet Thanks! -Kees -- Kees Cook