Commit b9731062 authored by Johannes Berg's avatar Johannes Berg

mac80211: mesh: fix potentially unaligned access

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

Fixes: 3f52b7e3 ("mac80211: mesh power save basics")
Link: https://lore.kernel.org/r/20210920154009.3110ff75be0c.Ib6a2ff9e9cc9bc6fca50fce631ec1ce725cc926b@changeidSigned-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
parent 13cb6d82
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
/* /*
* Copyright 2012-2013, Marco Porsch <marco.porsch@s2005.tu-chemnitz.de> * Copyright 2012-2013, Marco Porsch <marco.porsch@s2005.tu-chemnitz.de>
* Copyright 2012-2013, cozybit Inc. * Copyright 2012-2013, cozybit Inc.
* Copyright (C) 2021 Intel Corporation
*/ */
#include "mesh.h" #include "mesh.h"
...@@ -588,7 +589,7 @@ void ieee80211_mps_frame_release(struct sta_info *sta, ...@@ -588,7 +589,7 @@ void ieee80211_mps_frame_release(struct sta_info *sta,
/* only transmit to PS STA with announced, non-zero awake window */ /* only transmit to PS STA with announced, non-zero awake window */
if (test_sta_flag(sta, WLAN_STA_PS_STA) && 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; return;
if (!test_sta_flag(sta, WLAN_STA_MPSP_OWNER)) if (!test_sta_flag(sta, WLAN_STA_MPSP_OWNER))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment