From: Vasanthakumar Thiagarajan <quic_vthiagar@quicinc.com>
To: Dheeraj Reddy Jonnalagadda <dheeraj.linuxdev@gmail.com>,
<kvalo@kernel.org>, <ath12k@lists.infradead.org>
Cc: <jjohnson@kernel.org>, <linux-wireless@vger.kernel.org>,
<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v2 wireless-next] wifi: ath12k: Fix out-of-bounds read in ath12k_mac_vdev_create
Date: Tue, 10 Dec 2024 12:17:13 +0530 [thread overview]
Message-ID: <3ed0ccbf-1ce8-7429-151c-d21eb5311f6a@quicinc.com> (raw)
In-Reply-To: <20241207071306.325641-1-dheeraj.linuxdev@gmail.com>
On 12/7/2024 12:43 PM, Dheeraj Reddy Jonnalagadda wrote:
> Add a bounds check to ath12k_mac_vdev_create() to prevent an out-of-bounds
> read in the vif->link_conf array. The function uses link_id, derived from
> arvif->link_id, to index the array. When link_id equals 15, the index
> exceeds the bounds of the array, which contains only 15 elements.
>
> This issue occurs in the following code branch:
>
> if (arvif->link_id == ATH12K_DEFAULT_SCAN_LINK && vif->valid_links)
> link_id = ffs(vif->valid_links) - 1;
> else
> link_id = arvif->link_id;
>
> When the first condition in the if statement is true and the second
> condition is false, it implies that arvif->link_id equals 15 and
> the else branch is taken, where link_id is set to 15, causing an
> out-of-bounds access when vif->link_conf array is read using link_id
> as index.
Practically this can not happen as ath12k_mac_assign_link_vif() which
retrieves the arvif by link_id before calling ath12k_mac_vdev_create()
sanitizes the link_id when there are no valid_links running for that
vif (!vif->valid_links).
Vasanth
prev parent reply other threads:[~2024-12-10 6:47 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-07 7:13 Dheeraj Reddy Jonnalagadda
2024-12-09 12:40 ` Kalle Valo
2024-12-09 18:39 ` Jeff Johnson
2024-12-10 4:19 ` Dheeraj Reddy Jonnalagadda
2024-12-10 4:50 ` Jeff Johnson
2024-12-10 6:47 ` Vasanthakumar Thiagarajan [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3ed0ccbf-1ce8-7429-151c-d21eb5311f6a@quicinc.com \
--to=quic_vthiagar@quicinc.com \
--cc=ath12k@lists.infradead.org \
--cc=dheeraj.linuxdev@gmail.com \
--cc=jjohnson@kernel.org \
--cc=kvalo@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-wireless@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®