From patchwork Fri May 12 17:21:59 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rajkumar Manoharan X-Patchwork-Id: 9724711 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 E519B60348 for ; Fri, 12 May 2017 17:24:06 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E61FD2879F for ; Fri, 12 May 2017 17:24:06 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D937D287FB; Fri, 12 May 2017 17:24:06 +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.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID 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 590DF2879F for ; Fri, 12 May 2017 17:24:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756588AbdELRYD (ORCPT ); Fri, 12 May 2017 13:24:03 -0400 Received: from wolverine01.qualcomm.com ([199.106.114.254]:39093 "EHLO wolverine01.qualcomm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758508AbdELRWT (ORCPT ); Fri, 12 May 2017 13:22:19 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=qti.qualcomm.com; i=@qti.qualcomm.com; q=dns/txt; s=qcdkim; t=1494609739; x=1526145739; h=from:to:cc:subject:date:message-id:mime-version; bh=PhPMbQE6Q9dFfuRl4M1OUiDy5ymCCZYSGvWDpLlMupM=; b=X0DwodqVmOl+8FhMIqO3IfRXsEKCYkJP8tFonqA/WMvAuV6pVXHO2f6g hM6BmYynhgACdIz1A3h3pMpKpuoohJ89a7yyNIht2hph1WVv48W5by68K 2Y63b/0683uMA7WFQ4pCMpVnONWiV4h7R4itLmIt9OPxKIjR4uouIknCR Y=; X-IronPort-AV: E=Sophos;i="5.38,330,1491289200"; d="scan'208";a="285676994" Received: from ironmsg06-lv.qualcomm.com ([10.47.202.185]) by wolverine01.qualcomm.com with ESMTP; 12 May 2017 10:22:18 -0700 X-IronPort-AV: E=McAfee;i="5800,7501,8526"; a="19953621" X-MGA-submission: =?us-ascii?q?MDEK1eZ3JpH5Mzs22Gf1goOUuPgbuvXaLdyHu7?= =?us-ascii?q?+a38cjuR/3cmYNKTNP7qwZr+g1OuPpnLFZ7DDE57xmUQo15LogV9vrFc?= =?us-ascii?q?dar1VvVp1F5aMrqIhigClSMaYBNBg8B0Mx5XyrBD6O7/FOB7+95yAUh3?= =?us-ascii?q?+N?= Received: from nalasexr01h.na.qualcomm.com ([10.49.56.54]) by Ironmsg06-lv.qualcomm.com with ESMTP/TLS/RC4-SHA; 12 May 2017 10:22:03 -0700 Received: from qcmail1.qualcomm.com (10.80.80.8) by NALASEXR01H.na.qualcomm.com (10.49.56.54) with Microsoft SMTP Server (TLS) id 15.0.1178.4; Fri, 12 May 2017 10:22:02 -0700 Received: by qcmail1.qualcomm.com (sSMTP sendmail emulation); Fri, 12 May 2017 10:22:01 -0700 From: Rajkumar Manoharan To: CC: , , Rajkumar Manoharan Subject: [PATCH] mac80211: strictly check mesh address extension mode Date: Fri, 12 May 2017 10:21:59 -0700 Message-ID: <1494609719-27936-1-git-send-email-rmanohar@qti.qualcomm.com> X-Mailer: git-send-email 1.9.1 MIME-Version: 1.0 X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: NASANEXM01B.na.qualcomm.com (10.85.0.82) To NALASEXR01H.na.qualcomm.com (10.49.56.54) 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 Mesh forwarding path checks for address extension mode to fetch appropriate proxied address and MPP address. Existing condition that looks for 6 address format is not so strict enough so that frames with improper values are processed and invalid entries are added into MPP table. Fix that by adding strick check and drop those invalid frames. Signed-off-by: Rajkumar Manoharan --- net/mac80211/rx.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c index 35f4c7d7a500..1f75280ba26c 100644 --- a/net/mac80211/rx.c +++ b/net/mac80211/rx.c @@ -2492,7 +2492,8 @@ static bool ieee80211_frame_allowed(struct ieee80211_rx_data *rx, __le16 fc) if (is_multicast_ether_addr(hdr->addr1)) { mpp_addr = hdr->addr3; proxied_addr = mesh_hdr->eaddr1; - } else if (mesh_hdr->flags & MESH_FLAGS_AE_A5_A6) { + } else if ((mesh_hdr->flags & MESH_FLAGS_AE) == + MESH_FLAGS_AE_A5_A6) { /* has_a4 already checked in ieee80211_rx_mesh_check */ mpp_addr = hdr->addr4; proxied_addr = mesh_hdr->eaddr2;