Return-path: Received: from mail-wm0-f51.google.com ([74.125.82.51]:50331 "EHLO mail-wm0-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752220AbeAaOAX (ORCPT ); Wed, 31 Jan 2018 09:00:23 -0500 Received: by mail-wm0-f51.google.com with SMTP id f71so8386389wmf.0 for ; Wed, 31 Jan 2018 06:00:22 -0800 (PST) Subject: Re: [PATCH] brcmfmac: detect & reject faked packet generated by a firmware To: =?UTF-8?B?UmFmYcWCIE1pxYJlY2tp?= References: <20180130090922.30346-1-zajec5@gmail.com> <5A705741.6050402@broadcom.com> <44f66f2254e7a5950ec32068b31d7b54@milecki.pl> Cc: =?UTF-8?B?UmFmYcWCIE1pxYJlY2tp?= , Kalle Valo , Franky Lin , Hante Meuleman , Chi-Hsien Lin , Wright Feng , Pieter-Paul Giesberts , linux-wireless@vger.kernel.org, brcm80211-dev-list.pdl@broadcom.com, brcm80211-dev-list@cypress.com From: Arend van Spriel Message-ID: <5A71CBF5.9020300@broadcom.com> (sfid-20180131_150037_602956_D3F012D1) Date: Wed, 31 Jan 2018 15:00:21 +0100 MIME-Version: 1.0 In-Reply-To: <44f66f2254e7a5950ec32068b31d7b54@milecki.pl> Content-Type: text/plain; charset=utf-8; format=flowed Sender: linux-wireless-owner@vger.kernel.org List-ID: On 1/31/2018 2:11 PM, Rafał Miłecki wrote: >>> void brcmf_netif_rx(struct brcmf_if *ifp, struct sk_buff *skb) >>> { >>> + if (!brcmf_is_valid_skb(skb)) { >>> + brcmu_pkt_buf_free_skb(skb); >> >> Maybe we should add a driver stat for this although I better have a >> look into the root cause of this. > > It seems there are following stats fields we can use: > 1) rx_errors > 2) rx_dropped > 3) rx_length_errors > 4) rx_over_errors > 5) rx_crc_errors > 6) rx_frame_errors > 7) rx_fifo_errors > 8) rx_missed_errors > > Which one do you think may fit this case the best? Those are actually netdev stats, right? Not sure I want to have those, but if any I would say 3) fits best. Regards, Arend