From: Greg KH <gregkh@linuxfoundation.org>
To: Fan Wu <fanwu01@zju.edu.cn>
Cc: jirislaby@kernel.org, broonie@kernel.org, zhao.xicheng@vivo.com,
linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org,
stable@vger.kernel.org
Subject: Re: [PATCH v3] tty: serial: max3100: shut down timer before freeing port
Date: Wed, 23 Sep 2026 11:50:55 +0200 [thread overview]
Message-ID: <2026092346-sizzling-dallying-a3c1@gregkh> (raw)
In-Reply-To: <20260805004039.382698-1-fanwu01@zju.edu.cn>
On Wed, Aug 05, 2026 at 12:40:39AM +0000, Fan Wu wrote:
> max3100_shutdown() stops the polling timer but returns early during
> system suspend. If the SPI device is unbound before resume, the serial
> core does not call max3100_shutdown() again, so max3100_remove() frees
> the port while the timer remains armed. max3100_timeout() may then
> access the freed port and re-arm the timer.
>
> Add final timer teardown to max3100_remove() and use
> timer_shutdown_sync() to prevent a racing callback from re-arming it.
> Also free the IRQ and destroy the workqueue there before freeing the
> port. Keep timer_delete_sync() in max3100_shutdown() so that a
> subsequent open() can re-arm the timer.
>
> The workqueue is created before request_irq() and destroyed on both
> request_irq() failure and normal shutdown. Its presence at remove thus
> identifies the IRQ left registered when suspend bypasses shutdown.
>
> This issue was found by an in-house static analysis tool.
There are still issues:
https://sashiko.dev/#/patchset/20260805004039.382698-1-fanwu01@zju.edu.cn
prev parent reply other threads:[~2026-09-23 9:50 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-21 3:56 [PATCH] tty: serial: max3100: drain async producers in remove() to fix timer UAF Fan Wu
2026-07-30 14:39 ` Greg KH
2026-07-31 2:46 ` Fan Wu
2026-08-01 6:12 ` [PATCH v2] tty: serial: max3100: shut down timer before freeing port Fan Wu
2026-08-03 12:56 ` Greg KH
2026-08-04 9:15 ` Fan Wu
2026-08-05 0:40 ` [PATCH v3] " Fan Wu
2026-09-23 9:50 ` Greg KH [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=2026092346-sizzling-dallying-a3c1@gregkh \
--to=gregkh@linuxfoundation.org \
--cc=broonie@kernel.org \
--cc=fanwu01@zju.edu.cn \
--cc=jirislaby@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-serial@vger.kernel.org \
--cc=stable@vger.kernel.org \
--cc=zhao.xicheng@vivo.com \
/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®