Skip to content

Commit 32e9947

Browse files
Anilkumar Kolligregkh
authored andcommitted
ath11k: Use host CE parameters for CE interrupts configuration
[ Upstream commit b689f09 ] CE interrupt configuration uses host ce parameters to assign/free interrupts. Use host ce parameters to enable/disable interrupts. This patch fixes below BUG, BUG: KASAN: global-out-of-bounds in 0xffffffbffdfb035c at addr ffffffbffde6eeac Read of size 4 by task kworker/u8:2/132 Address belongs to variable ath11k_core_qmi_firmware_ready+0x1b0/0x5bc [ath11k] OOB is due to ath11k_ahb_ce_irqs_enable() iterates ce_count(which is 12) times and accessing 12th element in target_ce_config (which has only 11 elements) from ath11k_ahb_ce_irq_enable(). With this change host ce configs are used to enable/disable interrupts. Tested-on: IPQ8074 hw2.0 AHB WLAN.HK.2.5.0.1-00471-QCAHKSWPL_SILICONZ-1 Fixes: 967c1d1 ("ath11k: move target ce configs to hw_params") Signed-off-by: Anilkumar Kolli <akolli@codeaurora.org> Signed-off-by: Kalle Valo <kvalo@codeaurora.org> Link: https://lore.kernel.org/r/1637249558-12793-1-git-send-email-akolli@codeaurora.org Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent 6a49acf commit 32e9947

1 file changed

Lines changed: 8 additions & 8 deletions

File tree

  • drivers/net/wireless/ath/ath11k

‎drivers/net/wireless/ath/ath11k/ahb.c‎

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -206,13 +206,13 @@ static void ath11k_ahb_clearbit32(struct ath11k_base *ab, u8 bit, u32 offset)
206206

207207
static void ath11k_ahb_ce_irq_enable(struct ath11k_base *ab, u16 ce_id)
208208
{
209-
const struct ce_pipe_config *ce_config;
209+
const struct ce_attr *ce_attr;
210210

211-
ce_config = &ab->hw_params.target_ce_config[ce_id];
212-
if (__le32_to_cpu(ce_config->pipedir) & PIPEDIR_OUT)
211+
ce_attr = &ab->hw_params.host_ce_config[ce_id];
212+
if (ce_attr->src_nentries)
213213
ath11k_ahb_setbit32(ab, ce_id, CE_HOST_IE_ADDRESS);
214214

215-
if (__le32_to_cpu(ce_config->pipedir) & PIPEDIR_IN) {
215+
if (ce_attr->dest_nentries) {
216216
ath11k_ahb_setbit32(ab, ce_id, CE_HOST_IE_2_ADDRESS);
217217
ath11k_ahb_setbit32(ab, ce_id + CE_HOST_IE_3_SHIFT,
218218
CE_HOST_IE_3_ADDRESS);
@@ -221,13 +221,13 @@ static void ath11k_ahb_ce_irq_enable(struct ath11k_base *ab, u16 ce_id)
221221

222222
static void ath11k_ahb_ce_irq_disable(struct ath11k_base *ab, u16 ce_id)
223223
{
224-
const struct ce_pipe_config *ce_config;
224+
const struct ce_attr *ce_attr;
225225

226-
ce_config = &ab->hw_params.target_ce_config[ce_id];
227-
if (__le32_to_cpu(ce_config->pipedir) & PIPEDIR_OUT)
226+
ce_attr = &ab->hw_params.host_ce_config[ce_id];
227+
if (ce_attr->src_nentries)
228228
ath11k_ahb_clearbit32(ab, ce_id, CE_HOST_IE_ADDRESS);
229229

230-
if (__le32_to_cpu(ce_config->pipedir) & PIPEDIR_IN) {
230+
if (ce_attr->dest_nentries) {
231231
ath11k_ahb_clearbit32(ab, ce_id, CE_HOST_IE_2_ADDRESS);
232232
ath11k_ahb_clearbit32(ab, ce_id + CE_HOST_IE_3_SHIFT,
233233
CE_HOST_IE_3_ADDRESS);

0 commit comments

Comments
 (0)