* [PATCH net] net: qualcomm: rmnet: fix TX aggregation teardown race
@ 2026-11-01 23:34 Jérémy Jean
2026-11-01 23:39 ` netdev-bot+sinfo
2026-11-08 7:32 ` subash.a.kasiviswanathan
0 siblings, 2 replies; 6+ messages in thread
From: Jérémy Jean @ 2026-11-01 23:34 UTC (permalink / raw)
To: Subash Abhinov Kasiviswanathan, Sean Tranchetti
Cc: netdev, linux-kernel, Jérémy Jean, stable
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1374 bytes --]
There is a race in rmnet_unregister_real_device() because it cancels TX
aggregation before unregistering the rx handler. A transmit that already
obtained the port through rmnet_get_port_rcu() can wait on port->agg_lock,
then create a new aggregate and rearm the timer after
rmnet_map_tx_aggregate_exit() has drained it. The timer can later queue
work on the freed port.
Unregister the rx handler first so that no reader can rearm aggregation
after rmnet_map_tx_aggregate_exit() drains it.
Fixes: 64b5d1f8f2d1 ("net: qualcomm: rmnet: add tx packets aggregation")
Cc: stable@vger.kernel.org
Signed-off-by: Jérémy Jean <Jeremy.Jean@oss.cyber.gouv.fr>
---
drivers/net/ethernet/qualcomm/rmnet/rmnet_config.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/qualcomm/rmnet/rmnet_config.c b/drivers/net/ethernet/qualcomm/rmnet/rmnet_config.c
index 61b04c6c0390..2ff4b9519139 100644
--- a/drivers/net/ethernet/qualcomm/rmnet/rmnet_config.c
+++ b/drivers/net/ethernet/qualcomm/rmnet/rmnet_config.c
@@ -40,10 +40,10 @@ static int rmnet_unregister_real_device(struct net_device *real_dev)
if (port->nr_rmnet_devs)
return -EINVAL;
- rmnet_map_tx_aggregate_exit(port);
-
netdev_rx_handler_unregister(real_dev);
+ rmnet_map_tx_aggregate_exit(port);
+
kfree(port);
netdev_dbg(real_dev, "Removed from rmnet\n");
--
2.47.3
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: [PATCH net] net: qualcomm: rmnet: fix TX aggregation teardown race 2026-11-01 23:34 [PATCH net] net: qualcomm: rmnet: fix TX aggregation teardown race Jérémy Jean @ 2026-11-01 23:39 ` netdev-bot+sinfo 2026-11-08 15:03 ` Simon Horman 2026-11-08 7:32 ` subash.a.kasiviswanathan 1 sibling, 1 reply; 6+ messages in thread From: netdev-bot+sinfo @ 2026-11-01 23:39 UTC (permalink / raw) To: Jérémy Jean Cc: Subash Abhinov Kasiviswanathan, Sean Tranchetti, netdev, linux-kernel, stable Hi! This is an automated message. This series looks like a fix, but its commit messages seem to be missing some information: - How the issue was discovered, e.g. hit in production, hit during development, syzbot report, manual code inspection, LLM or static analysis tool scan. - Whether the issue was actually triggered, or is only theoretical (e.g. found by code inspection). If it was triggered please include the symptoms, like the stack trace or error messages. - What hardware the change was tested on. For driver fixes please mention the device (and if relevant firmware version) used for testing, or say that the change was not tested on real hardware. Please do not repost the series just to address the above. Instead, reply to this email with the missing information, so that reviewers can take it into account. If the series needs another revision for other reasons, please include the information in the commit messages then. The evaluation is done by an LLM so it may be wrong, if you think that is the case please reply and explain. ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH net] net: qualcomm: rmnet: fix TX aggregation teardown race 2026-11-01 23:39 ` netdev-bot+sinfo @ 2026-11-08 15:03 ` Simon Horman 2026-11-08 15:18 ` Jérémy Jean 0 siblings, 1 reply; 6+ messages in thread From: Simon Horman @ 2026-11-08 15:03 UTC (permalink / raw) To: netdev-bot+sinfo Cc: Jérémy Jean, Subash Abhinov Kasiviswanathan, Sean Tranchetti, netdev, linux-kernel, stable On Sun, Nov 01, 2026 at 11:39:11PM +0000, netdev-bot+sinfo@kernel.org wrote: > Hi! > > This is an automated message. This series looks like a fix, but its > commit messages seem to be missing some information: > > - How the issue was discovered, e.g. hit in production, hit during > development, syzbot report, manual code inspection, LLM or static > analysis tool scan. > > - Whether the issue was actually triggered, or is only theoretical > (e.g. found by code inspection). If it was triggered please include > the symptoms, like the stack trace or error messages. > > - What hardware the change was tested on. For driver fixes please > mention the device (and if relevant firmware version) used for > testing, or say that the change was not tested on real hardware. > > Please do not repost the series just to address the above. Instead, > reply to this email with the missing information, so that reviewers > can take it into account. If the series needs another revision for > other reasons, please include the information in the commit messages > then. > > The evaluation is done by an LLM so it may be wrong, if you think > that is the case please reply and explain. Hi Jérémy, As per similar requests for other patches, I would appreciate it if you could take a moment to respond to the questions posed by the bot above. ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH net] net: qualcomm: rmnet: fix TX aggregation teardown race 2026-11-08 15:03 ` Simon Horman @ 2026-11-08 15:18 ` Jérémy Jean 2026-11-08 16:41 ` Simon Horman 0 siblings, 1 reply; 6+ messages in thread From: Jérémy Jean @ 2026-11-08 15:18 UTC (permalink / raw) To: Simon Horman Cc: netdev-bot+sinfo, Subash Abhinov Kasiviswanathan, Sean Tranchetti, netdev, linux-kernel, stable On 2026-11-08 16:03, Simon Horman wrote: > On Sun, Nov 01, 2026 at 11:39:11PM +0000, netdev-bot+sinfo@kernel.org > wrote: >> Hi! >> >> This is an automated message. This series looks like a fix, but its >> commit messages seem to be missing some information: >> >> - How the issue was discovered, e.g. hit in production, hit during >> development, syzbot report, manual code inspection, LLM or static >> analysis tool scan. >> >> - Whether the issue was actually triggered, or is only theoretical >> (e.g. found by code inspection). If it was triggered please include >> the symptoms, like the stack trace or error messages. >> >> - What hardware the change was tested on. For driver fixes please >> mention the device (and if relevant firmware version) used for >> testing, or say that the change was not tested on real hardware. >> >> Please do not repost the series just to address the above. Instead, >> reply to this email with the missing information, so that reviewers >> can take it into account. If the series needs another revision for >> other reasons, please include the information in the commit messages >> then. >> >> The evaluation is done by an LLM so it may be wrong, if you think >> that is the case please reply and explain. > > Hi Jérémy, > > As per similar requests for other patches, I would appreciate it if you > could take a moment to respond to the questions posed by the bot above. * The bug was found by LLM-assisted code review. * The bug was triggered by a software reproducer with a KASAN enabled kernel under QEMU VM. * It has not been tested on real hardware. ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH net] net: qualcomm: rmnet: fix TX aggregation teardown race 2026-11-08 15:18 ` Jérémy Jean @ 2026-11-08 16:41 ` Simon Horman 0 siblings, 0 replies; 6+ messages in thread From: Simon Horman @ 2026-11-08 16:41 UTC (permalink / raw) To: Jérémy Jean Cc: netdev-bot+sinfo, Subash Abhinov Kasiviswanathan, Sean Tranchetti, netdev, linux-kernel, stable On Sun, Nov 08, 2026 at 04:18:25PM +0100, Jérémy Jean wrote: > On 2026-11-08 16:03, Simon Horman wrote: > > On Sun, Nov 01, 2026 at 11:39:11PM +0000, netdev-bot+sinfo@kernel.org > > wrote: > > > Hi! > > > > > > This is an automated message. This series looks like a fix, but its > > > commit messages seem to be missing some information: > > > > > > - How the issue was discovered, e.g. hit in production, hit during > > > development, syzbot report, manual code inspection, LLM or static > > > analysis tool scan. > > > > > > - Whether the issue was actually triggered, or is only theoretical > > > (e.g. found by code inspection). If it was triggered please include > > > the symptoms, like the stack trace or error messages. > > > > > > - What hardware the change was tested on. For driver fixes please > > > mention the device (and if relevant firmware version) used for > > > testing, or say that the change was not tested on real hardware. > > > > > > Please do not repost the series just to address the above. Instead, > > > reply to this email with the missing information, so that reviewers > > > can take it into account. If the series needs another revision for > > > other reasons, please include the information in the commit messages > > > then. > > > > > > The evaluation is done by an LLM so it may be wrong, if you think > > > that is the case please reply and explain. > > > > Hi Jérémy, > > > > As per similar requests for other patches, I would appreciate it if you > > could take a moment to respond to the questions posed by the bot above. > > * The bug was found by LLM-assisted code review. > * The bug was triggered by a software reproducer with a KASAN enabled > kernel under QEMU VM. > * It has not been tested on real hardware. Thanks for the update Jérémy, much appreciated. Reviewed-by: Simon Horman <horms@kernel.org> ^ permalink raw reply [flat|nested] 6+ messages in thread
* RE: [PATCH net] net: qualcomm: rmnet: fix TX aggregation teardown race 2026-11-01 23:34 [PATCH net] net: qualcomm: rmnet: fix TX aggregation teardown race Jérémy Jean 2026-11-01 23:39 ` netdev-bot+sinfo @ 2026-11-08 7:32 ` subash.a.kasiviswanathan 1 sibling, 0 replies; 6+ messages in thread From: subash.a.kasiviswanathan @ 2026-11-08 7:32 UTC (permalink / raw) To: 'Jérémy Jean', 'Sean Tranchetti' Cc: netdev, linux-kernel, stable > -----Original Message----- > From: Jérémy Jean <Jeremy.Jean@oss.cyber.gouv.fr> > Sent: Sunday, November 1, 2026 4:34 PM > To: Subash Abhinov Kasiviswanathan > <subash.a.kasiviswanathan@oss.qualcomm.com>; Sean Tranchetti > <sean.tranchetti@oss.qualcomm.com> > Cc: netdev@vger.kernel.org; linux-kernel@vger.kernel.org; Jérémy Jean > <Jeremy.Jean@oss.cyber.gouv.fr>; stable@vger.kernel.org > Subject: [PATCH net] net: qualcomm: rmnet: fix TX aggregation teardown race > > There is a race in rmnet_unregister_real_device() because it cancels TX > aggregation before unregistering the rx handler. A transmit that already > obtained the port through rmnet_get_port_rcu() can wait on port->agg_lock, > then create a new aggregate and rearm the timer after > rmnet_map_tx_aggregate_exit() has drained it. The timer can later queue work > on the freed port. > > Unregister the rx handler first so that no reader can rearm aggregation after > rmnet_map_tx_aggregate_exit() drains it. > > Fixes: 64b5d1f8f2d1 ("net: qualcomm: rmnet: add tx packets aggregation") > Cc: stable@vger.kernel.org > Signed-off-by: Jérémy Jean <Jeremy.Jean@oss.cyber.gouv.fr> > --- > drivers/net/ethernet/qualcomm/rmnet/rmnet_config.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/net/ethernet/qualcomm/rmnet/rmnet_config.c > b/drivers/net/ethernet/qualcomm/rmnet/rmnet_config.c > index 61b04c6c0390..2ff4b9519139 100644 > --- a/drivers/net/ethernet/qualcomm/rmnet/rmnet_config.c > +++ b/drivers/net/ethernet/qualcomm/rmnet/rmnet_config.c > @@ -40,10 +40,10 @@ static int rmnet_unregister_real_device(struct > net_device *real_dev) > if (port->nr_rmnet_devs) > return -EINVAL; > > - rmnet_map_tx_aggregate_exit(port); > - > netdev_rx_handler_unregister(real_dev); > > + rmnet_map_tx_aggregate_exit(port); > + > kfree(port); > > netdev_dbg(real_dev, "Removed from rmnet\n"); > -- > 2.47.3 Reviewed-by: Subash Abhinov Kasiviswanathan <subash.a.kasiviswanathan@oss.qualcomm.com> ^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2026-11-08 16:41 UTC | newest] Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2026-11-01 23:34 [PATCH net] net: qualcomm: rmnet: fix TX aggregation teardown race Jérémy Jean 2026-11-01 23:39 ` netdev-bot+sinfo 2026-11-08 15:03 ` Simon Horman 2026-11-08 15:18 ` Jérémy Jean 2026-11-08 16:41 ` Simon Horman 2026-11-08 7:32 ` subash.a.kasiviswanathan
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®