Linux-Wireless Archive on
 help / color / Atom feed
* [PATCH] cfg80211: regulatory: reject invalid hints
@ 2020-08-19  8:46 Johannes Berg
  0 siblings, 0 replies; only message in thread
From: Johannes Berg @ 2020-08-19  8:46 UTC (permalink / raw)
  To: linux-wireless; +Cc: Johannes Berg, syzbot+d451401ffd00a60677ee

From: Johannes Berg <>

Reject invalid hints early in order to not cause a kernel
WARN later if they're restored to or similar.

Signed-off-by: Johannes Berg <>
 net/wireless/reg.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/net/wireless/reg.c b/net/wireless/reg.c
index 35b8847a2f6d..117a28d7237d 100644
--- a/net/wireless/reg.c
+++ b/net/wireless/reg.c
@@ -2946,6 +2946,9 @@ int regulatory_hint_user(const char *alpha2,
 	if (WARN_ON(!alpha2))
 		return -EINVAL;
+	if (!is_world_regdom(user_alpha2) && !is_an_alpha2(user_alpha2))
+		return -EINVAL;
 	request = kzalloc(sizeof(struct regulatory_request), GFP_KERNEL);
 	if (!request)
 		return -ENOMEM;

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, back to index

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-19  8:46 [PATCH] cfg80211: regulatory: reject invalid hints Johannes Berg

Linux-Wireless Archive on

Archives are clonable:
	git clone --mirror linux-wireless/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-wireless linux-wireless/ \
	public-inbox-index linux-wireless

Example config snippet for mirrors

Newsgroup available over NNTP:

AGPL code for this site: git clone