All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 1/6] mac80211: mesh: fix potentially unaligned access
@ 2021-09-20 13:40 Johannes Berg
  2021-09-20 13:40 ` [PATCH v2 2/6] mac80211: reduce stack usage in debugfs Johannes Berg
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Johannes Berg @ 2021-09-20 13:40 UTC (permalink / raw)
  To: linux-wireless; +Cc: Johannes Berg

From: Johannes Berg <johannes.berg@intel.com>

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 <johannes.berg@intel.com>
---
 net/mac80211/mesh_ps.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/net/mac80211/mesh_ps.c b/net/mac80211/mesh_ps.c
index 204830a55240..3fbd0b9ff913 100644
--- a/net/mac80211/mesh_ps.c
+++ b/net/mac80211/mesh_ps.c
@@ -2,6 +2,7 @@
 /*
  * Copyright 2012-2013, Marco Porsch <marco.porsch@s2005.tu-chemnitz.de>
  * Copyright 2012-2013, cozybit Inc.
+ * Copyright (C) 2021 Intel Corporation
  */
 
 #include "mesh.h"
@@ -588,7 +589,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


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2021-09-20 13:40 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-20 13:40 [PATCH v2 1/6] mac80211: mesh: fix potentially unaligned access Johannes Berg
2021-09-20 13:40 ` [PATCH v2 2/6] mac80211: reduce stack usage in debugfs Johannes Berg
2021-09-20 13:40 ` [PATCH v2 3/6] mac80211: mesh: clean up rx_bcn_presp API Johannes Berg
2021-09-20 13:40 ` [PATCH v2 4/6] mac80211: move CRC into struct ieee802_11_elems Johannes Berg
2021-09-20 13:40 ` [PATCH v2 5/6] mac80211: mlme: find auth challenge directly Johannes Berg
2021-09-20 13:40 ` [PATCH v2 6/6] mac80211: always allocate struct ieee802_11_elems Johannes Berg

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.