Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp709773ybp; Fri, 4 Oct 2019 03:49:19 -0700 (PDT) X-Google-Smtp-Source: APXvYqyJfmo8I977MXXNW0koNhNMoJhVYJnDzw8aC5EcZFW/pjg4bNDUv0YSTj7J/31xxX4ytdZt X-Received: by 2002:a50:e791:: with SMTP id b17mr14140747edn.11.1570186159113; Fri, 04 Oct 2019 03:49:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570186159; cv=none; d=google.com; s=arc-20160816; b=P+N1c6AOUoPo6/taWnzNqhritcafn+dhTgNqFTVpvjgxkKjEtB04FV9xIolrAhEpt+ BisqPGLarrNLWzuly0i6ZFKdfiNLUGUDu4R3znhkg9q04QBp0WTqCjog/ggLwxq6csxK YrSQsy0SVzwlo747K3Ki+1guY+m9pY91x3TI/LTTGa7V7rUmSHUb+FKfS7c16THh6n/m /Ss9/wSLU4DqfJ4X+Jhid2EJUD5yO5UgxeCvwDNOAGDW3IixgQyuw+R2xZpXs7NSP1W+ qGAca5InFGDuq+AOMYECcKtsK47/rtlUjpgme3i/I43531c0k5NpDjZzs8GFq+ZBazls +Q6g== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=SDEjJlFGnZEVLKwp53YSkjo+Xm6OguhGW8Vu0chTKKk=; b=G22Zuyi09i24nTIhHosWiEn9yC9qi4i4zkUGMWUvKyJGhjRo2Jung0qo7Vq6VSNh3Z vs1qP95G+d7oE7DfZtnHlJZf9ifU2/C/qDQoR2DwZHrARfkAYTRPmufaOBqCz8LAKlUw O6rWSthKK+fxl/mWnvG1xB+amIuaHgRZu5r6zKRXuKhvswQmjdEitT9wEJPuxmEr36ap owEmuBdfhnH5VVNkqem4ybDnIdQHRi+bdya6ZQO6WYCmNZvTpw0QzEF2k2Z5SnBYQQOI qMWWoHZqa+eiS50VpalGC1d/Y8WbWFZZo+vZ51UiDh3tWeRpfA3nVYev9JrlEAbGtSm2 hhEA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Qr4YT3Kk; spf=pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d17si3013986edv.76.2019.10.04.03.48.54; Fri, 04 Oct 2019 03:49:19 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-wireless-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=@redhat.com header.s=mimecast20190719 header.b=Qr4YT3Kk; spf=pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387754AbfJDKh3 (ORCPT + 99 others); Fri, 4 Oct 2019 06:37:29 -0400 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:58576 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2387734AbfJDKh3 (ORCPT ); Fri, 4 Oct 2019 06:37:29 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1570185447; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=SDEjJlFGnZEVLKwp53YSkjo+Xm6OguhGW8Vu0chTKKk=; b=Qr4YT3KkZtqL3/ThOhJwUqnvuiL2fuMBUA5sCkDC30jCa8Y6d9QDAYloJqtl59lq58pFZk 5pnqUj2sHlGVjkPBj8cpzfzuSGC4ADpnE8VtsZRQaRMvtiANM/41OiZkpeyHQQZ13ye29v 3WwYd9DxDAsLYTRAIaBfK+n+0Lc09WU= Received: from mail-wr1-f71.google.com (mail-wr1-f71.google.com [209.85.221.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-279-JyBuzyrhN46WuAXjtMxoOQ-1; Fri, 04 Oct 2019 06:37:25 -0400 Received: by mail-wr1-f71.google.com with SMTP id k2so2518290wrn.7 for ; Fri, 04 Oct 2019 03:37:25 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=TEaVNH3A7e7GBPdlA+cAKBgNZsoDT0//X3uinQHMMwc=; b=NOE7QDWA8lw68lsttIBuHTowRRXTeizE1QlrX/gF/lJxgNKT0XhI/e3CATsEjFRRzz ofS0HN0vv3KZxbNPs4hUGRuiWF9eLMQ4k0pgzHOiAXWWMe5duAXTeQM082dJdA4xz3te ip9QZ1c+L0yLIoBaX6UO+RYuSYRppZE9ImTqb+35lBBXOCL2p8O6AmiWVe1xG8Vdz2MH O6CJj8J/8ifA5buZ7hzxhxQ+vyVczkXrPL0pPWoHtZ3FJEa9ioMR2Juek0QZDDQRJ3tE jvcloDfilRHjPOKGfyPUJ5+SKxsqrB3BE/6Jwxs7ZV8u6EYQlath91nAJPXGr4zI+yuV 8MJA== X-Gm-Message-State: APjAAAW3EzlADKqXlvx14yRweroqCSTBKqamYNjoSb09FpRrXhtZHgvZ JDt2aWHEqrTQR8KuwHna6SMJocYujouODv3YR+hq3dL3/4iA5t9GuYdfy7qgbVzf3eYSFpeJ3GC CkVtSJQhF2sViqD40kCnDUgkJvyY= X-Received: by 2002:a7b:c7d7:: with SMTP id z23mr6566523wmk.137.1570185444156; Fri, 04 Oct 2019 03:37:24 -0700 (PDT) X-Received: by 2002:a7b:c7d7:: with SMTP id z23mr6566507wmk.137.1570185443925; Fri, 04 Oct 2019 03:37:23 -0700 (PDT) Received: from dhcp-44-196.space.revspace.nl ([2a0e:5700:4:11:6eb:1143:b8be:2b8]) by smtp.gmail.com with ESMTPSA id b186sm11867365wmd.16.2019.10.04.03.37.22 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 04 Oct 2019 03:37:23 -0700 (PDT) Subject: Re: [PATCH 5.4 regression fix] brcmfmac: Fix brcmf_cfg80211_get_channel returning uninitialized fields To: Kalle Valo Cc: Arend van Spriel , Franky Lin , Hante Meuleman , Chi-Hsien Lin , Wright Feng , linux-wireless@vger.kernel.org, brcm80211-dev-list.pdl@broadcom.com References: <20191003200821.819594-1-hdegoede@redhat.com> <87r23ssssh.fsf@codeaurora.org> From: Hans de Goede Message-ID: <0d86c109-78d3-3858-ae56-e4cdcb056fe4@redhat.com> Date: Fri, 4 Oct 2019 12:37:22 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <87r23ssssh.fsf@codeaurora.org> Content-Language: en-US X-MC-Unique: JyBuzyrhN46WuAXjtMxoOQ-1 X-Mimecast-Spam-Score: 0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Hi, On 10/4/19 12:34 PM, Kalle Valo wrote: > Hans de Goede writes: >=20 >> With the new edmg support struct cfg80211_chan_def has been extended >> with a number of new members. brcmf_cfg80211_get_channel() was not setti= ng >> (clearing) these causing the cfg80211_edmg_chandef_valid() check in >> cfg80211_chandef_valid() to fail. Triggering a WARN_ON and, worse, causi= ng >> brcmfmac based wifi cards to not work. >> >> This commit fixes this by clearing the entire passed struct to 0 before >> setting the members used by the brcmfmac code. This solution also makes >> sure that this problem will not repeat itself in the future if further >> members are added to the struct. >> >> Signed-off-by: Hans de Goede >> --- >> drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >> >> diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c= b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c >> index e3ebb7abbdae..480c05f66ebd 100644 >> --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c >> +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c >> @@ -5041,10 +5041,10 @@ static int brcmf_cfg80211_get_channel(struct wip= hy *wiphy, >> =09} >> =20 >> =09freq =3D ieee80211_channel_to_frequency(ch.control_ch_num, band); >> +=09memset(chandef, 0, sizeof(*chandef)); >> =09chandef->chan =3D ieee80211_get_channel(wiphy, freq); >> =09chandef->width =3D width; >> =09chandef->center_freq1 =3D ieee80211_channel_to_frequency(ch.chnum, = band); >> -=09chandef->center_freq2 =3D 0; >> =20 >> =09return 0; >> } >=20 > Is this a separate issue from the cfg80211 fix: >=20 > cfg80211: initialize on-stack chandefs >=20 > https://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211.git/commit= /?id=3Df43e5210c739fe76a4b0ed851559d6902f20ceb1 No it is the same issue, I was actually wondering if I should do a generic = fix instead... I'm glad someone has already fixed this with a generic fix. Assu= ming the generic fix is going upstream soon, then this (my) patch can be dropped. Regards, Hans