From: sashiko-bot@kernel.org
To: "Tapio Reijonen" <tapio.reijonen@vaisala.com>
Cc: linux-serial@vger.kernel.org
Subject: Re: [PATCH 1/3] serial: max310x: fix use-after-free on remove
Date: Fri, 20 Nov 2026 07:45:45 +0000 [thread overview]
Message-ID: <sashiko-outbox-224655@kernel.org> (raw)
In-Reply-To: <20261120-max310x-teardown-fixes-v1-1-eb52c8b612df@vaisala.com>
> max310x_remove() cancels a port's timer and work items first and
> unregisters the port afterwards. Until uart_remove_one_port() has shut
> the port down, an open port keeps queuing its tx_work from the
> interrupt handler and from start_tx(), and the RS485 code re-arms the
> delay timer and rts_work from those, so a work item or the timer can
> still run after the cancels, on a port that is being torn down, and
> fire after the port memory has been freed.
>
> The unregister itself queues work too: the hangup it triggers clears
> DTR and RTS through set_mctrl(), which schedules md_work, so a cancel
> done before uart_remove_one_port() cannot cover it. Tested with the
> port memory zeroed on free, md_work ran after the unbind on the freed
> port and oopsed in max310x_md_proc().
>
> The interrupt handler is a source of its own. The IRQ enable bits
> [ ... ]
> them too, with no IRQ handling since the request is probe's last step.
>
> Fixes: 10d8b34a4217 ("serial: max310x: Driver rework")
> Cc: stable@vger.kernel.org
> Signed-off-by: Tapio Reijonen <tapio.reijonen@vaisala.com>
Sashiko has reviewed this patch and found no issues.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261120-max310x-teardown-fixes-v1-0-eb52c8b612df@vaisala.com?part=1
next prev parent reply other threads:[~2026-11-20 7:45 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-20 7:33 [PATCH 0/3] serial: max310x: teardown ordering and CTS locking fixes Tapio Reijonen
2026-11-20 7:33 ` [PATCH 1/3] serial: max310x: fix use-after-free on remove Tapio Reijonen
2026-11-20 7:45 ` sashiko-bot [this message]
2026-11-20 7:33 ` [PATCH 2/3] serial: max310x: unwind only the registered ports when probe fails Tapio Reijonen
2026-11-20 7:39 ` sashiko-bot
2026-11-20 7:33 ` [PATCH 3/3] serial: max310x: hold the port lock around the CTS change Tapio Reijonen
2026-11-20 7:41 ` sashiko-bot
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=sashiko-outbox-224655@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=linux-serial@vger.kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
--cc=tapio.reijonen@vaisala.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