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 X-Spam-Level: X-Spam-Status: No, score=-9.0 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable 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 A1851C04E53 for ; Wed, 15 May 2019 11:44:33 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 71C892053B for ; Wed, 15 May 2019 11:44:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1557920673; bh=mYntcsVQf5ynlvW1HThSn5YNWwIDpm6Tb6YQEtUXdFw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=0MyK9onuuqs4mujRt2UFFDIaBo+ZQpakXtbzBjLuX7Evuasqs+bnnT/NtuEIT3GMG xVvIp/yBi3NRMq4LutywWS0oM0TYzpauH0p3po5s8nP1g4cV+cnInWM6pDvbDHIVQG eIqQwthRd6di9NHEwPb61ynWBQa370noMhrnI6xY= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731370AbfEOLo1 (ORCPT ); Wed, 15 May 2019 07:44:27 -0400 Received: from mail.kernel.org ([198.145.29.99]:37450 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728818AbfEOL0h (ORCPT ); Wed, 15 May 2019 07:26:37 -0400 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 EA30920818; Wed, 15 May 2019 11:26:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1557919596; bh=mYntcsVQf5ynlvW1HThSn5YNWwIDpm6Tb6YQEtUXdFw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=vqGyvEJBKoOXWAnMOsb3K3OIIn+NtqOKF+3PxJDHvHOAar8D/scWpbZrap6IXp71j LscbhD328HWFuUq195J1a9HltxMPv6hfDGkEVB2pNs2hb6eiRqrfoJx65qe56DFDa+ nxguxYZO+cTjCQe6VBp5x09uVmiNHabao1sWr1bQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Felix Fietkau , Johannes Berg , Sasha Levin Subject: [PATCH 5.0 021/137] mac80211: fix unaligned access in mesh table hash function Date: Wed, 15 May 2019 12:55:02 +0200 Message-Id: <20190515090654.807376275@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190515090651.633556783@linuxfoundation.org> References: <20190515090651.633556783@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org [ Upstream commit 40586e3fc400c00c11151804dcdc93f8c831c808 ] The pointer to the last four bytes of the address is not guaranteed to be aligned, so we need to use __get_unaligned_cpu32 here Signed-off-by: Felix Fietkau Signed-off-by: Johannes Berg Signed-off-by: Sasha Levin --- net/mac80211/mesh_pathtbl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/mac80211/mesh_pathtbl.c b/net/mac80211/mesh_pathtbl.c index 88a6d5e18ccc9..ac1f5db529945 100644 --- a/net/mac80211/mesh_pathtbl.c +++ b/net/mac80211/mesh_pathtbl.c @@ -23,7 +23,7 @@ static void mesh_path_free_rcu(struct mesh_table *tbl, struct mesh_path *mpath); static u32 mesh_table_hash(const void *addr, u32 len, u32 seed) { /* Use last four bytes of hw addr as hash index */ - return jhash_1word(*(u32 *)(addr+2), seed); + return jhash_1word(__get_unaligned_cpu32((u8 *)addr + 2), seed); } static const struct rhashtable_params mesh_rht_params = { -- 2.20.1