From patchwork Wed Aug 2 10:53:10 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stanislaw Gruszka X-Patchwork-Id: 9876617 X-Patchwork-Delegate: johannes@sipsolutions.net Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id ACF5D6037D for ; Wed, 2 Aug 2017 10:54:57 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B98E4286C6 for ; Wed, 2 Aug 2017 10:54:57 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id AE92E28761; Wed, 2 Aug 2017 10:54:57 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9458228778 for ; Wed, 2 Aug 2017 10:54:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752959AbdHBKy0 (ORCPT ); Wed, 2 Aug 2017 06:54:26 -0400 Received: from mx1.redhat.com ([209.132.183.28]:55652 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752954AbdHBKy0 (ORCPT ); Wed, 2 Aug 2017 06:54:26 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 92C1FC058EA1; Wed, 2 Aug 2017 10:54:25 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 92C1FC058EA1 Authentication-Results: ext-mx08.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx08.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=sgruszka@redhat.com Received: from localhost (unknown [10.43.2.74]) by smtp.corp.redhat.com (Postfix) with ESMTP id E9E127F398; Wed, 2 Aug 2017 10:54:24 +0000 (UTC) Date: Wed, 2 Aug 2017 12:53:10 +0200 From: Stanislaw Gruszka To: linux-wireless@vger.kernel.org Cc: Michael Skeffington Subject: [PATCH v2] mac80211: remove mic_fail_no_key label Message-ID: <20170802105310.GB4777@redhat.com> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.20 (2009-12-10) X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Wed, 02 Aug 2017 10:54:25 +0000 (UTC) Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP For historic reasons we have separate cases for mic_fail and mic_fail_no_key. But with current code we can merge those cases, as we already have NULL key check since commit a66b98db570a ("mac80211: fix rx->key NULL dereference during mic failure"). Patch makes the rx->key->u.tkip.mic_failures statistics increase on all cases when RX_FLAG_MMIC_ERROR is set. Reported-by: Michael Skeffington Signed-off-by: Stanislaw Gruszka --- v1 -> v2 : use preferred commit format in the changelog. net/mac80211/wpa.c | 3 +-- 1 files changed, 1 insertions(+), 2 deletions(-) diff --git a/net/mac80211/wpa.c b/net/mac80211/wpa.c index 0d722ea..98fd9a0 100644 --- a/net/mac80211/wpa.c +++ b/net/mac80211/wpa.c @@ -111,7 +111,7 @@ */ if (status->flag & (RX_FLAG_MMIC_STRIPPED | RX_FLAG_IV_STRIPPED)) { if (status->flag & RX_FLAG_MMIC_ERROR) - goto mic_fail_no_key; + goto mic_fail; if (!(status->flag & RX_FLAG_IV_STRIPPED) && rx->key && rx->key->conf.cipher == WLAN_CIPHER_SUITE_TKIP) @@ -170,7 +170,6 @@ mic_fail: rx->key->u.tkip.mic_failures++; -mic_fail_no_key: /* * In some cases the key can be unset - e.g. a multicast packet, in * a driver that supports HW encryption. Send up the key idx only if