lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250130123432.4534-1-v.shevtsov@mt-integration.ru>
Date: Thu, 30 Jan 2025 17:34:21 +0500
From: Vitaliy Shevtsov <v.shevtsov@...integration.ru>
To: Johannes Berg <johannes@...solutions.net>
CC: Vitaliy Shevtsov <v.shevtsov@...integration.ru>, "John W. Linville"
	<linville@...driver.com>, Michael Wu <flamingice@...rmilk.net>,
	<linux-wireless@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
	<lvc-project@...uxtesting.org>,
	<syzbot+2e5c1e55b9e5c28a3da7@...kaller.appspotmail.com>
Subject: [PATCH] wifi: nl80211: override all other flags if MONITOR_FLAG_COOK_FRAMES is set

It is possible to set both MONITOR_FLAG_COOK_FRAMES and MONITOR_FLAG_ACTIVE
flags simultaneously on the same monitor interface from the userspace. This
causes a sub-interface to be created with no IEEE80211_SDATA_IN_DRIVER bit
set because the monitor interface is in the cooked state and it takes
precedence over all other states. When the interface is then being deleted
the kernel calls WARN_ONCE() from check_sdata_in_driver() because of missing
that bit.

Fix this by overriding all flags if MONITOR_FLAG_COOK_FRAMES is set because
this flag is incompatible with other monitor flags being set.

Found by Linux Verification Center (linuxtesting.org) with Syzkaller.

Fixes: 66f7ac50ed7c (nl80211: Add monitor interface configuration flags)
Reported-by: syzbot+2e5c1e55b9e5c28a3da7@...kaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=2e5c1e55b9e5c28a3da7
Signed-off-by: Vitaliy Shevtsov <v.shevtsov@...integration.ru>
---
 net/wireless/nl80211.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index d7d3da0f6833..1338b0a06f8d 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -4220,6 +4220,10 @@ static int parse_monitor_flags(struct nlattr *nla, u32 *mntrflags)
 		if (flags[flag])
 			*mntrflags |= (1<<flag);
 
+	/* MONITOR_FLAG_COOK_FRAMES must override all other flags */
+	if (*mntrflags & MONITOR_FLAG_COOK_FRAMES)
+		*mntrflags = MONITOR_FLAG_COOK_FRAMES;
+
 	*mntrflags |= MONITOR_FLAG_CHANGED;
 
 	return 0;
-- 
2.48.1


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ