Skip to content

Commit b55ea80

Browse files
committed
ionic: clean interrupt before enabling queue to avoid credit race
jira LE-1907 cve CVE-2024-39502 Rebuild_History Non-Buildable kernel-4.18.0-553.16.1.el8_10 commit-author Neel Patel <neel.patel@amd.com> commit e8797a0 Clear the interrupt credits before enabling the queue rather than after to be sure that the enabled queue starts at 0 and that we don't wipe away possible credits after enabling the queue. Fixes: 0f3154e ("ionic: Add Tx and Rx handling") Signed-off-by: Neel Patel <neel.patel@amd.com> Signed-off-by: Shannon Nelson <shannon.nelson@amd.com> Reviewed-by: Leon Romanovsky <leonro@nvidia.com> Signed-off-by: Jakub Kicinski <kuba@kernel.org> (cherry picked from commit e8797a0) Signed-off-by: Jonathan Maple <jmaple@ciq.com>
1 parent 45bcdfe commit b55ea80

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

drivers/net/ethernet/pensando/ionic/ionic_lif.c

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -267,23 +267,32 @@ static int ionic_qcq_enable(struct ionic_qcq *qcq)
267267
.oper = IONIC_Q_ENABLE,
268268
},
269269
};
270+
int ret;
270271

271272
idev = &lif->ionic->idev;
272273
dev = lif->ionic->dev;
273274

274275
dev_dbg(dev, "q_enable.index %d q_enable.qtype %d\n",
275276
ctx.cmd.q_control.index, ctx.cmd.q_control.type);
276277

278+
if (qcq->flags & IONIC_QCQ_F_INTR)
279+
ionic_intr_clean(idev->intr_ctrl, qcq->intr.index);
280+
281+
ret = ionic_adminq_post_wait(lif, &ctx);
282+
if (ret)
283+
return ret;
284+
285+
if (qcq->napi.poll)
286+
napi_enable(&qcq->napi);
287+
277288
if (qcq->flags & IONIC_QCQ_F_INTR) {
278289
irq_set_affinity_hint(qcq->intr.vector,
279290
&qcq->intr.affinity_mask);
280-
napi_enable(&qcq->napi);
281-
ionic_intr_clean(idev->intr_ctrl, qcq->intr.index);
282291
ionic_intr_mask(idev->intr_ctrl, qcq->intr.index,
283292
IONIC_INTR_MASK_CLEAR);
284293
}
285294

286-
return ionic_adminq_post_wait(lif, &ctx);
295+
return 0;
287296
}
288297

289298
static int ionic_qcq_disable(struct ionic_lif *lif, struct ionic_qcq *qcq, int fw_err)

0 commit comments

Comments
 (0)