Linux Serial subsystem development
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Fan Wu" <fanwu01@zju.edu.cn>
Cc: linux-serial@vger.kernel.org
Subject: Re: [PATCH v4] tty: serial: max3100: shut down timer before freeing port
Date: Sun, 27 Sep 2026 06:12:45 +0000	[thread overview]
Message-ID: <20260927061245.E6AF51F000FF@smtp.kernel.org> (raw)
In-Reply-To: <20260927055957.561030-1-fanwu01@zju.edu.cn>

> 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.
> [ ... ]
> 
> Fixes: 7831d56b0a35 ("tty: MAX3100")
> Cc: stable@vger.kernel.org # 6.2+
> Assisted-by: Codex:gpt-5.6
> Signed-off-by: Fan Wu <fanwu01@zju.edu.cn>

Sashiko has reviewed this patch and found no issues. It looks great!

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260927055957.561030-1-fanwu01@zju.edu.cn?part=1


      reply	other threads:[~2026-09-27  6:12 UTC|newest]

Thread overview: 10+ 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
2026-09-27  5:59           ` [PATCH v4] " Fan Wu
2026-09-27  6:12             ` sashiko-bot [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=20260927061245.E6AF51F000FF@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=fanwu01@zju.edu.cn \
    --cc=linux-serial@vger.kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    /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