From patchwork Mon Aug 11 18:51:54 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krishna Chaitanya X-Patchwork-Id: 4709341 Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 72FBA9F375 for ; Mon, 11 Aug 2014 18:52:16 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B26A52011E for ; Mon, 11 Aug 2014 18:52:15 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E1AA82010B for ; Mon, 11 Aug 2014 18:52:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754649AbaHKSwL (ORCPT ); Mon, 11 Aug 2014 14:52:11 -0400 Received: from mail-we0-f176.google.com ([74.125.82.176]:48327 "EHLO mail-we0-f176.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753954AbaHKSwJ (ORCPT ); Mon, 11 Aug 2014 14:52:09 -0400 Received: by mail-we0-f176.google.com with SMTP id q58so8963339wes.7 for ; Mon, 11 Aug 2014 11:52:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=027JChADMaTNnpPzrWYGKEFQIuQ30vUlFIfZplqRg4s=; b=mIutS1xP3JuSRKuT/m4fTu4vipDomWy77soY3m2owinzpl6xbYx8Qi/XWj7rf4EX4C 3bBSvV6XiFP6T1sdMfaS0ES11E6qh4pCYr5neJRHb9U5tkDCDzGEVtquSqyTTr3qKxgO XdRmzCL8vo85oX5EjNzPHu4xm6ph19Wg8E2hW6qJb9EQVaymZgY1S5nMQCgy6s4gFgaa CV3vNDE5j5JDlzRbMDh/rnhYqxNnJRntLrK3IC4146xCGZe4iJebi38oJIZuDQH91Swm pKOpenZO0d67NQccQUyKYG/9FqAWRWTwXVjPkEi/xUq2nZlc0pOjNtSaeKv6XG0bCeeP EUoA== X-Received: by 10.180.39.34 with SMTP id m2mr26962248wik.80.1407783128435; Mon, 11 Aug 2014 11:52:08 -0700 (PDT) Received: from chaitanya-desktop.hb.imgtec.org ([115.112.122.66]) by mx.google.com with ESMTPSA id e3sm3597730wjp.4.2014.08.11.11.52.05 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 11 Aug 2014 11:52:07 -0700 (PDT) From: chaitanya.mgit@gmail.com To: johannes@sipsolutions.net Cc: linux-wireless@vger.kernel.org, Chaitanya T K Subject: [mac80211] Enforce protected check for unicast robust management frames. Date: Tue, 12 Aug 2014 00:21:54 +0530 Message-Id: <1407783114-5469-1-git-send-email-chaitanya.mgit@gmail.com> X-Mailer: git-send-email 1.7.9.5 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Chaitanya T K Enforce the check for protected field for all unicast robust management frames. Signed-off-by: Chaitanya T K --- This removed the dependency on the driver to check for protected bit, especially for those drivers who believed the API :-). --- net/mac80211/rx.c | 3 +++ 1 file changed, 3 insertions(+) -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c index a8d862f..63e8f3d 100644 --- a/net/mac80211/rx.c +++ b/net/mac80211/rx.c @@ -569,6 +569,9 @@ static int ieee80211_is_unicast_robust_mgmt_frame(struct sk_buff *skb) if (is_multicast_ether_addr(hdr->addr1)) return 0; + if (!ieee80211_has_protected(hdr->frame_control)) + return 0; + return ieee80211_is_robust_mgmt_frame(skb); }