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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 14B4DC4708E for ; Wed, 4 Jan 2023 12:41:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239233AbjADMla (ORCPT ); Wed, 4 Jan 2023 07:41:30 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58594 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230249AbjADMl3 (ORCPT ); Wed, 4 Jan 2023 07:41:29 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5A64417E1A; Wed, 4 Jan 2023 04:41:28 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 0A70DB81629; Wed, 4 Jan 2023 12:41:27 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 32396C433D2; Wed, 4 Jan 2023 12:41:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1672836085; bh=TOXTQ60NVRt1UUZ7zJB1nKXUtQdnqTmRrybEAGs47wA=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=eRG5aar/3NtyK6sTqpmMnnO4GuWi0LCInUB6dkAtQXjlLDWjw9LKhNFakYC1j6lTI pUnuDZ1JtTo5R1G93Kb4FbbrqLXbLJFmwzj4eKv1kplm1h8E0pR5vkRAy58xli7oPv H356a3QfNzlrx9nlcPS+2Sr+njyBTFzdwO94oaus= Date: Wed, 4 Jan 2023 13:41:22 +0100 From: Greg KH To: Dragos-Marian Panait Cc: stable@vger.kernel.org, Jiasheng Jiang , Felix Kuehling , Alex Deucher , Oded Gabbay , Christian =?iso-8859-1?Q?K=F6nig?= , David Zhou , David Airlie , dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 4.19 1/1] drm/amdkfd: Check for null pointer after calling kmemdup Message-ID: References: <20230103184308.511448-1-dragos.panait@windriver.com> <20230103184308.511448-2-dragos.panait@windriver.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230103184308.511448-2-dragos.panait@windriver.com> Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org On Tue, Jan 03, 2023 at 08:43:08PM +0200, Dragos-Marian Panait wrote: > From: Jiasheng Jiang > > [ Upstream commit abfaf0eee97925905e742aa3b0b72e04a918fa9e ] > > As the possible failure of the allocation, kmemdup() may return NULL > pointer. > Therefore, it should be better to check the 'props2' in order to prevent > the dereference of NULL pointer. > > Fixes: 3a87177eb141 ("drm/amdkfd: Add topology support for dGPUs") > Signed-off-by: Jiasheng Jiang > Reviewed-by: Felix Kuehling > Signed-off-by: Felix Kuehling > Signed-off-by: Alex Deucher > Signed-off-by: Dragos-Marian Panait > --- > drivers/gpu/drm/amd/amdkfd/kfd_crat.c | 3 +++ > 1 file changed, 3 insertions(+) For obvious reasons, I can't take a patch for 4.19.y and not newer kernel releases, right? Please provide backports for all kernels if you really need to see this merged. And note, it's not a real bug at all, and given that a CVE was allocated for it that makes me want to even more reject it to show the whole folly of that mess. thanks, greg k-h