Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp997991ybg; Mon, 1 Jun 2020 21:35:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyPPl2ud7BUS6+OrrtxFmt+8M/x4nzu0xDx5q2SPaPFSiG6OjCIuBL6NvWFiGRnjXl4P489 X-Received: by 2002:a37:8786:: with SMTP id j128mr23251602qkd.63.1591072553288; Mon, 01 Jun 2020 21:35:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591072553; cv=none; d=google.com; s=arc-20160816; b=Fy0sC/e4ZN/OF6PSHwvx9J5+4gUpZ9eNyfi2yi03kM9+ilAbuRVAIXhpqVRdPz4SWD 2rdVnUtS9bnw3oOMLJxCaJ8xQpMPburcadq8cJbj+uR2A1tlVXFf/v7uKweVHG9hP4QI lfP1LedzFGGP9vUXiP+569SqsJ+gbrBf3qLVIliAiN/Cn3FFzs86UUTlLvgKDxOU7ytk Ux64aecL5TNVN2dVYAPEoOySS5xYO7u9U64haS2qjJ2ZedRCaLHy0UOVqSNJqc2nHyck pe4uk6h1vTisSz6msk1odw+1PrAUh1vts+83MMeOOWeP00Avrtz0PX5uwaKGuLhq5Jal jJvA== 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=WVZJwDasayPFpJIhTjhoij4113zIsq78Hh6BlyHy1uY=; b=XK5QwnLE28NKlvDqTN9gsRRaZsHBTr0ow7oUB5XpXygj79TB2B99dULkaBRK0qTBC4 HyrgpDK5L80VVBmGo9RyKCw8JpJcCMD+Yjg4ceWAqnEeMm1Am8kd9EDBz+oyz7pEA/bl RUhYLbl7bYYmPsVmHewZOIovqppHPZUlUSsTLnaCDvXKYhORpUSAPvkAl7uzpavkGTFh fW1APj/KKIb2qu3Xyz9lyaZxDdghd9r5ADe+WAaQws0uKOKEHTwcfZ7/3OjTgag5zhSk +KyJ00qKwBt261cvNEg8k6hWVSxFMuVujUU99/XZJhTWGZ+3AEZp9ftbkMJxaukKmYcY gOfg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=gYfRAjkB; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d7si782959edr.520.2020.06.01.21.35.09; Mon, 01 Jun 2020 21:35:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-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=@gmail.com header.s=20161025 header.b=gYfRAjkB; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725841AbgFBEe4 (ORCPT + 99 others); Tue, 2 Jun 2020 00:34:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51862 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725781AbgFBEe4 (ORCPT ); Tue, 2 Jun 2020 00:34:56 -0400 Received: from mail-wm1-x342.google.com (mail-wm1-x342.google.com [IPv6:2a00:1450:4864:20::342]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C3C67C061A0E for ; Mon, 1 Jun 2020 21:34:55 -0700 (PDT) Received: by mail-wm1-x342.google.com with SMTP id u13so1510436wml.1 for ; Mon, 01 Jun 2020 21:34:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=WVZJwDasayPFpJIhTjhoij4113zIsq78Hh6BlyHy1uY=; b=gYfRAjkBP70ch5RvVEOCQKPnH7tLucTGJIJyV89Kg7kpsRPGzFB6RAUkwJofWjoaly dgifVDnr0qGT8Dgjq0VS6pvKP81eDPRIQf54v6x4kumE7AJzoJtysPsOUpfo1950Q/YX NCLHqZ/UoLAZ+UIGXsemKRWP1fihG9c1kP1BjoixNlmuwfUnh6YHOZ+3s4Ea4lQ4hQAg nCp5US9u1lPfjxNH2OJEKLOdxLkdURz4Gi6TMsO2vGPvLsWd8tDTbI8w02p+6obGBv+v KdwK6QZxRir45lKdUiZtgw1oBtmajChKi9RLPuVskOFFY8X9LfVFuvd1zRM+2kxXG13l /Uig== 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=WVZJwDasayPFpJIhTjhoij4113zIsq78Hh6BlyHy1uY=; b=n5t4FWscCWC/NrYBqpCUK8UzgGqVWxdPqHEykGtSEMI4W695hWM9tD2IXSgJjUQOY9 hAJ2QAjsedM0+qLvWYE9awi0kmyfvWq7cVFo3w9BSR7v1zDSOEJA1oZDZhMQhqmtynrv hRFt8GYXJdm+d7wx+egV3luO6GA6XAKBieDkG5y+Rjh0OgUIkfqm1ap2iiVNpUH7Jznk PcHFipO2YM++Kl1WJhDsFO96lbiNI6Nxqfg2BwqRK5nAaSqVjpuxAuZAPy6smf0Ppg3S ziTmnrcqLQdZdbdk08n8sK6C4rAZH3PGvVqyNrmOvfdBt/3TdoOrO2GK6ONjVNlddVqh wqrQ== X-Gm-Message-State: AOAM532CUMiEmconIYkXIGnGKZX22ut5+OpTtJv/C79xk9qDDd0o9zjv Y7iptYfH4taa6H9U8BuYX3A= X-Received: by 2002:a1c:2643:: with SMTP id m64mr2242150wmm.158.1591072494141; Mon, 01 Jun 2020 21:34:54 -0700 (PDT) Received: from [192.168.1.3] (ip68-111-84-250.oc.oc.cox.net. [68.111.84.250]) by smtp.gmail.com with ESMTPSA id c65sm1724114wme.8.2020.06.01.21.34.51 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 01 Jun 2020 21:34:53 -0700 (PDT) Subject: Re: [PATCH 1/5] brcmfmac: To fix kernel crash on out of boundary access To: Wright Feng , linux-wireless@vger.kernel.org Cc: brcm80211-dev-list@broadcom.com, brcm80211-dev-list@cypress.com, Arend van Spriel , Franky Lin , Hante Meuleman , Kalle Valo , chi-hsien.lin@cypress.com, Raveendran Somu References: <20200601071953.23252-1-wright.feng@cypress.com> <20200601071953.23252-2-wright.feng@cypress.com> From: Florian Fainelli Message-ID: <8fe5fdf5-1b26-a127-3567-321017455a49@gmail.com> Date: Mon, 1 Jun 2020 21:34:50 -0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Firefox/68.0 Thunderbird/68.8.1 MIME-Version: 1.0 In-Reply-To: <20200601071953.23252-2-wright.feng@cypress.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org On 6/1/2020 12:19 AM, Wright Feng wrote: > From: Raveendran Somu > > To trunkcate the addtional bytes, if extra bytes been received. typo: truncate. Missing "have been received". > Current code only have a warning and proceed without handling it. > But in one of the crash reported by DVT, these causes the > crash intermittently. So the processing is limit to the skb->len. > > Signed-off-by: Raveendran Somu > Signed-off-by: Chi-hsien Lin > Signed-off-by: Wright Feng > --- > drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwsignal.c | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwsignal.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwsignal.c > index 09701262330d..531fe9be4025 100644 > --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwsignal.c > +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwsignal.c > @@ -1843,6 +1843,9 @@ void brcmf_fws_hdrpull(struct brcmf_if *ifp, s16 siglen, struct sk_buff *skb) > > WARN_ON(siglen > skb->len); > > + if (siglen > skb->len) > + siglen = skb->len; Does it make sense to keep the WARN_ON() one live above then? > + > if (!siglen) > return; > /* if flow control disabled, skip to packet data and leave */ > -- Florian