summaryrefslogtreecommitdiffstats
path: root/net/mac80211
diff options
context:
space:
mode:
authorFelix Fietkau2019-03-13 18:54:27 +0100
committerGreg Kroah-Hartman2019-05-16 19:41:20 +0200
commitbbe1ab38e1a2e3bbc4d9115acf0e9b03287ae580 (patch)
tree7b584159ee4341689b9589e7af6cda3d0e38f0a3 /net/mac80211
parents390/dasd: Fix capacity calculation for large volumes (diff)
downloadkernel-qcow2-linux-bbe1ab38e1a2e3bbc4d9115acf0e9b03287ae580.tar.gz
kernel-qcow2-linux-bbe1ab38e1a2e3bbc4d9115acf0e9b03287ae580.tar.xz
kernel-qcow2-linux-bbe1ab38e1a2e3bbc4d9115acf0e9b03287ae580.zip
mac80211: fix unaligned access in mesh table hash function
[ 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 <nbd@nbd.name> Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'net/mac80211')
-rw-r--r--net/mac80211/mesh_pathtbl.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/mac80211/mesh_pathtbl.c b/net/mac80211/mesh_pathtbl.c
index c3a7396fb955..49a90217622b 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 = {