Thread View: linux.kernel.netdev
1 messages
1 total messages
Started by Antonio Quartulli
Thu, 26 Nov 2026 16:32
[PATCH net 1/6] net: qualcomm: rmnet: recheck the aggregate after flushing it
Author: Antonio Quartulli
Date: Thu, 26 Nov 2026 16:32
Date: Thu, 26 Nov 2026 16:32
47 lines
11125 bytes
11125 bytes
When an skb does not fit in the pending aggregate,
rmnet_map_tx_aggregate() flushes it with agg_lock dropped, then jumps
back past the skbagg_head check. rmnet vnds are lltx and can share a
port, so another CPU may start an aggregate meanwhile: it is then
overwritten and leaked along with the packets chained to it, or
overtaken by a skb sent without aggregation.
Reproducer, with UDP sent through both vnds from several CPUs:
ip link add v0 mtu 9000 type veth peer name v1 mtu 9000
ip link set v0 up; ip link set v1 up
ip link add link v0 name rmnet1 type rmnet mux_id 1
ip link add link v0 name rmnet2 type rmnet mux_id 2
ethtool -C rmnet1 tx-aggr-max-frames 64 tx-aggr-max-bytes 4096 \
tx-aggr-time-usecs 2000
The tx_bytes of rmnet1 and rmnet2 soon exceed those of v0, and kmemleak
reports skbs allocated by skb_copy_expand() in rmnet_map_tx_aggregate().
Move the label before the skbagg_head check.
Fixes: 64b5d1f8f2d1 ("net: qualcomm: rmnet: add tx packets aggregation")
Signed-off-by: Antonio Quartulli <antonio@mandelbit.com>
---
drivers/net/ethernet/qualcomm/rmnet/rmnet_map_data.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/qualcomm/rmnet/rmnet_map_data.c b/drivers/net/ethernet/qualcomm/rmnet/rmnet_map_data.c
index 39d6d084e73f..73b04fe386df 100644
--- a/drivers/net/ethernet/qualcomm/rmnet/rmnet_map_data.c
+++ b/drivers/net/ethernet/qualcomm/rmnet/rmnet_map_data.c
@@ -600,11 +600,11 @@ unsigned int rmnet_map_tx_aggregate(struct sk_buff *skb, struct rmnet_port *port
memcpy(&last, &port->agg_last, sizeof(struct timespec64));
ktime_get_real_ts64(&port->agg_last);
+new_packet:
if (!port->skbagg_head) {
/* Check to see if we should agg first. If the traffic is very
* sparse, don't aggregate.
*/
-new_packet:
diff = timespec64_sub(port->agg_last, last);
size = port->egress_agg_params.bytes - skb->len;
--
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