Article View: linux.kernel.netdev
Article #22848[PATCH] idpf: fix vport_id used as array index in MAC filter async handler
From: guohongyu
Date: Thu, 26 Nov 2026 02:08
Date: Thu, 26 Nov 2026 02:08
39 lines
10106 bytes
10106 bytes
idpf_mac_filter_async_handler() resolves the vport for an incoming
ADD/DEL_MAC_ADDR async response with idpf_vid_to_vport(), but then
ignores the resolved vport and indexes adapter->vport_config[]
directly with the raw 32-bit vport_id from the virtchnl message.
vport_config[] has num_max_vports entries and vport_id is an opaque
device-side identifier that the protocol does not bound by it, so
a vport id not smaller than num_max_vports makes the handler read
past the end of the array and use the garbage result as a
struct idpf_vport_config (spinlock taken, filter list walked,
entries list_del()'ed through out-of-bounds pointers).
Fix this by using the software index of the already-resolved vport,
adapter->vport_config[vport->idx], as every other call site in the
driver already does. The index comes from the vport allocation
slot and is always in range.
Fixes: 41252855df77 ("idpf: add async_handler for MAC filter messages")
Cc: stable@vger.kernel.org
Signed-off-by: guohongyu <guohongyu@cmss.chinamobile.com>
---
drivers/net/ethernet/intel/idpf/idpf_virtchnl.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/intel/idpf/idpf_virtchnl.c b/drivers/net/ethernet/intel/idpf/idpf_virtchnl.c
index 1caf52706973..e72877242612 100644
--- a/drivers/net/ethernet/intel/idpf/idpf_virtchnl.c
+++ b/drivers/net/ethernet/intel/idpf/idpf_virtchnl.c
@@ -3794,7 +3794,7 @@ static void idpf_mac_filter_async_handler(void *ctx,
if (!vport)
goto invalid_payload;
- vport_config = adapter->vport_config[le32_to_cpu(ma_list->vport_id)];
+ vport_config = adapter->vport_config[vport->idx];
ma_list_head = &vport_config->user_config.mac_filter_list;
/* We can't do much to reconcile bad filters at this point, however we
--
2.43.0
Technical Details
Message-ID:
<20261126020854.233971-1-guohongyu@cmss.chinamobile.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!feeder1.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-371811-linux-kernel-netdev=dewy.ruShow 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!feeder1.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-371811-linux-kernel-netdev=dewy.ru From: guohongyu@cmss.chinamobile.com (guohongyu) Newsgroups: linux.kernel.netdev Subject: [PATCH] idpf: fix vport_id used as array index in MAC filter async handler Date: Thu, 26 Nov 2026 10:08:54 +0800 Organization: Usenet Network Message-ID: <20261126020854.233971-1-guohongyu@cmss.chinamobile.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Injection-Info: usenet.network; logging-data="359354"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:RY+B4l+2TNol8zJYET1xvk6rZFo= sha256:oaeOOn+kfthVcAKdeubCQh7BErn4/lhVyYPzQ9rBQJs= sha1:WFRX4znVVpcI/zBYrNgma2oT2VI= sha256:bQ+e1PqhNo5XDdTEchOhLWAI/hJR0Jf0BrZu4CnqA00= 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 D1375125EAE; Thu, 26 Nov 2026 05:16:42 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -2.75 X-Spam-Status: No, score=-2.75 tagged_above=-9999 required=6.31 tests=[DCC_REPUT_70_89=0.1, DKIM_INVALID=0.1, DKIM_SIGNED=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=fail (1024-bit key) reason="fail (body has been altered)" header.d=cmss.chinamobile.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 NlVGNUj8FvxG; Thu, 26 Nov 2026 05:16:37 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-371811-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> X-Authentication-Results: OpenDMARC; dmarc=fail (p=none dis=none) header.from=cmss.chinamobile.com X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10]) by mail.dewy.ru (Postfix) with ESMTPS id 41E6D125EA3; Thu, 26 Nov 2026 05:16:27 +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 B8D0A415AE; Thu, 26 Nov 2026 02:16:25 +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=1795659385; b=couPHMLJBmZnSRV6Vg9BFiXVfMZr5Vt7aOX8V8MCmKADqlD5z2IIc+BAEUDcFXkXqFTu mmdJWmSAtDU4h7jmfZptyb7Zv4q+li7Va/DPcAYq3Nf0HNObPGGBRIDRCjSr28VOh/Sf0 ZCruIL27N3Xo7fr4ECu42qc/fO2FCY4tmGGStyxFt2pvUdK2A8uxuvfVh9e30dB0uBc7I SIhH62RI7c/aTGYhabd5zELNk28syO1Tzdg+5GJTPum6MuU+DcG2KsZd2Qp1IjV1MgSVB WasEm0365Wp+FDUyQahNi9BDZXJ2cxRj2r/djzcwQYYjtgBUCjXSQYgjjtcVtGzJPsg== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795659385; h=X-Original-To:Received:DMARC-Filter:DKIM-Signature:X-RM-TagInfo: X-RM-SPAM-FLAG:Received:X-RM-TRANSID:X-RM-TagInfo:X-RM-SPAM-FLAG: Received:X-RM-TRANSID:From:To:Cc:Subject:Date:Message-ID:X-Mailer: X-Mailing-List:List-Id:List-Post:List-Help:List-Subscribe: List-Unsubscribe:List-Owner:Precedence:MIME-Version: Content-Transfer-Encoding; bh=uPDIrhBZZQhYm/jOhRKU4pdro1NOP3kPaXWAAZHnIVc=; b=V2IAQ0yEis3CbUudhptXDGmJLofJiQP2clI+9Vpkb4vV1aHquCHSfQTbH66x88j4DIft lZcqkB2Cfyk0lQJEQTtr8GHWWsGaDK9tLCxYUlf/o95GPE/bHaLrI41atnfgC8XfOHBee aPbCD0mkocUA2D+WYfWz3imhQJ5C1IQiuyeFitIw+hg0LUahs69u2ZbanViwWRIKMouVt dXsQydSyQ1qn91KeloE3EhUh+9oB1wo1u4f/pUDqTP2oTLEIC6M31idYQVG02oYdsVUQf lZ+8UtNYrwH4lxQvLHu4rRal5k4tcxQFoV31xMe6NieJqPRljPokWV0kfGlf8hy/Big== X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dkim=pass header.d=cmss.chinamobile.com header.i=@cmss.chinamobile.com header.a=rsa-sha256 header.s=default header.b=NehphdrY; dmarc=pass header.from=cmss.chinamobile.com; spf=pass smtp.mailfrom=cmss.chinamobile.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 3C48F606A330; Thu, 26 Nov 2026 02:16:25 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=cmss.chinamobile.com header.i=@cmss.chinamobile.com header.a=rsa-sha256 header.s=default header.b=NehphdrY X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=111.22.67.135 X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1795659384; b=2fcnDmmcfZEaneNuivI2QxtSXmg/aWsWKia/5Re/QWZeJ9MfkNBIA7BBLlwEhORPsnf/ Eh4nvacQ0ZIh/juGlRMzOF36sZL0yEPPN6qT5TGUhCOgdTtQXz8s4bLoPJJGXVirNJ9VM PxJae2/Nn6YnREBUCsDoU4L0N53mygO3BHcADZ6MiuKDBjvEfYjsw1jwpWkFB9EzLBQ5f hWvzu4KfKS7p4hTGrfVsaPoviEpQ+PH7k6fyjTaROByHOL3DTjRUIxoJTJOO/pjLShdEi YEwEK3oW8kEqk5+V8chU/pXDBnodsO9stNFtZrBYnkysOYFRg1fLQD3NgaJqtwIyqSA== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795659384; h=DMARC-Filter:DKIM-Signature:X-RM-TagInfo:X-RM-SPAM-FLAG:Received: X-RM-TRANSID:X-RM-TagInfo:X-RM-SPAM-FLAG:Received:X-RM-TRANSID:From: To:Cc:Subject:Date:Message-ID:X-Mailer:MIME-Version: Content-Transfer-Encoding; bh=uPDIrhBZZQhYm/jOhRKU4pdro1NOP3kPaXWAAZHnIVc=; b=CpwR4njyCa6zOoDu40hXIpGMLZxxsBd4JA7JxUo8cITP9w3fvsehIw+Ws+ysvgTk2IBR 4muo4nujUXbkZ1bNVcPevAaJmApkgtUy2bq7EF9WyoXEoJHA6UWXJ+hqqp+Eja8B8bNuu XnE6WFcE3gZIb/KnXdGx/LIN87VAuNE6Y9hI23evT/Lw5u9Ia7ncDaOgnneLB8JAa7K01 MSmixvC4Mznq4f5C0bzxEUts4lBWsHH08tbZw04LOxOstM/xUnJSNPx8r109D7tMTOLYE 8FEwbfiNZ+UCVcfUBPTG1FBZCyiA5/ZhVZlNGgqsnjt1SqelffjIMKfmn1L9OKRITeg== X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=cmss.chinamobile.com; spf=pass smtp.mailfrom=cmss.chinamobile.com; dkim=pass header.d=cmss.chinamobile.com header.i=@cmss.chinamobile.com header.a=rsa-sha256 header.s=default header.b=NehphdrY; arc=none smtp.remote-ip=111.22.67.135 X-Received: from cmccmta2.chinamobile.com (cmccmta2.chinamobile.com [111.22.67.135]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C1767606A321; Thu, 26 Nov 2026 02:16:21 +0000 (UTC) X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org C1767606A321 X-Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=cmss.chinamobile.com X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=cmss.chinamobile.com X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cmss.chinamobile.com; s=default; l=0; h=from:subject:message-id:to:cc:mime-version; bh=47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU=; b=NehphdrYlNJuhK/r3Pgz7mDNHQt6RPkJll3TIxy+8ZS1PPYun3eXPNZIY42GfunhZS+ZdWAJmcK5c 0sCASkkkykHR3NQBrS26wGVuMPhnDz/w0Ge5ub26/IQzJqKuQusv6bIeAsfmjYpPOfz0GxbBL00Z+y aR3p5ij53/BkqIdU= X-RM-TagInfo: emlType=0 X-RM-SPAM-FLAG: 00000000 X-Received: from spf.mail.chinamobile.com (unknown[10.188.0.87]) by rmmx-syy-dmz-app07-12007 (RichMail) with SMTP id 2ee76b07966df1d-5720b; Thu, 26 Nov 2026 10:16:13 +0800 (CST) X-RM-TRANSID: 2ee76b07966df1d-5720b X-RM-TagInfo: emlType=0 X-RM-SPAM-FLAG: 00000000 X-Received: from localhost.localdomain (unknown[223.112.32.189]) by rmsmtp-syy-appsvr08-12008 (RichMail) with SMTP id 2ee86b07966c228-589e7; Thu, 26 Nov 2026 10:16:13 +0800 (CST) X-RM-TRANSID: 2ee86b07966c228-589e7 X-Cc: anthony.l.nguyen@intel.com, przemyslaw.kitszel@intel.com, andrew+netdev@lunn.ch, davem@davemloft.net, edumazet@kernel.org, kuba@kernel.org, pabeni@redhat.com, alan.brady@intel.com, stable@vger.kernel.org, 13057616121@163.com X-Mailer: git-send-email 2.43.0 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