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 06467C4332F for ; Wed, 9 Nov 2022 09:36:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230309AbiKIJgC (ORCPT ); Wed, 9 Nov 2022 04:36:02 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40646 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230158AbiKIJf6 (ORCPT ); Wed, 9 Nov 2022 04:35:58 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 633D01571E for ; Wed, 9 Nov 2022 01:35:58 -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 dfw.source.kernel.org (Postfix) with ESMTPS id 0093361985 for ; Wed, 9 Nov 2022 09:35:58 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E31F2C433C1; Wed, 9 Nov 2022 09:35:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1667986557; bh=Q2ePys0L2trmHLtGIxaetKWDh4ERTjs1MzoOIr2C+Cw=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=py7ff6vkrVsx4kNKCQgDt7xxVGDJTAgwyxz8f4ZO7i0iOy+PKcCJ5K5wJYrCqF/5d +aHUnUGgqZD1BYPcZh8zOTL2WeDX7bFjp7l/GH6opH6V/QNENwLephX9Yb6fTRTQDR VLu84S3ZJziXN4UHpd3IrqWeYF3Nw6apC/IMOq7c= Date: Wed, 9 Nov 2022 10:35:54 +0100 From: Greg KH To: Zheng Hacker Cc: Zheng Wang , zhengyejian1@huawei.com, dimitri.sivanich@hpe.com, arnd@arndb.de, linux-kernel@vger.kernel.org, alex000young@gmail.com, security@kernel.org, sivanich@hpe.com, lkp@intel.com Subject: Re: [PATCH v6 RESEND] misc: sgi-gru: fix use-after-free error in gru_set_context_option, gru_fault and gru_handle_user_call_os Message-ID: References: <20221109084142.226960-1-zyytlz.wz@163.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Nov 09, 2022 at 05:24:05PM +0800, Zheng Hacker wrote: > Greg KH 于2022年11月9日周三 16:46写道: > > > > On Wed, Nov 09, 2022 at 04:41:42PM +0800, Zheng Wang wrote: > > > Gts may be freed in gru_check_chiplet_assignment. > > > The caller still use it after that, UAF happens. > > > > > > Fix it by introducing a return value to see if it's in error path or not. > > > Free the gts in caller if gru_check_chiplet_assignment check failed. > > > > > > Fixes: 55484c45dbec ("gru: allow users to specify gru chiplet 2") > > > Reported-by: Zheng Wang > > > Reported-by: kernel test robot > > > > > > > Why the blank line? > > > Sorry for the spelling problem, fixed it next version > > > And the kernel test robot didn't find this issue, right? > > > > Yes, it helped with the test and found an unused variable. I added > this line as the mail suggested > ("If you fix the issue, kindly add following tag where applicable > | Reported-by: kernel test robot "). > > Should I remove it? If you submit a patch that just fixes the issue that the test robot finds, yes, that needs to be there. If you are fixing up a patch that you submit based on the report, no, you do not. thanks, greg k-h