From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from mail-wr0-f173.google.com ([209.85.128.173]:36011 "EHLO mail-wr0-f173.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750726AbdGGLV7 (ORCPT ); Fri, 7 Jul 2017 07:21:59 -0400 Received: by mail-wr0-f173.google.com with SMTP id c11so42496008wrc.3 for ; Fri, 07 Jul 2017 04:21:58 -0700 (PDT) Subject: Re: [PATCH] brcmfmac: buffer overflow in brcmf_cfg80211_mgmt_tx() From: Arend van Spriel To: Dan Carpenter , Linus Torvalds Cc: =?UTF-8?B?ZnJlZW5lcmd1byjpg63lpKflhbQp?= , Franky Lin , Hante Meuleman , Chi-Hsien Lin , Wright Feng , Kalle Valo , 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> <20170707084640.cv3igibbhhmgsmta@mwanda> Message-ID: (sfid-20170707_132203_060135_338D2479) Date: Fri, 7 Jul 2017 13:21:55 +0200 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Sender: linux-wireless-owner@vger.kernel.org List-ID: On 07-07-17 11:24, Arend van Spriel wrote: > > > On 7/7/2017 10:46 AM, Dan Carpenter wrote: >> On Thu, Jul 06, 2017 at 03:32:42PM -0700, Linus Torvalds wrote: >>> 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. >> >> There is already a check in cfg80211_mlme_mgmt_tx(). >> >> if (params->len < 24 + 1) >> return -EINVAL; >> >> It probably should be using DOT11_MGMT_HDR_LEN instead of a magic 24. > > Missed that check when I looked yesterday evening. Must have been the > time ;-) Hi Dan, This being said, are you going to send a V2 adding a brcmf_err() call as Linus proposed? I think we can improve the length check above later if deemed necessary. Regards, Arend