Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp4158421pxk; Tue, 8 Sep 2020 12:10:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwOyfi3ktgL2tiF2X3xwVDEa2E99ka96StMsPexJfVsqUJX5JYXaai9YitZSgE0eo5tQJa5 X-Received: by 2002:a17:906:c0d9:: with SMTP id bn25mr20027434ejb.246.1599592204917; Tue, 08 Sep 2020 12:10:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599592204; cv=none; d=google.com; s=arc-20160816; b=Ee31CJzKWs3U/dG1OtLqxkexoVizjLIkqnWtKWfMbXcLqn/alTW4uLx0edhIMFc1Ov KWPLrWkSGKEEPK+jKO3rVsjJl/JJCFCPqqf4rwQijvEIDLY7pdnkeoX86TY9pNgfCQFb qfX+UdVFNffqMrztmom/7gOx7yFlmx1BKzCA7DqNLpJ5IHDdyp25h2KN+XzmiAWhe1Ex hdtTdIM7xIb3fwv7W10+Om4HPfbns/LHXHorjNPXV520uSs0FvVvcLK29T22UMML0QZU GsWC544W3XWQuzmVxVvTHBHEVidiV/ZZWcUROUoQ0idEtAsML0SE+UT9ViRmVMhsH02k lvfA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=hIQgfPvyEUUQSGOCU+2LcnIgXdOfl9k2OAchVwnNSUI=; b=EvgRGnzL4Ey/T8TOvO22vAywZJdb6uZXQa2lNG9th8gUL9ZSEQaYnnYicJJ6FHzleG 2Yy1kahLyPVbuQapl6LzWA0lRwDy1q+ptLfLG9aWDlgOcCMPJ9M4x0hJ2bFisdnSnMmH 5yJTwztpOAQi2VtbOd3DaGyLDIFOv48eyK/SGcp7M0yK6D2hjVM04VCEsbyWaSxQb+ia U+n3g9kE/Fht7yP7J4Qp7rjHK51rKo08hXYjEypXV4iTV2LHn2xyvKQtIZFOQKEQdJVE gsxOIraFzolJKxSGiELoziQiT7KRJzhRCFDdK+QGGKIVzB4lushos7PvkxCy9YTIODvc 94kA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=naCwpKLH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id mh13si12673781ejb.244.2020.09.08.12.09.42; Tue, 08 Sep 2020 12:10:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=naCwpKLH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731500AbgIHTGE (ORCPT + 99 others); Tue, 8 Sep 2020 15:06:04 -0400 Received: from mail.kernel.org ([198.145.29.99]:55070 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731265AbgIHQHV (ORCPT ); Tue, 8 Sep 2020 12:07:21 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 1148823E23; Tue, 8 Sep 2020 15:47:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1599580021; bh=AmUXoqDvPYAppkTPtlyJh3gIcyLvXnjAWic2y/tvzfg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=naCwpKLH3EfDI2rJvyxoQCBAKM6T/9TknTErigNhT8q8DsRuXKLTqMtdS1TxM08A9 6fN57rulVmZqEepkOxPI1gmD83rTnnvrEPjU1wxAvFmB3/olkw1EkkKpumUVOvaOwd 64hbH4hm1aIKlDNHp6anaCACptMhS+rADA92TfaY= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, syzbot+d451401ffd00a60677ee@syzkaller.appspotmail.com, Johannes Berg Subject: [PATCH 5.4 128/129] cfg80211: regulatory: reject invalid hints Date: Tue, 8 Sep 2020 17:26:09 +0200 Message-Id: <20200908152236.265156088@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200908152229.689878733@linuxfoundation.org> References: <20200908152229.689878733@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Johannes Berg commit 47caf685a6854593348f216e0b489b71c10cbe03 upstream. Reject invalid hints early in order to not cause a kernel WARN later if they're restored to or similar. Reported-by: syzbot+d451401ffd00a60677ee@syzkaller.appspotmail.com Link: https://syzkaller.appspot.com/bug?extid=d451401ffd00a60677ee Link: https://lore.kernel.org/r/20200819084648.13956-1-johannes@sipsolutions.net Signed-off-by: Johannes Berg Signed-off-by: Greg Kroah-Hartman --- net/wireless/reg.c | 3 +++ 1 file changed, 3 insertions(+) --- a/net/wireless/reg.c +++ b/net/wireless/reg.c @@ -2941,6 +2941,9 @@ int regulatory_hint_user(const char *alp if (WARN_ON(!alpha2)) return -EINVAL; + if (!is_world_regdom(alpha2) && !is_an_alpha2(alpha2)) + return -EINVAL; + request = kzalloc(sizeof(struct regulatory_request), GFP_KERNEL); if (!request) return -ENOMEM;