mirror of
https://github.com/torvalds/linux.git
synced 2026-10-11 21:07:03 +02:00
wifi: iwlwifi: pcie: validate txq_id in txq_enable
Avoid indexing txq arrays and queue-used bitmaps with an invalid queue ID by adding an early bounds check in iwl_trans_pcie_txq_enable(). Assisted-by: GitHubCopilot:gpt-5.3-codex Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Link: https://patch.msgid.link/20260714165826.273be072f5ff.I0d6c36a4c06bdbb4655164c7792da32b6143731e@changeid Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
This commit is contained in:
parent
4e777dcdfe
commit
5826799a26
|
|
@ -1,6 +1,6 @@
|
|||
// SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause
|
||||
/*
|
||||
* Copyright (C) 2003-2014, 2018-2021, 2023-2025 Intel Corporation
|
||||
* Copyright (C) 2003-2014, 2018-2021, 2023-2026 Intel Corporation
|
||||
* Copyright (C) 2013-2015 Intel Mobile Communications GmbH
|
||||
* Copyright (C) 2016-2017 Intel Deutschland GmbH
|
||||
*/
|
||||
|
|
@ -1149,10 +1149,17 @@ bool iwl_trans_pcie_txq_enable(struct iwl_trans *trans, int txq_id, u16 ssn,
|
|||
unsigned int wdg_timeout)
|
||||
{
|
||||
struct iwl_trans_pcie *trans_pcie = IWL_TRANS_GET_PCIE_TRANS(trans);
|
||||
struct iwl_txq *txq = trans_pcie->txqs.txq[txq_id];
|
||||
struct iwl_txq *txq;
|
||||
int fifo = -1;
|
||||
bool scd_bug = false;
|
||||
|
||||
if (WARN_ONCE(txq_id < 0 ||
|
||||
txq_id >= trans->mac_cfg->base->num_of_queues,
|
||||
"queue %d out of range", txq_id))
|
||||
return false;
|
||||
|
||||
txq = trans_pcie->txqs.txq[txq_id];
|
||||
|
||||
if (test_and_set_bit(txq_id, trans_pcie->txqs.queue_used))
|
||||
WARN_ONCE(1, "queue %d already used - expect issues", txq_id);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user