From: Paolo Abeni <pabeni@redhat.com>
To: Shuangpeng Bai <shuangpeng.kernel@gmail.com>, netdev@vger.kernel.org
Cc: andrew+netdev@lunn.ch, davem@davemloft.net, edumazet@google.com,
kuba@kernel.org, linux-kernel@vger.kernel.org,
Shuangpeng Bai <baisp@psu.edu>
Subject: Re: [PATCH] net: caif: serial: fix TX UAF on ser->tty
Date: Thu, 12 Feb 2026 13:13:21 +0100 [thread overview]
Message-ID: <4ce73296-a6da-47d9-8483-5bbe564f20c6@redhat.com> (raw)
In-Reply-To: <20260212042236.639174-1-shuangpeng.kernel@gmail.com>
On 2/12/26 5:22 AM, Shuangpeng Bai wrote:
> KASAN reported a slab-use-after-free in tty_write_room() reachable from
> caif_serial's TX path. The TX handler dereferences ser->tty while
> ldisc_close() can drop the driver's tty reference. Since ser->tty was
> not cleared and accesses were not synchronized, the TX path could race
> with tty teardown and dereference a stale ser->tty pointer.
>
> Fix it by serializing accesses to ser->tty with a dedicated lock. The TX
> path grabs a tty kref under the lock and drops it after the TX attempt,
> while ldisc_close() clears ser->tty under the same lock before putting
> the old tty reference. This prevents the TX path from observing a freed
> tty object via ser->tty.
>
> Reported-by: Shuangpeng Bai <baisp@psu.edu>
> Closes: https://groups.google.com/g/syzkaller/c/usNe0oKtoXw/m/x8qUc3yUAQAJ
>
Please, no empty lines in the tag area.
You must include a fixes tag and specify the target tree in the subj prefix
Does not apply cleanly to net nor net-next
Please read carefully the process documentation under:
Documentation/process/
and especially Documentation/process/maintainer-netdev.rst
before resubmitting
/P
prev parent reply other threads:[~2026-02-12 12:13 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-12 4:22 Shuangpeng Bai
2026-02-12 12:13 ` Paolo Abeni [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=4ce73296-a6da-47d9-8483-5bbe564f20c6@redhat.com \
--to=pabeni@redhat.com \
--cc=andrew+netdev@lunn.ch \
--cc=baisp@psu.edu \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=shuangpeng.kernel@gmail.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®