From: Arend van Spriel <arend.vanspriel@broadcom.com>
To: Robert Garcia <rob_garcia@163.com>
Cc: stable@vger.kernel.org, Duoming Zhou <duoming@zju.edu.cn>,
Johannes Berg <johannes.berg@intel.com>,
linux-wireless@vger.kernel.org
Subject: Re: [PATCH 5.15.y] wifi: brcmfmac: fix use-after-free when rescheduling brcmf_btcoex_info work
Date: Mon, 6 Jul 2026 12:25:12 +0200 [thread overview]
Message-ID: <20260706102512.1429947-1-arend.vanspriel@broadcom.com> (raw)
In-Reply-To: <20260528055431.4124445-1-rob_garcia@163.com>
On Thu, 28 May 2026 13:54:31 +0800, Robert Garcia wrote:
> From: Duoming Zhou <duoming@zju.edu.cn>
>
> [ Upstream commit 9cb83d4be0b9b697eae93d321e0da999f9cdfcfc ]
[...]
> + del_timer_sync(&cfg->btcoex->timer);
> + cfg->btcoex->timer_on = false;
>
> cancel_work_sync(&cfg->btcoex->work);
The upstream fix uses timer_shutdown_sync() which prevents the timer from
being re-armed after it returns. del_timer_sync() does not have this
guarantee.
brcmf_btcoex_handler() has three mod_timer() calls - two in
BRCMF_BT_DHCP_START and one in BRCMF_BT_DHCP_OPPR_WIN - none of which are
guarded by timer_on. A work item running between del_timer_sync() and
cancel_work_sync() can re-arm the timer, leaving it pending when kfree() is
called.
If the mod_timer() calls were made conditional on timer_on, setting
timer_on = false before del_timer_sync() would be sufficient. That would be
my preferred fix. Alternatively a second del_timer_sync() after
cancel_work_sync() would also work.
Also the commit message still mentions timer_shutdown_sync() rather than
del_timer_sync().
Regards,
Arend
next prev parent reply other threads:[~2026-07-06 10:25 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-28 5:54 [PATCH 5.15.y] wifi: brcmfmac: fix use-after-free when rescheduling brcmf_btcoex_info work Robert Garcia
2026-06-03 15:14 ` Sasha Levin
2026-07-06 10:25 ` Arend van Spriel [this message]
2026-07-06 14:08 ` Sasha Levin
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=20260706102512.1429947-1-arend.vanspriel@broadcom.com \
--to=arend.vanspriel@broadcom.com \
--cc=duoming@zju.edu.cn \
--cc=johannes.berg@intel.com \
--cc=linux-wireless@vger.kernel.org \
--cc=rob_garcia@163.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