From: sashiko-bot@kernel.org
To: "Wentao Liang" <vulab@iscas.ac.cn>
Cc: intel-wired-lan@lists.osuosl.org
Subject: Re: [PATCH] ice: release the VF reference in the switchdev trust path
Date: Wed, 04 Nov 2026 10:11:01 +0000 [thread overview]
Message-ID: <sashiko-outbox-197051@kernel.org> (raw)
In-Reply-To: <20261103100530.1309907-1-vulab@iscas.ac.cn>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] ice: incorrect Fixes tag in commit message for ice_set_vf_trust() leak fix
--
commit 42da2ece24c78562b789e051c2ce4c73f6f2c81d
Author: Wentao Liang <vulab@iscas.ac.cn>
ice: release the VF reference in the switchdev trust path
This commit updates ice_set_vf_trust() to jump to the out_put_vf label so
that the VF reference acquired by ice_get_vf_by_id() is released when
rejecting trust changes in switchdev mode.
> ice: release the VF reference in the switchdev trust path
>
> ice_set_vf_trust() takes a reference on the VF with ice_get_vf_by_id()
> and then rejects the request when the PF is in switchdev mode without
> dropping that reference.
>
> Return through the existing out_put_vf label so the VF reference is
> released on this path too.
>
> Fixes: 1281b7459657 ("ice: Forbid trusted VFs in switchdev mode")
> Cc: stable@vger.kernel.org
> Assisted-by: DeepSeek-V4.1-Flash and OpenAI Codex
> Signed-off-by: Wentao Liang <vulab@iscas.ac.cn>
[Severity: Low]
In drivers/net/ethernet/intel/ice/ice_sriov.c, commit 1281b7459657 ("ice:
Forbid trusted VFs in switchdev mode") placed the
ice_is_eswitch_mode_switchdev(pf) check at the start of ice_set_vf_trust()
prior to looking up the VF. Even after commit 3d5985a185e6 ("ice: convert VF
storage to hash table with krefs and RCU") introduced ice_get_vf_by_id() and
the out_put_vf label, ice_get_vf_by_id() was still called after the switchdev
mode check.
The VF reference leak when ice_is_eswitch_mode_switchdev(pf) is true was
introduced by commit 83b49e7f63da ("ice: check if VF exists before mode
check"), which moved vf = ice_get_vf_by_id(pf, vf_id) above the
ice_is_eswitch_mode_switchdev(pf) check without updating the return
-EOPNOTSUPP path to jump to out_put_vf. Backporting this patch to stable
trees containing 1281b7459657 or 3d5985a185e6 without 83b49e7f63da would jump
to out_put_vf before vf is initialized.
Should the Fixes tag reference commit 83b49e7f63da ("ice: check if VF exists
before mode check") instead?
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261103100530.1309907-1-vulab@iscas.ac.cn?part=1
next prev parent reply other threads:[~2026-11-04 10:11 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-03 10:05 [PATCH] ice: release the VF reference in the switchdev trust path Wentao Liang
2026-11-03 10:10 ` netdev-bot+sinfo
2026-11-03 10:25 ` Krzysztof Kozlowski
2026-11-04 10:11 ` sashiko-bot [this message]
2026-11-07 11:50 ` netdev-bot+sashiko
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=sashiko-outbox-197051@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=intel-wired-lan@lists.osuosl.org \
--cc=sashiko-reviews@lists.linux.dev \
--cc=vulab@iscas.ac.cn \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox