Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp5579206imm; Tue, 12 Jun 2018 09:55:31 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJVD5RN3rkUT6EwSIMWhPjgUf5aSYt58yyArEUALG3QvBZ/ZI8rA4hgHnjYXozUdoNLsykV X-Received: by 2002:a62:db05:: with SMTP id f5-v6mr1181334pfg.123.1528822531381; Tue, 12 Jun 2018 09:55:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528822531; cv=none; d=google.com; s=arc-20160816; b=QsO6RjU6a1vmnpAOIADT1t8diADntDi8wPL3oUQWG+TJLxGqGGMBD2O4mq0NIA71f+ +TrhvLiq8ZRENCiW0EGGnsfZqfzHnwHCQsVpEhuzp8KpHtgGr4Zg1q5S9eZzC6Ad/yXS IC+/nv7RVbpal1Ek0rD3CyG1I60tx15yicJ6PRSfbMsre+HeuJ0Tv23mwsqODdkAso18 6BQjzOPZja1Ka3+axXxen0HUt2tFWycYcpAIgNWIOcYkdTC8UwwrexXHnA6OTdHGyEtE Biho5Yf7hKwyJP4AwkRfp5Tf+waFoi9Wci+Cf35+8fW31FGb6wVODVx2H6y42DVOfG2L 6R7w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=WzOL7bl6H1ZN6soGGVX95htoaYIunFy2SMp1wtM4Lxo=; b=XNS9QO2TQJYou0SJ12up+WfKCJCEsm77fMNkAYNmKhRq00dBPYWNOKL+fPL2RUt0eo U3wN4dZQ+z+CGvH1EoIgGjsG3z3jMSrEKChdi01dhTOw74bVrEC3l9Zx4d9gqjQk6ydy pcZ4CnOZUMLese+R/an6EobO2NbCBZpSK1SrwOnxTIdSv4Vc5X0jdUx9NrBMFObcku2Z K+Uad/6GOULeDeN1T/9LOQykq033biMk0Uj0G3/VqUcabbzyp5hXY5DavYY+KXpcIyyY /dee3i/0fnYILkFiroFuqCrTVVQ9W++gssMuzpG7sueEXsQHZ3csifYS8kqSTSlWMHub Zuug== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Ba6gEqR4; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q14-v6si589782pli.419.2018.06.12.09.55.17; Tue, 12 Jun 2018 09:55:31 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Ba6gEqR4; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935166AbeFLQxj (ORCPT + 99 others); Tue, 12 Jun 2018 12:53:39 -0400 Received: from mail.kernel.org ([198.145.29.99]:53078 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934280AbeFLQxf (ORCPT ); Tue, 12 Jun 2018 12:53:35 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) (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 94365208B8; Tue, 12 Jun 2018 16:53:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1528822415; bh=ak5JVHuRg1Yd74ro8+IzA8FRIW6Jpei50AgNtsSzVHY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Ba6gEqR4M9uhoJCgCRDSGiU8wxXQZhmHyvDvLf0bLT6NQKAke3Ns4JUmSRa9jwvTj rIKbgdwXUpRuwst5KR64zkoilTO9ocwa4TowcBlPSsznepoeNAeQsuOKj7dxkNzZbG y/PAyd/XGaca2mDAFg0d2G4nZOuCwPyLrkD6u7kQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Stefan Wahren , Franky Lin , Kalle Valo , Ben Hutchings Subject: [PATCH 4.4 08/24] brcmfmac: Fix check for ISO3166 code Date: Tue, 12 Jun 2018 18:51:52 +0200 Message-Id: <20180612164816.963565286@linuxfoundation.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180612164816.587001852@linuxfoundation.org> References: <20180612164816.587001852@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.4-stable review patch. If anyone has any objections, please let me know. ------------------ From: Stefan Wahren commit 9b9322db5c5a1917a66c71fe47c3848a9a31227e upstream. The commit "regulatory: add NUL to request alpha2" increases the length of alpha2 to 3. This causes a regression on brcmfmac, because brcmf_cfg80211_reg_notifier() expect valid ISO3166 codes in the complete array. So fix this accordingly. Fixes: 657308f73e67 ("regulatory: add NUL to request alpha2") Signed-off-by: Stefan Wahren Acked-by: Franky Lin Signed-off-by: Kalle Valo [bwh: Backported to 4.4: adjust filename] Signed-off-by: Ben Hutchings Signed-off-by: Greg Kroah-Hartman --- drivers/net/wireless/brcm80211/brcmfmac/cfg80211.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/net/wireless/brcm80211/brcmfmac/cfg80211.c +++ b/drivers/net/wireless/brcm80211/brcmfmac/cfg80211.c @@ -6167,7 +6167,7 @@ static void brcmf_cfg80211_reg_notifier( req->alpha2[0], req->alpha2[1]); /* ignore non-ISO3166 country codes */ - for (i = 0; i < sizeof(req->alpha2); i++) + for (i = 0; i < 2; i++) if (req->alpha2[i] < 'A' || req->alpha2[i] > 'Z') { brcmf_err("not a ISO3166 code\n"); return;