Article View: linux.kernel.netdev
Article #23170[PATCH net 4/6] net: qualcomm: rmnet: stop TX aggregation after detaching the port
From: 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
Technical Details
Message-ID:
<20261126163219.1744750-5-antonio@mandelbit.com>Path:
mbox-mo1.pugleaf.net!srv.newsdeef.eu!news.mb-net.net!open-news-network.org!2.eu.feeder.erje.net!feeder.erje.net!feeder2.feed.ams11.usenet.farm!feed.usenet.farm!feeder.usenetexpress.com!tr3.eu1.usenetexpress.com!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-372227-linux-kernel-netdev=dewy.ruReferences:
<20261126163219.1744750-1-antonio@mandelbit.com>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!news.mb-net.net!open-news-network.org!2.eu.feeder.erje.net!feeder.erje.net!feeder2.feed.ams11.usenet.farm!feed.usenet.farm!feeder.usenetexpress.com!tr3.eu1.usenetexpress.com!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-372227-linux-kernel-netdev=dewy.ru From: antonio@mandelbit.com (Antonio Quartulli) Newsgroups: linux.kernel.netdev Subject: [PATCH net 4/6] net: qualcomm: rmnet: stop TX aggregation after detaching the port Date: Thu, 26 Nov 2026 17:32:17 +0100 Organization: Usenet Network Message-ID: <20261126163219.1744750-5-antonio@mandelbit.com> References: <20261126163219.1744750-1-antonio@mandelbit.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Injection-Info: usenet.network; logging-data="508584"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:yNT34DmK/tQMu9W8KjohFfJGspI= sha256:jui97oQ+St5r8jBxRn+d8j+YVxCFuo7+2lBNio4W7pA= sha1:OLKq2l/+2Nl/BL5daZ0JpdeLZg4= sha256:O5WAUE79Cbn75FaxmDc03gcp8UGH9mk08G6BsmjNSVQ= List-ID: <netdev.vger.kernel.org> X-Mailpost-Empty-Hdrs: X-Spam-Level X-Received: from localhost (localhost [127.0.0.1]) by mail.dewy.ru (Postfix) with ESMTP id 22A4B125EEB; Thu, 26 Nov 2026 19:33:16 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -3.05 X-Spam-Status: No, score=-3.05 tagged_above=-9999 required=6.31 tests=[DCC_REPUT_70_89=0.1, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HEADER_FROM_DIFFERENT_DOMAINS=0.249, MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key) header.d=mandelbit.com X-Received: from mail.dewy.ru ([127.0.0.1]) by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id f8uFJ058EIFx; Thu, 26 Nov 2026 19:33:13 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-372227-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> X-Authentication-Results: OpenDMARC; dmarc=none (p=none dis=none) header.from=mandelbit.com X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10]) by mail.dewy.ru (Postfix) with ESMTPS id F3624125EED; Thu, 26 Nov 2026 19:33:02 +0300 (MSK) X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by sea.lore.kernel.org (Postfix) with ESMTP id C01A1399FB; Thu, 26 Nov 2026 16:32:32 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass; t=1795710752; b=nUL7z6EqBYmeGj4jlcw+zYYAtC6UR2vYvufYJgzFGZYlFC1c9b5xQBZhYEwo0LtjxUPC grhjGeJYisC2RtfylCWs9WDEXKOLlQA61VpSvGvSR7y8YeBrNN4mPxZnDPRQ2cyPMwr8G LUPaM07G8fuXb19oX7+7tcu0n7ljo2mEHwHmhKwbH9jt7UUhSreeDO5T7O01/qhmM+K4J rS3mjASAPOpGqWqDe7oQDZTH8i07dhUou8Lc/HPLgLKsdmq4lTmqToJWWR875xF5qi4PY xXRB13fZBdysSM7xS5xUfMMQHCdFHoXupPgFh8/knsIvkMSEi7XfboncBlDDffQ/M6A== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795710752; h=X-Original-To:Received:DMARC-Filter:Received:DKIM-Signature:From:To: Cc:Subject:Date:Message-ID:X-Mailer:In-Reply-To:References: X-Mailing-List:List-Id:List-Post:List-Help:List-Subscribe: List-Unsubscribe:List-Owner:Precedence:MIME-Version: Content-Transfer-Encoding:X-Rspamd-Queue-Id; bh=3HwggEmN7QDf+7fOdhcEHzmMMaL4VqP+dHX3wTGkWFk=; b=GjMCXVo662sAo7TJ5vOo7YENK34ceeWhD8OLhUdbJBxu0uufgIcViY4TtMyD3H/25p7l 3iS8K5G/NCTgISyrU2LhHnd2xmfij3AYo7SUo6ILVXtRpcicpEDbAgAqTxxb5NtdgkuHd IcKTKhHvSSJEmBVXAllZme8LJ4SAZF0jqF1K5QBmw73/tCqJ/VqSBIgm3SOnwtrMZOTYX xFyUenfu6OjCVWG98uqfigYignWwKcDdDm6nNN7NDHiUtSybPEAl+yZarLnQs3yootTe7 rpc4lk+lBEjQ9XgMBjahX6XOx2wg4zsBPf//j77X8dVgOThkgX+EaW7fJ/EhOYzU8/Q== X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dkim=pass header.d=mandelbit.com header.i=@mandelbit.com header.a=rsa-sha256 header.s=MBO0001 header.b=0F7MEsbU; dmarc=none header.from=mandelbit.com; spf=pass smtp.mailfrom=mandelbit.com; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 X-Received: from localhost.localdomain (localhost [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 95DD3606A31E; Thu, 26 Nov 2026 16:32:32 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key, unprotected) header.d=mandelbit.com header.i=@mandelbit.com header.a=rsa-sha256 header.s=MBO0001 header.b=0F7MEsbU X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=195.10.208.55 X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1795710751; b=z5BwBo79XMuLvABQqiPYrefWBc+T9xEJZrLWFMMmgu8AEERZLNrE+FvqUWvCA1x+knhe EoUZxv3Hxc0eje1jUthM/xAA96PtONMl1ptVS9kBT2NT78aCtIRGNd3ST+Igl8xFFvwbB wRc612KOK9yKSW1cYcIlqkgRy3GY++IvGtPihCOEBTgVGuJCEQq1IXiI0zcxF/IYtJaV4 NKqw4D9kDfSV+WCWKP+CHCUS4AxJBhwyA9KpubyeAFMYSi5TxMutMy+WHpd7+DAzv8Toc AN3CqtXUmScrno+Bb0i0Wvv7MMX2fXEI1R//kvd2YLce3MjvdbWMJQJ8OKYiIMqXSUw== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795710751; h=DMARC-Filter:Received:DKIM-Signature:From:To:Cc:Subject:Date: Message-ID:X-Mailer:In-Reply-To:References:MIME-Version: Content-Transfer-Encoding:X-Rspamd-Queue-Id; bh=3HwggEmN7QDf+7fOdhcEHzmMMaL4VqP+dHX3wTGkWFk=; b=04yVNQ468imGWPj/niojJc/uSK9x/oItrCiK5FegX8GAYwRtR+sgzUXEA8rUYas7rLKE NqtyPLfymoD+WXxk0q5A9BkMgiDgBEiCAz9hO6M4y9Ycwk1JdenvJH5EGqu4l2udFASwk Cp6VaED/8fAWRrl07S4qKsKnpBxoz/tcBWx6rcDGFse30tQxe6mC7potISGk24wmHTzY+ jtNgRues6mea+SsrYoocUntvr9meZEpNcerAvXMO4Hhz7QbJN9zjzpWdn7n/0ZlcUA2wl MaM+f4M0mL/RBrwm4QRg8vjJ0CHSmwfx9A7fKRY80Ru6j4ZHYbnx5JXPJpxV9Xywtjw== X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none header.from=mandelbit.com; spf=pass smtp.mailfrom=mandelbit.com; dkim=pass header.d=mandelbit.com header.i=@mandelbit.com header.a=rsa-sha256 header.s=MBO0001 header.b=0F7MEsbU; arc=none smtp.remote-ip=195.10.208.55 X-Received: from mout-b-110.mailbox.org (mout-b-110.mailbox.org [195.10.208.55]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0FE4A606A32D for <netdev@vger.kernel.org>; Thu, 26 Nov 2026 16:32:30 +0000 (UTC) X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 0FE4A606A32D X-Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=mandelbit.com X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=mandelbit.com X-Received: from smtp1.mailbox.org (smtp1.mailbox.org [IPv6:2001:67c:2050:b231:465::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519MLKEM768 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-b-110.mailbox.org (Postfix) with ESMTPS id 4jb2Bz24SRzNkXR; Thu, 26 Nov 2026 17:32:27 +0100 (CET) X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mandelbit.com; s=MBO0001; t=1795710747; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=3HwggEmN7QDf+7fOdhcEHzmMMaL4VqP+dHX3wTGkWFk=; b=0F7MEsbUYkuFczajKen5tPAi4rDceDwuR8BGTDyzsCpXWvUy/xmQfbwL3ndMgh2bmyB0qa Kf8v/NTwM6ZVr+ki90ia38hWWnlsAMIouMsHRLypG+0LYBR8NO+dmx6SBWX6lFaLwnjjbc Z7V4YctMJrWKa3eTqdJzgT/Wue1FstLF7Qe76U37W7SlZlBSlYCrAIbeCMqR5pOeoXE4cT 1NJOxlU0JjH/kDLouPNmgAbRfQ9eT9Hhwt/tUu17wUySEtA8nggYAQtZFecxfqNm6g6Gke jRZliKjFEOiZC8rHj+55O9QNH9JmtGYiY2t+sjxhuvDuf9A6aIvVDsC1Q6h91w== X-Authentication-Results: outgoing_mbo_mout; dkim=none; spf=pass (outgoing_mbo_mout: domain of antonio@mandelbit.com designates 2001:67c:2050:b231:465::1 as permitted sender) smtp.mailfrom=antonio@mandelbit.com X-Cc: Subash Abhinov Kasiviswanathan <subash.a.kasiviswanathan@oss.qualcomm.com>, Sean Tranchetti <sean.tranchetti@oss.qualcomm.com>, Andrew Lunn <andrew+netdev@lunn.ch>, "David S. Miller" <davem@davemloft.net>, Eric Dumazet <edumazet@kernel.org>, Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>, Daniele Palmas <dnlplm@gmail.com>, Taehee Yoo <ap420073@gmail.com>, koen.vandeputte@citymesh.com, Antonio Quartulli <antonio@mandelbit.com> X-Mailer: git-send-email 2.56.1 X-In-Reply-To: <20261126163219.1744750-1-antonio@mandelbit.com> X-Mailing-List: netdev@vger.kernel.org X-List-Post: <mailto:netdev@vger.kernel.org> X-List-Help: <mailto:netdev+help@vger.kernel.org> X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org> X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org> X-List-Owner: <mailto:netdev+owner@vger.kernel.org> X-Precedence: list X-Rspamd-Queue-Id: 4jb2Bz24SRzNkXR