From: <subash.a.kasiviswanathan@oss.qualcomm.com>
To: "'Jérémy Jean'" <Jeremy.Jean@oss.cyber.gouv.fr>,
"'Sean Tranchetti'" <sean.tranchetti@oss.qualcomm.com>
Cc: <netdev@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
<stable@vger.kernel.org>
Subject: RE: [PATCH net] net: qualcomm: rmnet: fix TX aggregation teardown race
Date: Sun, 8 Nov 2026 00:32:09 -0700 [thread overview]
Message-ID: <000101dd6f53$43952740$cabf75c0$@oss.qualcomm.com> (raw)
In-Reply-To: <20261101233427.2050688-2-Jeremy.Jean@oss.cyber.gouv.fr>
> -----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>
next prev parent reply other threads:[~2026-11-08 7:32 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
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 message]
2026-11-10 2:55 ` patchwork-bot+netdevbpf
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='000101dd6f53$43952740$cabf75c0$@oss.qualcomm.com' \
--to=subash.a.kasiviswanathan@oss.qualcomm.com \
--cc=Jeremy.Jean@oss.cyber.gouv.fr \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=sean.tranchetti@oss.qualcomm.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.