From: Oliver Neukum <oneukum@suse.com>
To: Fan Wu <fanwu01@zju.edu.cn>, Ali Akcaagac <aliakc@web.de>,
Jamie Lenehan <lenehan@twibble.org>
Cc: "James E . J . Bottomley" <James.Bottomley@HansenPartnership.com>,
"Martin K . Petersen" <martin.petersen@oracle.com>,
linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org,
stable@vger.kernel.org
Subject: Re: [PATCH] scsi: dc395x: sync the waiting_timer before freeing the host
Date: Thu, 10 Sep 2026 10:33:45 +0200 [thread overview]
Message-ID: <c0006a9c-7cc1-49a4-8226-2f4e5333a4e4@suse.com> (raw)
In-Reply-To: <20260810055028.119525-1-fanwu01@zju.edu.cn>
On 10.08.26 07:50, Fan Wu wrote:
> The waiting_timer callback re-arms itself and takes the host lock.
> adapter_uninit() currently stops it with timer_delete(), which does not
> wait for a callback already running on another CPU. The final
> scsi_host_put() that frees the host (and the host lock the callback
> dereferences) runs right after adapter_uninit(), so a concurrent or just
> re-armed callback can fire after the free, leaving a potential
> use-after-free window.
>
> Replace timer_delete() with timer_shutdown_sync() and move it after
> free_irq(), outside the host-lock section. This waits for a running
> callback and prevents it from re-arming, while avoiding the self-deadlock
> that would result from syncing a callback blocked on the lock we still
> hold.
Thank you for the patch. It raises a question, though. Do you want
the timers to fire after the adapter has already ceased to function?
Regards
Oliver
prev parent reply other threads:[~2026-09-10 8:33 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-10 5:50 Fan Wu
2026-09-10 8:33 ` Oliver Neukum [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=c0006a9c-7cc1-49a4-8226-2f4e5333a4e4@suse.com \
--to=oneukum@suse.com \
--cc=James.Bottomley@HansenPartnership.com \
--cc=aliakc@web.de \
--cc=fanwu01@zju.edu.cn \
--cc=lenehan@twibble.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.com \
--cc=stable@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®