Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp474041yba; Wed, 15 May 2019 04:46:51 -0700 (PDT) X-Google-Smtp-Source: APXvYqxSsF8VDy+EsIHxn9dY9gZx3VGvkfJLo0dMCYrsB0u1Ukx5zNBzwJvQuVLl80rdOZTrrCqu X-Received: by 2002:a65:6688:: with SMTP id b8mr43179110pgw.81.1557920811269; Wed, 15 May 2019 04:46:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557920811; cv=none; d=google.com; s=arc-20160816; b=aHrgoWzYyPMG+HE80AY7e+59ARLeAKNrVx/MfISwzsWnZtJdeWRozZGCzDpRC/6fsL cndwN1CbsNCGoCrg7co0VBPzM55/Q10/WWdEVC+/jdcZL3pCFVkvsHMUWanVat0V3srD 2HtQqlUXflHvR0R3lEjQMNNDK9uzbc814Bjw8RNDl6BwhRR0r74LX6X4h1jgrQPL0BFt k2dywlfBbtJChuVN11eBBGvdFTaZ7bLEL50luINoKIyS7XilGXgqKCqIYfpCfyB84ZUj lnDRVw42ZFiBH9V+ayJ5vN4Hi373oUsEtpM6Y797FweK4y/9fsQFmVU9UXCY6hH/sgfu b+LA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=e6HM5w+ux3KsjAaTblchJugIfcd16cat7SbLp7kwNQY=; b=Kvhwedfbsxx6e7vwFmV0Q1zYLuI56158JPhlOoSqAM0A4TRLE1fVPuT9zILZQbwlr8 iC28UfhlduTu9e+seu8HO27Mi7Ltv8zoicCfHp7UZkZ87DbQV37BQ2BXC4DD+2+MRDaF gvS8lLq2HNhqWGQtHhdjHHu90OJoRsypPR0XUInWL0iki2WbW6MLoS1cA4hMijmSRHwM 1OAIKtEwPcp9bK0bGLebZ0MSoIbYTf9icgpTc7LYd3+ezavEcKmmNIiAVEKIHUPmhDRo QncfVabqejTkfL8/iYrvAtEJr4ugLvzq+VfPV8LWk8nVfNeMExAGHTtNdlGOwL4ZuZCe f5fg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=vqGyvEJB; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b22si790680plz.417.2019.05.15.04.46.36; Wed, 15 May 2019 04:46:51 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=vqGyvEJB; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726817AbfEOLo2 (ORCPT + 99 others); Wed, 15 May 2019 07:44:28 -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: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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