From patchwork Sat Aug 6 14:59:37 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sven Eckelmann X-Patchwork-Id: 16585 X-Patchwork-Delegate: mareklindner@neomailbox.ch Return-Path: X-Original-To: patchwork@open-mesh.org Delivered-To: patchwork@open-mesh.org Received: from open-mesh.org (localhost [IPv6:::1]) by open-mesh.org (Postfix) with ESMTP id 3C96982E74; Sat, 6 Aug 2016 16:59:52 +0200 (CEST) Authentication-Results: open-mesh.org; dmarc=none header.from=narfation.org Authentication-Results: open-mesh.org; dkim=fail reason="verification failed; unprotected key" header.d=narfation.org header.i=@narfation.org header.b=nhJ/kDwD; dkim-adsp=fail (unprotected policy); dkim-atps=neutral Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=2001:4d88:2000:7::2; helo=v3-1039.vlinux.de; envelope-from=sven@narfation.org; receiver=b.a.t.m.a.n@lists.open-mesh.org Authentication-Results: open-mesh.org; dmarc=pass header.from=narfation.org Received: from v3-1039.vlinux.de (narfation.org [IPv6:2001:4d88:2000:7::2]) by open-mesh.org (Postfix) with ESMTPS id 2F12A82E72 for ; Sat, 6 Aug 2016 16:59:45 +0200 (CEST) Received: from sven-desktop.home.narfation.org (p200300C593C7B8FD0000000000002E16.dip0.t-ipconnect.de [IPv6:2003:c5:93c7:b8fd::2e16]) by v3-1039.vlinux.de (Postfix) with ESMTPSA id A23531100E7; Sat, 6 Aug 2016 16:59:44 +0200 (CEST) Authentication-Results: v3-1039.vlinux.de; dmarc=none header.from=narfation.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=narfation.org; s=20121; t=1470495584; bh=NsbgtypZEmftroDJvVCawOSzvhFzbG4yYFRMqtX3a28=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=nhJ/kDwDku8Gd1EDwan7jizWt/ZGf2B7P0f6m9X5vc1ck+DztAq4G0AkbdfQa1D6C 9Tnxl1nsteJc1ccWIBCY4mpUNMHVKeEcUO+5xmm4c4m2CciUgUV014jW0XDN5rtjMW f1rXFIUI43+e9RkRBQBmVXB4zJ46w++0FVQCi1GE= From: Sven Eckelmann To: b.a.t.m.a.n@lists.open-mesh.org Date: Sat, 6 Aug 2016 16:59:37 +0200 Message-Id: <1470495578-20476-2-git-send-email-sven@narfation.org> X-Mailer: git-send-email 2.8.1 In-Reply-To: <1470495578-20476-1-git-send-email-sven@narfation.org> References: <1470495578-20476-1-git-send-email-sven@narfation.org> Subject: [B.A.T.M.A.N.] [PATCH v2 2/3] batman-adv: Disallow zero and mcast src address for mgmt frames X-BeenThere: b.a.t.m.a.n@lists.open-mesh.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: The list for a Better Approach To Mobile Ad-hoc Networking List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: The list for a Better Approach To Mobile Ad-hoc Networking Errors-To: b.a.t.m.a.n-bounces@lists.open-mesh.org Sender: "B.A.T.M.A.N" The routing check for management frames is validating the source mac address in the outer ethernet header. It rejects every source mac address which is a broadcast address. But it also has to reject the zero-mac address and multicast mac addresses. Signed-off-by: Sven Eckelmann --- v2: - clarify in commit message that only the outer ethernet header is affected (thanks Linus) - split in patch 1/2 --- net/batman-adv/routing.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/net/batman-adv/routing.c b/net/batman-adv/routing.c index 913ab51..e2b91e6 100644 --- a/net/batman-adv/routing.c +++ b/net/batman-adv/routing.c @@ -196,8 +196,8 @@ bool batadv_check_management_packet(struct sk_buff *skb, if (!is_broadcast_ether_addr(ethhdr->h_dest)) return false; - /* packet with broadcast sender address */ - if (is_broadcast_ether_addr(ethhdr->h_source)) + /* packet with invalid sender address */ + if (!is_valid_ether_addr(ethhdr->h_source)) return false; /* create a copy of the skb, if needed, to modify it. */