From: Jacob Keller <jacob.e.keller@intel.com>
To: <sashiko-reviews@lists.linux.dev>,
Aleksandr Loktionov <aleksandr.loktionov@intel.com>,
<intel-wired-lan@lists.osuosl.org>
Subject: Re: [PATCH iwl-net v2] ice: validate VF FDIR queue and queue region actions
Date: Mon, 2 Nov 2026 13:09:10 -0800 [thread overview]
Message-ID: <c858f6d0-2adb-4bd6-9889-19e14b0e30eb@intel.com> (raw)
In-Reply-To: <sashiko-outbox-169952@kernel.org>
On 10/13/2026 7:58 AM, sashiko-bot@kernel.org wrote:
> Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
> - [High] ice: memory leak of pkt_buf and prof in ice_vc_add_fdir_fltr error path
> --
>
> commit 6477a5eb13b0a0dff01249d4a775aff5939e63e5
> Author: Aleksandr Loktionov <aleksandr.loktionov@intel.com>
>
> ice: validate VF FDIR queue and queue region actions
>
> This commit validates the VF-supplied queue index and queue region in
> ice_vc_fdir_parse_action(), rejecting invalid values to prevent a VF from
> steering matched packets to queues beyond its own range.
>
>> diff --git a/drivers/net/ethernet/intel/ice/virt/fdir.c b/drivers/net/ethernet/intel/ice/virt/fdir.c
>> --- a/drivers/net/ethernet/intel/ice/virt/fdir.c
>> +++ b/drivers/net/ethernet/intel/ice/virt/fdir.c
> [ ... ]
>> @@ -1176,11 +1181,25 @@ ice_vc_fdir_parse_action(struct ice_vf *vf, struct virtchnl_fdir_add *fltr,
>> break;
>> case VIRTCHNL_ACTION_QUEUE:
>> dest_num++;
>> + if (action->act_conf.queue.index >= vsi->num_rxq) {
>> + dev_dbg(dev, "Invalid queue index %u for VF %d\n",
>> + action->act_conf.queue.index, vf->vf_id);
>> + return -EINVAL;
>> + }
>
> [Severity: High]
> This problem wasn't introduced by this patch, but does returning here leak
> memory if conf->pkt_buf and conf->prof were previously allocated?
>
> In ice_vc_add_fdir_fltr(), if ice_vc_fdir_parse_action() fails, it jumps to
> err_free_conf which frees the outer structure but not the inner ones:
>
> ice_vc_add_fdir_fltr() {
> ...
> ret = ice_vc_fdir_parse_action(vf, fltr, conf);
> if (ret) {
> ...
> goto err_free_conf;
> }
> ...
> err_free_conf:
> devm_kfree(dev, conf);
> ...
> }
>
> Earlier in the request handling, if this was a raw flow,
> ice_vc_fdir_parse_raw() allocates pkt_buf and prof and assigns them to the
> conf structure:
>
> ice_vc_fdir_parse_raw() {
> ...
> pkt_buf = kzalloc(pkt_len, GFP_KERNEL);
> ...
> conf->pkt_buf = pkt_buf;
> ...
> }
>
> Could an untrusted VF exhaust host memory by repeatedly sending requests
> with invalid queue parameters that trigger this return path?
>
At the very least, this new error should perform cleanup, even if you
don't take the time to fix every existing error path way that is broken.
Can you please investigate?
Thanks,
Jake
>> input->dest_ctl = ICE_FLTR_PRGM_DESC_DEST_DIRECT_PKT_QINDEX;
>> input->q_index = action->act_conf.queue.index;
>> break;
> [ ... ]
>
next prev parent reply other threads:[~2026-11-02 21:09 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-13 14:44 [PATCH iwl-net v2] ice: validate VF FDIR queue and queue region actions Aleksandr Loktionov
2026-10-13 14:58 ` sashiko-bot
2026-11-02 21:09 ` Jacob Keller [this message]
2026-11-19 15:24 ` [PATCH iwl-net v3 0/4] ice: validate VF FDIR actions and fix raw flow and timer cleanup Aleksandr Loktionov
2026-11-19 15:24 ` [PATCH iwl-net v3 1/4] ice: free VF FDIR raw flow data with the filter conf Aleksandr Loktionov
2026-11-19 15:24 ` [PATCH iwl-net v3 2/4] ice: validate VF FDIR queue action Aleksandr Loktionov
2026-11-19 15:24 ` [PATCH iwl-net v3 3/4] ice: validate VF FDIR queue region action Aleksandr Loktionov
2026-11-19 15:24 ` [PATCH iwl-net v3 4/4] ice: cancel FDIR program timer on VF exit Aleksandr Loktionov
2026-11-19 15:54 ` sashiko-bot
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=c858f6d0-2adb-4bd6-9889-19e14b0e30eb@intel.com \
--to=jacob.e.keller@intel.com \
--cc=aleksandr.loktionov@intel.com \
--cc=intel-wired-lan@lists.osuosl.org \
--cc=sashiko-reviews@lists.linux.dev \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.