Return-path: Received: from mail-wr0-f180.google.com ([209.85.128.180]:33933 "EHLO mail-wr0-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750768AbdGGJT1 (ORCPT ); Fri, 7 Jul 2017 05:19:27 -0400 Received: by mail-wr0-f180.google.com with SMTP id 77so38162524wrb.1 for ; Fri, 07 Jul 2017 02:19:26 -0700 (PDT) Subject: Re: [PATCH] brcmfmac: buffer overflow in brcmf_cfg80211_mgmt_tx() To: Dan Carpenter , Kalle Valo Cc: Linus Torvalds , =?UTF-8?B?ZnJlZW5lcmd1byjpg63lpKflhbQp?= , Franky Lin , Hante Meuleman , Chi-Hsien Lin , Wright Feng , Pieter-Paul Giesberts , =?UTF-8?B?UmFmYcWCIE1pxYJlY2tp?= , "linux-wireless@vger.kernel.org" , "brcm80211-dev-list.pdl@broadcom.com" , brcm80211-dev-list , "security@kernel.org" References: <88f27bfd328f4ccdb0d6b7ff7e710819@MWHPR06MB3230.namprd06.prod.outlook.com> <871spsej2d.fsf@kamboji.qca.qualcomm.com> <20170707084919.aaybvtw2t6dyjgv7@mwanda> From: Arend van Spriel Message-ID: (sfid-20170707_111930_914055_5CB05149) Date: Fri, 7 Jul 2017 11:19:23 +0200 MIME-Version: 1.0 In-Reply-To: <20170707084919.aaybvtw2t6dyjgv7@mwanda> Content-Type: text/plain; charset=utf-8; format=flowed Sender: linux-wireless-owner@vger.kernel.org List-ID: On 7/7/2017 10:49 AM, Dan Carpenter wrote: > On Fri, Jul 07, 2017 at 11:40:26AM +0300, Kalle Valo wrote: >> Linus Torvalds writes: >> >>> On Thu, Jul 6, 2017 at 10:11 AM, Arend van Spriel >>> wrote: >>>> >>>> Looks fine to me so ... >>> >>> I really think that if we can't trust 'len', then we have to check >>> against the lower bound of DOT11_MGMT_HDR_LEN too, because otherwise >>> we'll just have a big 16-bit number instead. >>> >>> And we should do that brcmf_err() that I had in my version, which also >>> let's people know they are being attacked. >> >> I hope brcmf_err() is ratelimited so that the attacker cannot spam the >> logs too much. > > The attacker already has CAP_NET_ADMIN here so you're probably already > toasted. Indeed and brcmf_err() is ratelimited when build without CONFIG_BRCMDBG, which is what distros typically do. Regards, Arend