From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from m43-7.mailgun.net ([69.72.43.7]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jxZJg-0002Ag-Bq for ath10k@lists.infradead.org; Mon, 20 Jul 2020 17:11:10 +0000 MIME-Version: 1.0 Subject: Re: [PATCH] net: ath10k: fix OOB: __ath10k_htt_rx_ring_fill_n From: Kalle Valo In-Reply-To: <20200623221105.3486-1-bruceshenzk@gmail.com> References: <20200623221105.3486-1-bruceshenzk@gmail.com> Message-Id: <20200720171035.C5974C433C6@smtp.codeaurora.org> Date: Mon, 20 Jul 2020 17:10:35 +0000 (UTC) List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "ath10k" Errors-To: ath10k-bounces+kvalo=adurom.com@lists.infradead.org To: Zekun Shen Cc: security@kernel.org, netdev@vger.kernel.org, linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org, ath10k@lists.infradead.org, Jakub Kicinski , "David S. Miller" Zekun Shen wrote: > The idx in __ath10k_htt_rx_ring_fill_n function lives in > consistent dma region writable by the device. Malfunctional > or malicious device could manipulate such idx to have a OOB > write. Either by > htt->rx_ring.netbufs_ring[idx] = skb; > or by > ath10k_htt_set_paddrs_ring(htt, paddr, idx); > > The idx can also be negative as it's signed, giving a large > memory space to write to. > > It's possibly exploitable by corruptting a legit pointer with > a skb pointer. And then fill skb with payload as rougue object. > > Part of the log here. Sometimes it appears as UAF when writing > to a freed memory by chance. > > [ 15.594376] BUG: unable to handle page fault for address: ffff887f5c1804f0 > [ 15.595483] #PF: supervisor write access in kernel mode > [ 15.596250] #PF: error_code(0x0002) - not-present page > [ 15.597013] PGD 0 P4D 0 > [ 15.597395] Oops: 0002 [#1] SMP KASAN PTI > [ 15.597967] CPU: 0 PID: 82 Comm: kworker/u2:2 Not tainted 5.6.0 #69 > [ 15.598843] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), > BIOS rel-1.12.1-0-ga5cab58e9a3f-prebuilt.qemu.org 04/01/2014 > [ 15.600438] Workqueue: ath10k_wq ath10k_core_register_work [ath10k_core] > [ 15.601389] RIP: 0010:__ath10k_htt_rx_ring_fill_n > (linux/drivers/net/wireless/ath/ath10k/htt_rx.c:173) ath10k_core > > Signed-off-by: Zekun Shen > Signed-off-by: Kalle Valo Patch applied to ath-next branch of ath.git, thanks. bad60b8d1a71 ath10k: check idx validity in __ath10k_htt_rx_ring_fill_n() -- https://patchwork.kernel.org/patch/11621899/ https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches _______________________________________________ ath10k mailing list ath10k@lists.infradead.org http://lists.infradead.org/mailman/listinfo/ath10k