* [PATCH iwl-net] idpf: fix VF dynamic interrupt ctl register initialization
@ 2024-08-28 22:38 Ahmed Zaki
2024-09-02 8:49 ` Simon Horman
0 siblings, 1 reply; 3+ messages in thread
From: Ahmed Zaki @ 2024-08-28 22:38 UTC (permalink / raw)
To: intel-wired-lan; +Cc: netdev, pavan.kumar.linga, Ahmed Zaki, Przemek Kitszel
The VF's dynamic interrupt ctl "dyn_ctl_intrvl_s" is not initialized
in idpf_vf_intr_reg_init(). This resulted in the following UBSAN error
whenever a VF is created:
[ 564.345655] UBSAN: shift-out-of-bounds in drivers/net/ethernet/intel/idpf/idpf_txrx.c:3654:10
[ 564.345663] shift exponent 4294967295 is too large for 32-bit type 'int'
[ 564.345671] CPU: 33 UID: 0 PID: 2458 Comm: NetworkManager Not tainted 6.11.0-rc4+ #1
[ 564.345678] Hardware name: Intel Corporation M50CYP2SBSTD/M50CYP2SBSTD, BIOS SE5C6200.86B.0027.P10.2201070222 01/07/2022
[ 564.345683] Call Trace:
[ 564.345688] <TASK>
[ 564.345693] dump_stack_lvl+0x91/0xb0
[ 564.345708] __ubsan_handle_shift_out_of_bounds+0x16b/0x320
[ 564.345730] idpf_vport_intr_update_itr_ena_irq.cold+0x13/0x39 [idpf]
[ 564.345755] ? __pfx_idpf_vport_intr_update_itr_ena_irq+0x10/0x10 [idpf]
[ 564.345771] ? static_obj+0x95/0xd0
[ 564.345782] ? lockdep_init_map_type+0x1a5/0x800
[ 564.345794] idpf_vport_intr_ena+0x5ef/0x9f0 [idpf]
[ 564.345814] idpf_vport_open+0x2cc/0x1240 [idpf]
[ 564.345837] idpf_open+0x6d/0xc0 [idpf]
[ 564.345850] __dev_open+0x241/0x420
Fixes: d4d558718266 ("idpf: initialize interrupts and enable vport")
Reviewed-by: Przemek Kitszel <przemyslaw.kitszel@intel.com>
Signed-off-by: Ahmed Zaki <ahmed.zaki@intel.com>
---
drivers/net/ethernet/intel/idpf/idpf_vf_dev.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/net/ethernet/intel/idpf/idpf_vf_dev.c b/drivers/net/ethernet/intel/idpf/idpf_vf_dev.c
index 629cb5cb7c9f..5d4182ca0ff6 100644
--- a/drivers/net/ethernet/intel/idpf/idpf_vf_dev.c
+++ b/drivers/net/ethernet/intel/idpf/idpf_vf_dev.c
@@ -98,6 +98,7 @@ static int idpf_vf_intr_reg_init(struct idpf_vport *vport)
reg_vals[vec_id].dyn_ctl_reg);
intr->dyn_ctl_intena_m = VF_INT_DYN_CTLN_INTENA_M;
intr->dyn_ctl_itridx_s = VF_INT_DYN_CTLN_ITR_INDX_S;
+ intr->dyn_ctl_intrvl_s = VF_INT_DYN_CTLN_INTERVAL_S;
spacing = IDPF_ITR_IDX_SPACING(reg_vals[vec_id].itrn_index_spacing,
IDPF_VF_ITR_IDX_SPACING);
--
2.43.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH iwl-net] idpf: fix VF dynamic interrupt ctl register initialization
2024-08-28 22:38 [PATCH iwl-net] idpf: fix VF dynamic interrupt ctl register initialization Ahmed Zaki
@ 2024-09-02 8:49 ` Simon Horman
2024-09-25 20:22 ` Singh, Krishneil K
0 siblings, 1 reply; 3+ messages in thread
From: Simon Horman @ 2024-09-02 8:49 UTC (permalink / raw)
To: Ahmed Zaki; +Cc: intel-wired-lan, netdev, pavan.kumar.linga, Przemek Kitszel
On Wed, Aug 28, 2024 at 04:38:25PM -0600, Ahmed Zaki wrote:
> The VF's dynamic interrupt ctl "dyn_ctl_intrvl_s" is not initialized
> in idpf_vf_intr_reg_init(). This resulted in the following UBSAN error
> whenever a VF is created:
>
> [ 564.345655] UBSAN: shift-out-of-bounds in drivers/net/ethernet/intel/idpf/idpf_txrx.c:3654:10
> [ 564.345663] shift exponent 4294967295 is too large for 32-bit type 'int'
> [ 564.345671] CPU: 33 UID: 0 PID: 2458 Comm: NetworkManager Not tainted 6.11.0-rc4+ #1
> [ 564.345678] Hardware name: Intel Corporation M50CYP2SBSTD/M50CYP2SBSTD, BIOS SE5C6200.86B.0027.P10.2201070222 01/07/2022
> [ 564.345683] Call Trace:
> [ 564.345688] <TASK>
> [ 564.345693] dump_stack_lvl+0x91/0xb0
> [ 564.345708] __ubsan_handle_shift_out_of_bounds+0x16b/0x320
> [ 564.345730] idpf_vport_intr_update_itr_ena_irq.cold+0x13/0x39 [idpf]
> [ 564.345755] ? __pfx_idpf_vport_intr_update_itr_ena_irq+0x10/0x10 [idpf]
> [ 564.345771] ? static_obj+0x95/0xd0
> [ 564.345782] ? lockdep_init_map_type+0x1a5/0x800
> [ 564.345794] idpf_vport_intr_ena+0x5ef/0x9f0 [idpf]
> [ 564.345814] idpf_vport_open+0x2cc/0x1240 [idpf]
> [ 564.345837] idpf_open+0x6d/0xc0 [idpf]
> [ 564.345850] __dev_open+0x241/0x420
>
> Fixes: d4d558718266 ("idpf: initialize interrupts and enable vport")
> Reviewed-by: Przemek Kitszel <przemyslaw.kitszel@intel.com>
> Signed-off-by: Ahmed Zaki <ahmed.zaki@intel.com>
Thanks,
I see that this now matches the implementation of idpf_intr_reg_init().
Reviewed-by: Simon Horman <horms@kernel.org>
^ permalink raw reply [flat|nested] 3+ messages in thread
* RE: [PATCH iwl-net] idpf: fix VF dynamic interrupt ctl register initialization
2024-09-02 8:49 ` Simon Horman
@ 2024-09-25 20:22 ` Singh, Krishneil K
0 siblings, 0 replies; 3+ messages in thread
From: Singh, Krishneil K @ 2024-09-25 20:22 UTC (permalink / raw)
To: Simon Horman, Zaki, Ahmed
Cc: intel-wired-lan@lists.osuosl.org, netdev@vger.kernel.org,
Linga, Pavan Kumar, Kitszel, Przemyslaw
> -----Original Message-----
> From: Simon Horman <horms@kernel.org>
> Sent: Monday, September 2, 2024 1:49 AM
> To: Zaki, Ahmed <ahmed.zaki@intel.com>
> Cc: intel-wired-lan@lists.osuosl.org; netdev@vger.kernel.org; Linga, Pavan
> Kumar <pavan.kumar.linga@intel.com>; Kitszel, Przemyslaw
> <przemyslaw.kitszel@intel.com>
> Subject: Re: [PATCH iwl-net] idpf: fix VF dynamic interrupt ctl register
> initialization
>
> On Wed, Aug 28, 2024 at 04:38:25PM -0600, Ahmed Zaki wrote:
> > The VF's dynamic interrupt ctl "dyn_ctl_intrvl_s" is not initialized
> > in idpf_vf_intr_reg_init(). This resulted in the following UBSAN error
> > whenever a VF is created:
> >
> > [ 564.345655] UBSAN: shift-out-of-bounds in
> drivers/net/ethernet/intel/idpf/idpf_txrx.c:3654:10
> > [ 564.345663] shift exponent 4294967295 is too large for 32-bit type 'int'
> > [ 564.345671] CPU: 33 UID: 0 PID: 2458 Comm: NetworkManager Not tainted
> 6.11.0-rc4+ #1
> > [ 564.345678] Hardware name: Intel Corporation
> M50CYP2SBSTD/M50CYP2SBSTD, BIOS SE5C6200.86B.0027.P10.2201070222
> 01/07/2022
> > [ 564.345683] Call Trace:
> > [ 564.345688] <TASK>
> > [ 564.345693] dump_stack_lvl+0x91/0xb0
> > [ 564.345708] __ubsan_handle_shift_out_of_bounds+0x16b/0x320
> > [ 564.345730] idpf_vport_intr_update_itr_ena_irq.cold+0x13/0x39 [idpf]
> > [ 564.345755] ? __pfx_idpf_vport_intr_update_itr_ena_irq+0x10/0x10 [idpf]
> > [ 564.345771] ? static_obj+0x95/0xd0
> > [ 564.345782] ? lockdep_init_map_type+0x1a5/0x800
> > [ 564.345794] idpf_vport_intr_ena+0x5ef/0x9f0 [idpf]
> > [ 564.345814] idpf_vport_open+0x2cc/0x1240 [idpf]
> > [ 564.345837] idpf_open+0x6d/0xc0 [idpf]
> > [ 564.345850] __dev_open+0x241/0x420
> >
> > Fixes: d4d558718266 ("idpf: initialize interrupts and enable vport")
> > Reviewed-by: Przemek Kitszel <przemyslaw.kitszel@intel.com>
> > Signed-off-by: Ahmed Zaki <ahmed.zaki@intel.com>
>
> Thanks,
>
> I see that this now matches the implementation of idpf_intr_reg_init().
>
> Reviewed-by: Simon Horman <horms@kernel.org>
Tested-by: Krishneil Singh <krishneil.k.singh@intel.com>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2024-09-25 20:23 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-28 22:38 [PATCH iwl-net] idpf: fix VF dynamic interrupt ctl register initialization Ahmed Zaki
2024-09-02 8:49 ` Simon Horman
2024-09-25 20:22 ` Singh, Krishneil K
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).