lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <dc6288f0-989c-4314-9217-8f1a12eb206c@flourine.local>
Date: Wed, 29 Oct 2025 11:05:19 +0100
From: Daniel Wagner <dwagner@...e.de>
To: Justin Tee <justintee8345@...il.com>
Cc: Daniel Wagner <wagi@...nel.org>, Christoph Hellwig <hch@....de>, 
	Keith Busch <kbusch@...nel.org>, James Smart <james.smart@...adcom.com>, 
	Jens Axboe <axboe@...nel.dk>, linux-nvme@...ts.infradead.org, 
	LKML <linux-kernel@...r.kernel.org>, Justin Tee <justin.tee@...adcom.com>
Subject: Re: [PATCH 1/5] nvme-fc: don't hold rport lock when putting ctrl

Hi Justin,

On Tue, Oct 28, 2025 at 05:33:17PM -0700, Justin Tee wrote:
> > nvme_fc_ctrl_put can acquire the rport lock when freeing the
> > ctrl object:
> >
> > nvme_fc_ctrl_put
> >   nvme_fc_ctrl_free
> >     spin_lock_irqsave(rport->lock)
> >
> > Thus we can't hold the rport lock when calling nvme_fc_ctrl_put.
> 
> While I agree that we can’t hold the rport lock when calling
> nvme_fc_ctrl_put, nvme_fc_ctrl_free also does a nvme_fc_rport_put,
> which could also trigger nvme_fc_free_rport, making rport invalid.
> Should we also add kref get on the rport before entering the
> list_for_each_entry loop?
> 
> Also, because nvme_fc_ctrl_free removes itself from the
> rport->ctrl_list, should we also start using list_for_each_entry_safe?
> 
> So, something like this?

Yes, this makes sense. Just wondering why I didn't see any KASAN
reports. 

Should I add your change to my patch (obviously mentioning it), or do
you want to send a patch yourself?

In the meantime, I am giving this patch a spin in my test setup.

Thanks,
Daniel

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ