Skip to content

Commit 9ee87d2

Browse files
WojDrewanguy11
authored andcommitted
ice: Fix NULL pointer dereference in switchdev
Commit 608a5c0 ("virtchnl: support queue rate limit and quanta size configuration") introduced new virtchnl ops: - get_qos_caps - cfg_q_bw - cfg_q_quanta New ops were added to ice_virtchnl_dflt_ops, in commit 0153077 ("ice: Support VF queue rate limit and quanta size configuration"), but not to the ice_virtchnl_repr_ops. Because of that, if we get one of those messages in switchdev mode we end up with NULL pointer dereference: [ 1199.794701] BUG: kernel NULL pointer dereference, address: 0000000000000000 [ 1199.794804] Workqueue: ice ice_service_task [ice] [ 1199.794878] RIP: 0010:0x0 [ 1199.795027] Call Trace: [ 1199.795033] <TASK> [ 1199.795039] ? __die+0x20/0x70 [ 1199.795051] ? page_fault_oops+0x140/0x520 [ 1199.795064] ? exc_page_fault+0x7e/0x270 [ 1199.795074] ? asm_exc_page_fault+0x22/0x30 [ 1199.795086] ice_vc_process_vf_msg+0x6e5/0xd30 [ice] [ 1199.795165] __ice_clean_ctrlq+0x734/0x9d0 [ice] [ 1199.795207] ice_service_task+0xccf/0x12b0 [ice] [ 1199.795248] process_one_work+0x21a/0x620 [ 1199.795260] worker_thread+0x18d/0x330 [ 1199.795269] ? __pfx_worker_thread+0x10/0x10 [ 1199.795279] kthread+0xec/0x120 [ 1199.795288] ? __pfx_kthread+0x10/0x10 [ 1199.795296] ret_from_fork+0x2d/0x50 [ 1199.795305] ? __pfx_kthread+0x10/0x10 [ 1199.795312] ret_from_fork_asm+0x1a/0x30 [ 1199.795323] </TASK> Fixes: 0153077 ("ice: Support VF queue rate limit and quanta size configuration") Reviewed-by: Przemek Kitszel <[email protected]> Reviewed-by: Michal Swiatkowski <[email protected]> Signed-off-by: Wojciech Drewek <[email protected]> Reviewed-by: Simon Horman <[email protected]> Tested-by: Sujai Buvaneswaran <[email protected]> Signed-off-by: Tony Nguyen <[email protected]>
1 parent 3214fae commit 9ee87d2

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

drivers/net/ethernet/intel/ice/ice_virtchnl.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4128,6 +4128,9 @@ static const struct ice_virtchnl_ops ice_virtchnl_dflt_ops = {
41284128
.get_qos_caps = ice_vc_get_qos_caps,
41294129
.cfg_q_bw = ice_vc_cfg_q_bw,
41304130
.cfg_q_quanta = ice_vc_cfg_q_quanta,
4131+
/* If you add a new op here please make sure to add it to
4132+
* ice_virtchnl_repr_ops as well.
4133+
*/
41314134
};
41324135

41334136
/**
@@ -4258,6 +4261,9 @@ static const struct ice_virtchnl_ops ice_virtchnl_repr_ops = {
42584261
.dis_vlan_stripping_v2_msg = ice_vc_dis_vlan_stripping_v2_msg,
42594262
.ena_vlan_insertion_v2_msg = ice_vc_ena_vlan_insertion_v2_msg,
42604263
.dis_vlan_insertion_v2_msg = ice_vc_dis_vlan_insertion_v2_msg,
4264+
.get_qos_caps = ice_vc_get_qos_caps,
4265+
.cfg_q_bw = ice_vc_cfg_q_bw,
4266+
.cfg_q_quanta = ice_vc_cfg_q_quanta,
42614267
};
42624268

42634269
/**

0 commit comments

Comments
 (0)