[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <3e368ba8-f306-449c-b05a-0c5bd9258190@linux.dev>
Date: Tue, 25 Mar 2025 10:03:44 +0800
From: luoxuanqiang <xuanqiang.luo@...ux.dev>
To: Przemek Kitszel <przemyslaw.kitszel@...el.com>, anthony.l.nguyen@...el.com
Cc: davem@...emloft.net, edumazet@...gle.com, netdev@...r.kernel.org,
"intel-wired-lan@...ts.osuosl.org" <intel-wired-lan@...ts.osuosl.org>,
Jacob Keller <jacob.e.keller@...el.com>,
Mateusz Polchlopek <mateusz.polchlopek@...el.com>,
"Czapnik, Lukasz" <lukasz.czapnik@...el.com>
Subject: Re: [PATCH] ice: Check VF VSI Pointer Value in ice_vc_add_fdir_fltr()
在 2025/3/24 18:54, Przemek Kitszel 写道:
> On 3/21/25 10:52, luoxuanqiang wrote:
>> From: luoxuanqiang <luoxuanqiang@...inos.cn>
>>
>> As mentioned in the commit baeb705fd6a7 ("ice: always check VF VSI
>> pointer values"), we need to perform a null pointer check on the return
>> value of ice_get_vf_vsi() before using it.
>>
>> Fixes: 6ebbe97a4881 ("ice: Add a per-VF limit on number of FDIR
>> filters")
>> Signed-off-by: luoxuanqiang <xuanqiang.luo@...ux.dev>
>
> Thank you for your patch, it looks good.
> To apply it you have to provide us your name in the format:
> Firstname Surname
> (or similar, could include more than 2 words)
>
> please also CC IWL mailing list (CC'd by me) to have faster feedback :)
> would be best if you put [PATCH iwl-net v2] in the subject
>
Thank you for your detailed suggestions. I've already sent out the v2. :)
>> ---
>> drivers/net/ethernet/intel/ice/ice_virtchnl_fdir.c | 6 ++++++
>> 1 file changed, 6 insertions(+)
>>
>> diff --git a/drivers/net/ethernet/intel/ice/ice_virtchnl_fdir.c
>> b/drivers/net/ethernet/intel/ice/ice_virtchnl_fdir.c
>> index 14e3f0f89c78..53bad68e3f38 100644
>> --- a/drivers/net/ethernet/intel/ice/ice_virtchnl_fdir.c
>> +++ b/drivers/net/ethernet/intel/ice/ice_virtchnl_fdir.c
>> @@ -2092,6 +2092,12 @@ int ice_vc_add_fdir_fltr(struct ice_vf *vf, u8
>> *msg)
>> dev = ice_pf_to_dev(pf);
>> vf_vsi = ice_get_vf_vsi(vf);
>> + if (!vf_vsi) {
>> + dev_err(dev, "Can not get FDIR vf_vsi for VF %u\n", vf->vf_id);
>> + v_ret = VIRTCHNL_STATUS_ERR_PARAM;
>> + goto err_exit;
>> + }
>> +
>> #define ICE_VF_MAX_FDIR_FILTERS 128
>> if (!ice_fdir_num_avail_fltr(&pf->hw, vf_vsi) ||
>> vf->fdir.fdir_fltr_cnt_total >= ICE_VF_MAX_FDIR_FILTERS) {
>
Powered by blists - more mailing lists