public inbox for linux-wireless@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH wireless] wifi: mac80211: clear frame buffer to never leak stack
@ 2025-06-30 13:32 Johannes Berg
  2025-06-30 19:37 ` kernel test robot
  2025-06-30 20:53 ` kernel test robot
  0 siblings, 2 replies; 3+ messages in thread
From: Johannes Berg @ 2025-06-30 13:32 UTC (permalink / raw)
  To: linux-wireless; +Cc: Johannes Berg, Zhongqiu Han

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

In disconnect paths paths, local frame buffers are used
to build deauthentication frames to send them over the
air and as notifications to userspace. Some internal
error paths (that, given no other bugs, cannot happen)
don't always initialize the buffers before sending them
to userspace, so in the presence of other bugs they can
leak stack content. Initialize the buffers to avoid the
possibility of this happening.

Suggested-by: Zhongqiu Han <quic_zhonhan@quicinc.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
 net/mac80211/mlme.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
index 2d46d4af60d7..402c5a9e8c94 100644
--- a/net/mac80211/mlme.c
+++ b/net/mac80211/mlme.c
@@ -3934,6 +3934,9 @@ static void ieee80211_set_disassoc(struct ieee80211_sub_if_data *sdata,
 
 	lockdep_assert_wiphy(local->hw.wiphy);
 
+	if (frame_buf)
+		memset(frame_buf, 0, ieee80211_set_disassoc);
+
 	if (WARN_ON(!ap_sta))
 		return;
 
-- 
2.50.0


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

end of thread, other threads:[~2025-06-30 20:53 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-06-30 13:32 [PATCH wireless] wifi: mac80211: clear frame buffer to never leak stack Johannes Berg
2025-06-30 19:37 ` kernel test robot
2025-06-30 20:53 ` kernel test robot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox