🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #22866

Re: [PATCH] idpf: fix vport_id used as array index in MAC filter async handler

#22866
From: guohongyu
Date: Thu, 26 Nov 2026 02:35
21 lines
9614 bytes
Answers to the three questions:

- How the issue was discovered: manual code inspection.  The handler
was found during a code audit of the idpf virtchnl receive paths;
the bug is visible by reading the function: it resolves the vport
with idpf_vid_to_vport() and then does not use it, indexing
vport_config[] with the raw vport_id instead, unlike every other
call site in the driver.

- Whether the issue was actually triggered: no, it is not proven at
runtime.  The out-of-bounds path requires a control plane that hands
out a vport id not smaller than num_max_vports and then reports a
failing ADD/DEL_MAC_ADDR status for it; no hardware was available to
exercise this, so the issue is theoretical, found by inspection.

- Testing: no real hardware available.  The change is a one-line
substitution of an array index; it was compile-tested with
CONFIG_IDPF=m (x86_64, gcc 12), builds without new warnings.

Thanks.
Technical Details
Message-ID: <20261126023554.236227-1-guohongyu@cmss.chinamobile.com>
Path: mbox-mo1.pugleaf.net!news-lon.pugleaf.net!srl.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-371830-linux-kernel-netdev=dewy.ru
References: <179565949384.3294.6218603099017752049@kernel.org>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-lon.pugleaf.net!srl.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-371830-linux-kernel-netdev=dewy.ru
From: guohongyu@cmss.chinamobile.com (guohongyu)
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH] idpf: fix vport_id used as array index in MAC filter async handler
Date: Thu, 26 Nov 2026 10:35:54 +0800
Organization: Usenet Network
Message-ID: <20261126023554.236227-1-guohongyu@cmss.chinamobile.com>
References: <179565949384.3294.6218603099017752049@kernel.org>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
	logging-data="363640"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:gYaOvq2f3rr5k7PqviwgE+q8LPU= sha256:YLcSLcatrZltiihKmR4M21nXMEg1rn5qPBxeADF+pPM=
	sha1:Hi0nx9Q0K9yldNLB2uAFqgI6sO8= sha256:2S3L5BpAYmkKI51hgnTtNNEpvZ5viKrkBK50H4rVK1w=
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 44DF3125EAE; Thu, 26 Nov 2026 05:43:45 +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 mGbaqGSI_yhQ;
	Thu, 26 Nov 2026 05:43: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-371830-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 E1B7F125EA3; Thu, 26 Nov 2026 05:43:26 +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 B94D43C2F5; Thu, 26 Nov 2026 02:43:23 +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=1795661003;
	b=iGiDUok8ZB7TQk4FqBftc+ywmLAdp1KjMredjVAlz8XO+xu8q+Xh3x6hHpvjcE98YrlM
	 X8KcffnHr1k+CWS0zHuiXfuNdhqpt08Il+9KYWJ6PIFWe1WtN2Fq3+48H2MwoS7yJQMkp
	 3p+MtVWuj+QlUcrH0RjH89Sx5ZINCBRTug6mCku8u4dG52fuuiEWZkRSCzCefLkVWxSYK
	 jncya0h+RCLyYWEPoJtcnExwwOZY0HNLvDk7wOJ/2AOAyulJ9A4/arlwTMAU72rA9UMeu
	 RrICS3nzbt93+ixmvjyKFJA7vMySuNGr7/J2/Q8y1CffTa6Um1U8Q0Og1my0wlzUISg==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1795661003;
	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:
	 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;
	bh=qWvv2TqLG+DDcD+PAmBT8QsFJXn/Tm36sf/CUsjlj1E=;
	b=jiJiXlFN+S1bA4E2pzCI+PIMHoXiCIliyyMLnvH/0LPi0V+pgahWzHGxLhmUOc7sfwro
	 /H1I3aFhSVUbIxe7EY3dWF3MYyuwMXCZKq1Cg7f+cE9a83fFPOkw3UaZLgHQLuC4HLYS+
	 xv2AB7LVH0X9Qm5yj9Kz49qhPcm2GGalkSiDgv/vdOc3Jc4SlGolfMzYT5ZsTnS1ZsZj3
	 g6hElFhiZ7MgOKdO5Zprk9H2QjDJcIxLa+6S2EzBY7/ylvOoOSXkJV8fg4Lhpo/bZkCxI
	 RlXxqry90xaR19NjhV2jNjfqsdoCYxikHzWQMEJ96AcfEeFElm0+XVN28bP2XkAxlvA==
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=uBFBQdyY;
	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 8ED74606A32C;
	Thu, 26 Nov 2026 02:43:23 +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=uBFBQdyY
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=111.22.67.151
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
	t=1795661002;
	b=YMCTfqj6ltDb2xIsS/sSuQff88gZp7NeVM6SISCD866fhdgCZ67xFaKfXW+9L9FiTdzg
	 g9mSM+dITP7GUdL+0dtpCLjN6atln1asC7GVseraR/ta9hDfKFE9QR4dRPAXuABNOoQBu
	 NjEcUYaW/rtQernmUfMQaXKBTQxchttK5UZ29+U/CFRD3sBbZsZMkxtF8jwJ1GVVRvslm
	 8PHAwaCjgTBJSrKF43udytHNMSEfZqUZgTVYVgN543u1PjeQpFCkb9SmGn5vbW3Sigg4A
	 G6QVf+okY46meeq4L7RYUMZHcwPfld1kx/dhBH6+JRgUCrPrwHSZlLQRrEVkq53Fo5A==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1795661002;
	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:In-Reply-To:References:
	 MIME-Version:Content-Transfer-Encoding;
	bh=qWvv2TqLG+DDcD+PAmBT8QsFJXn/Tm36sf/CUsjlj1E=;
	b=2wsj7D45IzrGYiGkbGVsPqgZPFq541veC390hOpnUVbeYPhHqAsLY/qriArvcW+mq/Gt
	 HWc5ECl8io3tuTEcSCEndqL/BDAwyLatzx29RAsroemHZwHOYMF/Tn1qHCfvg3FF3ZHi+
	 tqnFvWrs6w4gARMuGpVPUR9KAhIx1n48dKTo/yUOgSgH2g8hB7Lt7dff5KlkH1NRnBolq
	 gYsxVy4U0O5W5oS/bW84vcvC2VTAGE+alKTDFlB2Rf51yoz4Ot9RiNskO2vyrwjFGhm6T
	 43IFzJ39WBaCPcBapTk4EDj7v8e0OZUK1PB2ju9jKJlfhxs5mAPfyQN8kIjC9a5OZLw==
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=uBFBQdyY;
	arc=none smtp.remote-ip=111.22.67.151
X-Received: from cmccmta8.chinamobile.com (cmccmta8.chinamobile.com [111.22.67.151])
	by smtp.subspace.kernel.org (Postfix) with ESMTP id A244A606A31E;
	Thu, 26 Nov 2026 02:43:20 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org A244A606A31E
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=uBFBQdyY7eeGvDEu1EHoA1sjznvuGZOpp8m2I05L7s20Nh08C8d+h54fqvCSFGhYBYfhxEs9+0Ogi
	 1YNKda2Efa8cC1/xnVTqSCo986gvMZo7O6ZLhGbZ1yAjyAWVwQnNed2YQ4OoJ+6RN4E9C5Tp5sZNgB
	 wtzeGsSOKVMtpAvk=
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-app06-12006 (RichMail) with SMTP id 2ee66b079cbee5a-23449;
	Thu, 26 Nov 2026 10:43:11 +0800 (CST)
X-RM-TRANSID: 2ee66b079cbee5a-23449
X-RM-TagInfo: emlType=0                                       
X-RM-SPAM-FLAG: 00000000
X-Received: from localhost.localdomain (unknown[223.112.32.189])
	by rmsmtp-syy-appsvr03-12003 (RichMail) with SMTP id 2ee36b079cbece4-595b9;
	Thu, 26 Nov 2026 10:43:11 +0800 (CST)
X-RM-TRANSID: 2ee36b079cbece4-595b9
X-Cc: intel-wired-lan@lists.osuosl.org,
	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-In-Reply-To: <179565949384.3294.6218603099017752049@kernel.org>
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