Thread (6 messages) flat view 6 messages, 1 author, 2021-09-20
STALE1786d

[PATCH 1/6] mac80211: mesh: fix potentially unaligned access

From: Johannes Berg <johannes@sipsolutions.net>
Date: 2021-09-20 13:31:38
Subsystem: mac80211, the rest · Maintainers: Johannes Berg, Linus Torvalds

From: Johannes Berg <redacted>

The pointer here points directly into the frame, so the
access is potentially unaligned. Use get_unaligned_le16
to avoid that.

Fixes: 3f52b7e328c5 ("mac80211: mesh power save basics")
Signed-off-by: Johannes Berg <redacted>
---
 net/mac80211/mesh_ps.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/mac80211/mesh_ps.c b/net/mac80211/mesh_ps.c
index 204830a55240..eda6a25a7a20 100644
--- a/net/mac80211/mesh_ps.c
+++ b/net/mac80211/mesh_ps.c
@@ -588,7 +588,7 @@ void ieee80211_mps_frame_release(struct sta_info *sta,
 
 	/* only transmit to PS STA with announced, non-zero awake window */
 	if (test_sta_flag(sta, WLAN_STA_PS_STA) &&
-	    (!elems->awake_window || !le16_to_cpu(*elems->awake_window)))
+	    (!elems->awake_window || !get_unaligned_le16(elems->awake_window)))
 		return;
 
 	if (!test_sta_flag(sta, WLAN_STA_MPSP_OWNER))
-- 
2.31.1
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help