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 5DF7E38B7DD; Mon, 20 Apr 2026 09:44:27 +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=1776678267; cv=none; b=ptj+yes35WYJh6ftamib2ZbTzjjXgRRjwb/CXM04wBX9uR8dJEnJXk99W4XF5E3SqYsKG4B96lljHdVUrI4MJfvys8Ge+ZFD4bS3mrYm8o81WjSkRgG1SO4QizXoYLsfXsDMymy4hVuBn6KBg3oJdZkoY8H+pNw0ANUi73fTR4E= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776678267; c=relaxed/simple; bh=orVQQAkokr/ZgckLno97Wt1TCs0NqYT9zlpZ/LTDeX0=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=O53314ylNLKCTEYfKePS47yw/hFgKkfpAMqhQH5CHaE1perZRlSOEDAr4LrUgKVtrDtUz+mMEm+DOlsnXETQByvLrFprQacXL6z9uzh62VSBib3LD6UjrPBcFZDbDHYaeuMSbQjWPy0BpQfxyGC/jQkVPexht9ODAfWhaF7AikE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=On12/JsX; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="On12/JsX" Received: by smtp.kernel.org (Postfix) with ESMTPSA id B5F6FC19425; Mon, 20 Apr 2026 09:44:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1776678267; bh=orVQQAkokr/ZgckLno97Wt1TCs0NqYT9zlpZ/LTDeX0=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=On12/JsX+i3fpguYVx+6aKWBA0+2Scgbv6LSEOxAV+u2KOK1nNpbXBsMoySfGYkvj CPuuFEe3gLujpHyyHjFkL5v+2gImBBbvR5ri2bfaogKzIIM/zaH+Z/Fa4hX3OtM0Yj LXhC4vzROD0sD1jJuTMJB1fp64nZV7y3YkOI/bGk= Date: Mon, 20 Apr 2026 11:44:24 +0200 From: Greg KH To: Guangshuo Li Cc: Madhavan Srinivasan , Michael Ellerman , Nicholas Piggin , "Christophe Leroy (CS GROUP)" , Mahesh Salgaonkar , Tyrel Datwyler , Haren Myneni , Christian Brauner , Kees Cook , linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org Subject: Re: [PATCH] powerpc/pseries/papr-hvpipe: fix NULL dereference in handle creation Message-ID: <2026042009-lesser-refrain-c154@gregkh> References: <20260420093856.123681-1-lgs201920130244@gmail.com> Precedence: bulk X-Mailing-List: stable@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: <20260420093856.123681-1-lgs201920130244@gmail.com> On Mon, Apr 20, 2026 at 05:38:56PM +0800, Guangshuo Li wrote: > papr_hvpipe_dev_create_handle() transfers ownership of src_info with > retain_and_null_ptr(src_info) after anon_inode_getfile() succeeds. > However, retain_and_null_ptr() clears src_info immediately, and the > function then still dereferences src_info in the subsequent list_add(). > > Store the transferred pointer in a separate variable and use that for > the list insertion. > > Manually identified during code review. > > Fixes: 6d3789d347a7af5c4b0b2da3af47b8d9da607ab2 ("papr-hvpipe: convert papr_hvpipe_dev_create_handle() to FD_PREPARE()") Please use the proper notation here, as the documentation asks you to. thanks, greg k-h