Article View: linux.kernel.netdev
Article #23424Re: [PATCH net v2 1/1] netdevsim: bound the peer TX queue index in nsim_start_peer_tx_queue()
From: Jiayuan Chen
Date: Fri, 27 Nov 2026 09:20
Date: Fri, 27 Nov 2026 09:20
24 lines
9317 bytes
9317 bytes
On 11/22/26 3:32 AM, Kyuwon Cho wrote:
> nsim_start_peer_tx_queue() wakes the peer's TX queue with the index of
> the RX queue being polled, and only compares this device's TX queue
> count with the peer's RX queue count. When the device is relinked to a
> peer with fewer TX queues while its RX queues still hold traffic from
> the old peer, the index is past the peer's TX queue array:
>
> BUG: KASAN: slab-out-of-bounds in nsim_poll (include/linux/netdevice.h:3834 drivers/net/netdevsim/netdev.c:60)
> Read of size 8
> Call Trace:
> <IRQ>
> nsim_poll (drivers/net/netdevsim/netdev.c:409)
> __napi_poll.constprop.0 (net/core/dev.c:7997)
> net_rx_action (net/core/dev.c:8217)
>
> Skip the wake-up when the index is not a TX queue of the peer.
>
> Fixes: ff2ac4df58ad ("netdevsim: implement peer queue flow control")
> Signed-off-by: Kyuwon Cho <kyuwoncho18@gmail.com>
Reviewed-by: Jiayuan Chen <jiayuan.chen@linux.dev>
Technical Details
Message-ID:
<7f411177-8ecd-4411-8873-bb2ff232dff6@linux.dev>Path:
mbox-mo1.pugleaf.net!srv.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-372566-linux-kernel-netdev=dewy.ruReferences:
<179528809256.2009509.5007624677973207521@gmail.com> <179528810243.2011658.9050974542546209152@gmail.com>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-372566-linux-kernel-netdev=dewy.ru From: jiayuan.chen@linux.dev (Jiayuan Chen) Newsgroups: linux.kernel.netdev Subject: Re: [PATCH net v2 1/1] netdevsim: bound the peer TX queue index in nsim_start_peer_tx_queue() Date: Fri, 27 Nov 2026 17:20:29 +0800 Organization: Usenet Network Message-ID: <7f411177-8ecd-4411-8873-bb2ff232dff6@linux.dev> References: <179528809256.2009509.5007624677973207521@gmail.com> <179528810243.2011658.9050974542546209152@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Injection-Info: usenet.network; logging-data="693309"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:UKCkGCHIjC2Tt0KKt9LIr4Jm898= sha256:Z4rvgK4pakBdfaPIq+6TaqSPIqSLMzJWJ899LzVSlo8= sha1:1U1+7jWqj4D4m+0NVkXbTKRock8= sha256:UgmaPJv1cBuqRTZlfnW7/yt2gkfQOw9oE7a0F4Ro5Z8= 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 0D4FA125F38; Fri, 27 Nov 2026 12:21:08 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -2.151 X-Spam-Status: No, score=-2.151 tagged_above=-9999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HEADER_FROM_DIFFERENT_DOMAINS=0.249, HK_RANDOM_FROM=1, MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001] autolearn=ham autolearn_force=no X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (1024-bit key) header.d=linux.dev 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 TxLR7loboF1u; Fri, 27 Nov 2026 12:21:04 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.105.105.114; helo=tor.lore.kernel.org; envelope-from=netdev+bounces-372566-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> X-Authentication-Results: OpenDMARC; dmarc=fail (p=none dis=none) header.from=linux.dev X-Received: from tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114]) by mail.dewy.ru (Postfix) with ESMTPS id 20685125F36; Fri, 27 Nov 2026 12:20:55 +0300 (MSK) X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by tor.lore.kernel.org (Postfix) with ESMTP id D5AFE3728D; Fri, 27 Nov 2026 09:20:50 +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=1795771247; b=hzZCaGOisuMSplAYGnFLhn2Jieyo0Acs/GkluZU4W5msgcHYoj0F4sd6w4vCQsOWVNeO S2vf9lxZHu6TKI+w2a+GH+xxm1IDuZMI/zYXj5JDk+t/8a0V4FG37AvB4rE8Y/aZ75OvS dGqy1iSyW6ltDNkZ22jTzNaMR/2JiQqL6By1j2HvsCfI+kDMhkfpYd6C4Rh8GaAG7Fq4h 5Cv9phffjT5o54/vzTj6QbaNHg1hWzB1c8OW5Gmjf357oMLYrF++KYoNWUlHyOMY4ufd3 6tPzhLIKQu2/CzSR6cTWBCeP6V2RIqxuvQ21oRoEFltvRi8rZHuZsMKNbn8M+fuWbrA== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795771247; h=X-Original-To:Received:DMARC-Filter:X-Envelope-To:DKIM-Signature: X-Envelope-To:Received:X-Mizu-Trace-ID:X-Migadu-Flow:Message-ID:Date: X-Mailing-List:List-Id:List-Post:List-Help:List-Subscribe: List-Unsubscribe:List-Owner:Precedence:MIME-Version:User-Agent: Subject:To:Cc:References:From:In-Reply-To:Content-Type: Content-Transfer-Encoding; bh=/7Oro6stEyht5ylWx2OeBhdAP8u3/yZshWoQxNRbz9o=; b=Gl2L05UeCsyAZoePlOznJEjN3QvDZj+zpmOYrxoO2u/2bmxOnVZSDSP7Rquxwy3eNKg0 yb0cnVOicoaZdmtHtRJ4tXe0T9+1LMPL6JD+0/pflvLK0YlT5Rk+ZE0muOlVZF8CVUy83 yLbBDnUdZa5ue8FQmKQOlgKKyj7ULfEnnnp5tdzyyMGzqREZnurYMFWlyMFij4AvZU7s3 ccCThZ//jTFqq31i/QuaGvbfM4BRWrqsct7USksHM0iJMX1U3/5+Zmz0tg5avAKAhY0CT I6mYqMBKhTnRR0SIistH5S3k4unlje5wihL9JVLy780OScMp6G3GnPzefrRI6bxd0yw== X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dkim=pass header.d=linux.dev header.i=@linux.dev header.a=rsa-sha256 header.s=key1 header.b=Ur9fmHQJ; dmarc=pass header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; 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 80627606A327; Fri, 27 Nov 2026 09:20:47 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key, unprotected) header.d=linux.dev header.i=@linux.dev header.a=rsa-sha256 header.s=key1 header.b=Ur9fmHQJ X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=91.218.175.49 X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1795771241; b=bkblQKm1v8rV/2vp38K3UR+3ht4AaXdop7xRuMih7ADIwnYX0tQXF1aKEJ/NRnBn5ffH 2S+nmwmfpcZ8+Elljvo0qwZpmdTQapPutHF8DbL8L/x79s8yvNYwQkENdZl2wVwnog5rF ss49DGyPgl+cBIx9siCOYJY1Ne/gSOiGtMlnZkAZfK9+aXtqK0mWcO35iMeNjDzyZNr1J X88dFatV/4VIJcUeaVu+GcQg0wZjhTpekE+DzNNcA5fyZqUBeL8Uccmz5fxDhNGTChcCV TqXer9aVwwNOnnS6r4FWpFkj+PMNio3IXIOgC6ypX6FmY6pIGQ2Q22KAIdYfOnEydcg== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795771241; h=DMARC-Filter:X-Envelope-To:DKIM-Signature:X-Envelope-To:Received: X-Mizu-Trace-ID:X-Migadu-Flow:Message-ID:Date:MIME-Version:User-Agent: Subject:To:Cc:References:From:In-Reply-To:Content-Type: Content-Transfer-Encoding; bh=/7Oro6stEyht5ylWx2OeBhdAP8u3/yZshWoQxNRbz9o=; b=NpVhhv3WU1EjAmg02Mdksw4ik3Qz3eq6DXusgD5r4PUjWgiJ6hcNt+7gWktRn5klXqVw hDaRYkYHPxz/SEepL2zTmP8UhQexv/KisdxjeuWXsDoOt3nRgz/f12HBgG5zkAQDQoFPl 4W9x89zAqcmSu7IpMZhK3RwuDlJsW/bYEf18IDfurt4J5qzkKBi935I8ubD90kKi4qIn2 jpfjeX1G+PWGMxrZrIdnlztEGOfhL2YtnV+2zflepUaNX7cUkQkc8UEZhiyPHWlHuPXxP aiMWit5SlwLe9nPtWtgqpC/PlDeEybfZWlSM/xvPv4ky8WQPyJnQGr9xPH8y3+HWuqg== X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass header.d=linux.dev header.i=@linux.dev header.a=rsa-sha256 header.s=key1 header.b=Ur9fmHQJ; arc=none smtp.remote-ip=91.218.175.49 X-Received: from mta0.migadu.com (out-49.mta0.migadu.com [91.218.175.49]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5A3CD606A326 for <netdev@vger.kernel.org>; Fri, 27 Nov 2026 09:20:39 +0000 (UTC) X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 5A3CD606A326 X-Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev X-Envelope-To: netdev@vger.kernel.org X-DKIM-Signature: a=rsa-sha256; bh=5/yRDbbSamitvwmgETj+GShqjtr6n0Tqkzy+8FxqKRc=; c=simple/simple; d=linux.dev; h=from:to:subject:date:message-id:mime-version:content-type; s=key1; t=1795771238; v=1; x=1796376038; b=Ur9fmHQJbiYGgYVO2RBEP2yt4dR4lJR7Dp7d0ronH15YG8aZObXZHh4xJRcXgPHhZSvd7XOX 7j8NNCUOLzROybwithXsjnJERgQAUC41S/ohxNwM1dVcRazcHBccJXiw6aY8EFM46oBYsC7IwxQ +bo2BRK71j9RrvCwMY+GOSeQ= X-Envelope-To: netdev@vger.kernel.org X-Received: by smtp.migadu.com with ESMTPS id b7fd4c2070e9fb12; Fri, 27 Nov 2026 09:20:37 +0000 X-Mizu-Trace-ID: b7fd4c2070e9fb12 X-Migadu-Flow: FLOW_OUT 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-User-Agent: Mozilla Thunderbird X-Cc: Breno Leitao <leitao@debian.org>, Andrew Lunn <andrew+netdev@lunn.ch>, "David S. Miller" <davem@davemloft.net>, Eric Dumazet <edumazet@kernel.org>, Paolo Abeni <pabeni@redhat.com>, netdev@vger.kernel.org, linux-kernel@vger.kernel.org X-In-Reply-To: <179528810243.2011658.9050974542546209152@gmail.com>