diff options
author | Felix Fietkau <nbd@nbd.name> | 2019-03-13 20:04:44 +0100 |
---|---|---|
committer | Felix Fietkau <nbd@nbd.name> | 2019-03-16 19:59:02 +0100 |
commit | fb0a80f4cfd38febdb52e7f0478f8f8fa0631e1d (patch) | |
tree | 22fad984c44551810db9ca0493ba1c7979edeebc | |
parent | fd8ca8deb3197a2867d85fc3513f5aa70912ee40 (diff) | |
download | upstream-fb0a80f4cfd38febdb52e7f0478f8f8fa0631e1d.tar.gz upstream-fb0a80f4cfd38febdb52e7f0478f8f8fa0631e1d.tar.bz2 upstream-fb0a80f4cfd38febdb52e7f0478f8f8fa0631e1d.zip |
mac80211: fix an unaligned access in the mesh hash table function
Signed-off-by: Felix Fietkau <nbd@nbd.name>
-rw-r--r-- | package/kernel/mac80211/patches/subsys/313-mac80211-fix-unaligned-access-in-mesh-table-hash-fun.patch | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/package/kernel/mac80211/patches/subsys/313-mac80211-fix-unaligned-access-in-mesh-table-hash-fun.patch b/package/kernel/mac80211/patches/subsys/313-mac80211-fix-unaligned-access-in-mesh-table-hash-fun.patch new file mode 100644 index 0000000000..2ce23586ca --- /dev/null +++ b/package/kernel/mac80211/patches/subsys/313-mac80211-fix-unaligned-access-in-mesh-table-hash-fun.patch @@ -0,0 +1,21 @@ +From: Felix Fietkau <nbd@nbd.name> +Date: Wed, 13 Mar 2019 18:52:56 +0100 +Subject: [PATCH] mac80211: fix unaligned access in mesh table hash function + +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> +--- + +--- a/net/mac80211/mesh_pathtbl.c ++++ b/net/mac80211/mesh_pathtbl.c +@@ -23,7 +23,7 @@ static void mesh_path_free_rcu(struct me + 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(addr+2), seed); + } + + static const struct rhashtable_params mesh_rht_params = { |