From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D7E8DC77B61 for ; Tue, 25 Apr 2023 11:14:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233972AbjDYLO6 (ORCPT ); Tue, 25 Apr 2023 07:14:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35610 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233877AbjDYLOt (ORCPT ); Tue, 25 Apr 2023 07:14:49 -0400 Received: from mail.toke.dk (mail.toke.dk [IPv6:2a0c:4d80:42:2001::664]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9B395A9; Tue, 25 Apr 2023 04:14:46 -0700 (PDT) From: Toke =?utf-8?Q?H=C3=B8iland-J=C3=B8rgensen?= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=toke.dk; s=20161023; t=1682421284; bh=vrTSialJD2Li5vjQDpn9fTzt12D3cKs5drm5QZYYqCY=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=OrJABxrUwNHh6hEAw5k6Y80NDr8Y6rSn1mDeNMtSZmK65oiBYVB6RNr6fmpzYw8PV NT32YOiek5iwEUoqbIAwkT3EsBROUL9aZFcwcjh+Mqmb3YmfmebnI4hbZlklYE0HLq oTl4+NbXXMelRk8u+tVOcpCQM/jZG06MMFc+FZXW4WzD3n37mK8p9IbPFPN78txUxn MuH2zDuAjmWidmU7lY4QJmP2c5h0wbXkS4HkFFthaX5y/JMceqfs+FqP7c2pYFynil NkImXfAXBR6eg7oFkiKHbIZrZVw4AZ+/QkiuHEHWJ0Wxd+8LQ0QA2nbxtX69C+MMuZ OE23MS4NTyK0g== To: Fedor Pchelkin , Kalle Vallo Cc: Fedor Pchelkin , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Senthil Balasubramanian , "John W. Linville" , Vasanthakumar Thiagarajan , Sujith , linux-wireless@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Alexey Khoroshilov , lvc-project@linuxtesting.org, syzbot+f2cb6e0ffdb961921e4d@syzkaller.appspotmail.com Subject: Re: [PATCH v2] wifi: ath9k: avoid referencing uninit memory in ath9k_wmi_ctrl_rx In-Reply-To: <20230424183348.111355-1-pchelkin@ispras.ru> References: <20230424183348.111355-1-pchelkin@ispras.ru> Date: Tue, 25 Apr 2023 13:14:43 +0200 X-Clacks-Overhead: GNU Terry Pratchett Message-ID: <87sfcojjrw.fsf@toke.dk> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Fedor Pchelkin writes: > For the reasons also described in commit b383e8abed41 ("wifi: ath9k: avoid > uninit memory read in ath9k_htc_rx_msg()"), ath9k_htc_rx_msg() should > validate pkt_len before accessing the SKB. > > For example, the obtained SKB may have been badly constructed with > pkt_len =3D 8. In this case, the SKB can only contain a valid htc_frame_h= dr > but after being processed in ath9k_htc_rx_msg() and passed to > ath9k_wmi_ctrl_rx() endpoint RX handler, it is expected to have a WMI > command header which should be located inside its data payload.=20 > > Implement sanity checking inside ath9k_wmi_ctrl_rx(). Otherwise, uninit > memory can be referenced. > > Tested on Qualcomm Atheros Communications AR9271 802.11n . > > Found by Linux Verification Center (linuxtesting.org) with Syzkaller. > > Fixes: fb9987d0f748 ("ath9k_htc: Support for AR9271 chipset.") > Reported-and-tested-by: syzbot+f2cb6e0ffdb961921e4d@syzkaller.appspotmail= .com > Signed-off-by: Fedor Pchelkin Acked-by: Toke H=C3=B8iland-J=C3=B8rgensen