From patchwork Thu Jan 2 22:06:43 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 234716 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B33DFC3276D for ; Thu, 2 Jan 2020 22:30:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 87B2822525 for ; Thu, 2 Jan 2020 22:30:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1578004247; bh=Tj/9HI+043J3G7z/Ustf6rJ/jR00Aw9f9WNcSX0ryok=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=BEDLypUtK13wJGl7Ccfp0x/B9ysODDaL0T9p30XhiTSKar7BVhJi4EfsrtundnOq1 jnSg1hDn98qi7Gc8f0CM9+Iy5saBNw4VYgWR4Okpvw4MMRPk76eVXq7rDFwo+LVAPG IAqXRXA8DH1UhaSg0HER60EC3N6CYYKgu1wzpVWo= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730042AbgABWaq (ORCPT ); Thu, 2 Jan 2020 17:30:46 -0500 Received: from mail.kernel.org ([198.145.29.99]:34972 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730196AbgABWao (ORCPT ); Thu, 2 Jan 2020 17:30:44 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 4418B20863; Thu, 2 Jan 2020 22:30:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1578004243; bh=Tj/9HI+043J3G7z/Ustf6rJ/jR00Aw9f9WNcSX0ryok=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=rlQUyKVhMfbakTFkl/SXaRnhhCXcZ3MusBVkd7/JkX3qkBINzpe09PmojI0PTJRW/ aiBDZblhgMrNQlp8Zg8wtmx/03QPbbPvnCNkVKAe8kj4HfStqIBa0zIXC88gewvfTp 8IHGHJJYOA48X4ZqjZ+gMKI2cn9bla7CMLudLSNM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Wang Xuerui , Luca Coelho , Kalle Valo , Sasha Levin Subject: [PATCH 4.9 072/171] iwlwifi: mvm: fix unaligned read of rx_pkt_status Date: Thu, 2 Jan 2020 23:06:43 +0100 Message-Id: <20200102220556.908450992@linuxfoundation.org> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200102220546.960200039@linuxfoundation.org> References: <20200102220546.960200039@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Wang Xuerui [ Upstream commit c5aaa8be29b25dfe1731e9a8b19fd91b7b789ee3 ] This is present since the introduction of iwlmvm. Example stack trace on MIPS: [] iwl_mvm_rx_rx_mpdu+0xa8/0xb88 [iwlmvm] [] iwl_pcie_rx_handle+0x420/0xc48 [iwlwifi] Tested with a Wireless AC 7265 for ~6 months, confirmed to fix the problem. No other unaligned accesses are spotted yet. Signed-off-by: Wang Xuerui Signed-off-by: Luca Coelho Signed-off-by: Kalle Valo Signed-off-by: Sasha Levin --- drivers/net/wireless/intel/iwlwifi/mvm/rx.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/rx.c b/drivers/net/wireless/intel/iwlwifi/mvm/rx.c index b78e60eb600f..d0aa4d0a5537 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/rx.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/rx.c @@ -62,6 +62,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *****************************************************************************/ +#include #include #include #include "iwl-trans.h" @@ -289,7 +290,7 @@ void iwl_mvm_rx_rx_mpdu(struct iwl_mvm *mvm, struct napi_struct *napi, rx_res = (struct iwl_rx_mpdu_res_start *)pkt->data; hdr = (struct ieee80211_hdr *)(pkt->data + sizeof(*rx_res)); len = le16_to_cpu(rx_res->byte_count); - rx_pkt_status = le32_to_cpup((__le32 *) + rx_pkt_status = get_unaligned_le32((__le32 *) (pkt->data + sizeof(*rx_res) + len)); /* Dont use dev_alloc_skb(), we'll have enough headroom once