Thread View: linux.kernel.netdev
1 messages
1 total messages
Started by Antonio Quartulli
Thu, 26 Nov 2026 16:32
[PATCH net 4/6] net: qualcomm: rmnet: stop TX aggregation after detaching the port
Author: Antonio Quartulli
Date: Thu, 26 Nov 2026 16:32
Date: Thu, 26 Nov 2026 16:32
46 lines
10787 bytes
10787 bytes
rmnet_unregister_real_device() tears down the aggregation state before
unregistering the rx handler. When the last vnd on a port is deleted,
that vnd is still registered and the egress path still finds the port
through rx_handler_data, so a transmit can start an aggregate and arm
the timer. The port is then freed: the timer fires on freed memory and
the aggregate leaks.
Reproducer:
ip link add link v0 name rmnet1 type rmnet mux_id 1
ethtool -C rmnet1 tx-aggr-max-frames 64 tx-aggr-max-bytes 4096 \
tx-aggr-time-usecs 1000000
then delete rmnet1 while flooding UDP through it from all CPUs.
DEBUG_OBJECTS_TIMERS reports "ODEBUG: free active object type: hrtimer",
KASAN a use-after-free once the timer fires.
Unregister the rx handler first: after its RCU grace period no transmit
can find the port.
Fixes: 64b5d1f8f2d1 ("net: qualcomm: rmnet: add tx packets aggregation")
Signed-off-by: Antonio Quartulli <antonio@mandelbit.com>
---
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.56.1
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads