Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp2247684pxp; Mon, 21 Mar 2022 14:55:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzqmvNcsFR5yzpEYp9JfYUUjed3oQmoci6euTnrubSjr/weJkt6nVfbdtBUWWmA33+u5+TU X-Received: by 2002:a17:902:e88e:b0:154:7562:176d with SMTP id w14-20020a170902e88e00b001547562176dmr3247829plg.13.1647899747977; Mon, 21 Mar 2022 14:55:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1647899747; cv=none; d=google.com; s=arc-20160816; b=HksoX3RhTm6wu0PgHv9nKJqlYQMv3taBu2PaLJteDHAKQ4bAjQVNYq8g1jGbR6nIBg LJ+uLG5Q0JC0jkezkMw3rM9cS07Dmzy9GqrECsFH3xv0m1O3GZLR6lyiLdUcigqypOQV iJVkNg35AAIUKzM1mblkHbZ4RCKDe+Sqx74jCPM2mwD5K2PqD0XAaZOuFv6GuIIvGZyE zMO6kGTKcsQFlHfhxThTpQxz9OlVwSJSuf3H2zmllS071DC+7ooU/ka1l1NsT/SV1ZWD 5TU1WQhHkXUlL8VQq1UxzFVkCqRjB2WGCFpzjHWPqXTRbBV+MVB+FWnC1782VREYOs0M wFgA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=5S1Qz9qa8y5v6pn+6hPiVyR9fbOW9nCX+ik34wPrsIw=; b=TvKuzJn01FTjHuA7BWVBC5oYXG7PvYoGf1aN/lPxikyypLBzKE2o0Amqt0iuHLX81C ewGHa1KVy0gRO1O9J2S7BXtH2taVNfESqJgjKNOwdyNg8RBnhYMaMM0Bw9wMLOIrMHOP gy3up9wntVQq9YcPgyEed+0bd+vfjw+R9raq8EtxqjD74EU/LuYL4/k4NbOtEWxgVlxV 3NMCN6kzdLSqZPJWyDGxP4GJ7FmMdLKCuYZFtBz+1A35bAGJ02PbasYqmyEXeWGWeJ4G PJ6RGMSezijxzUCIvUrT06EeSZMV/so3ELkrGUzYjhHlfx77Obk0mVvpdPblKdoPozq7 Jf/w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=GR4U9PbX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id b11-20020a17090acc0b00b001c65ad33fe0si424884pju.92.2022.03.21.14.55.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Mar 2022 14:55:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=GR4U9PbX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id DA86E2EA92A; Mon, 21 Mar 2022 14:22:32 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239038AbiCTHyG (ORCPT + 99 others); Sun, 20 Mar 2022 03:54:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55456 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231180AbiCTHyE (ORCPT ); Sun, 20 Mar 2022 03:54:04 -0400 Received: from out3-smtp.messagingengine.com (out3-smtp.messagingengine.com [66.111.4.27]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7929B1F0453; Sun, 20 Mar 2022 00:52:40 -0700 (PDT) Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id E8DB85C0116; Sun, 20 Mar 2022 03:52:37 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Sun, 20 Mar 2022 03:52:37 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; bh=5S1Qz9qa8y5v6pn+6 hPiVyR9fbOW9nCX+ik34wPrsIw=; b=GR4U9PbXRmwKlG+92UM35IdYDLE1UnrK7 Ld0eXeTAX/uq+p5Fc/9ZoksjqPgGZiSpV6ROvs5hTVAqwg7Tr2+I9ClVUMIf1gw6 Nd4Q5VhefO0IaNXa2OzHrlr4va1hUuM+J6dmJMWx1rQk1pNLLoUPar4yqWHhGchI tDdBttofIPw+uIPGAhN4loJ50CoPyybCcFjoZ5qHUL9iFqXOQ643z7LP889vGkPq v+3Pmq2E7OXWZv0cSKl/f8Ffr1jVvO3a7Y/rbIHN0fDTkP7v58BS07KKMCkskUG7 rTPrp+jinp67KmciT0vJHFrcQsbAicJn7KXknDl2WEjI12WPUEW+Q== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvvddrudegtddgtdelucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvffukfhfgggtuggjsehttdertddttddvnecuhfhrohhmpefkughoucfu tghhihhmmhgvlhcuoehiughoshgthhesihguohhstghhrdhorhhgqeenucggtffrrghtth gvrhhnpedtffekkeefudffveegueejffejhfetgfeuuefgvedtieehudeuueekhfduheel teenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehiug hoshgthhesihguohhstghhrdhorhhg X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sun, 20 Mar 2022 03:52:36 -0400 (EDT) Date: Sun, 20 Mar 2022 09:52:33 +0200 From: Ido Schimmel To: Hans Schultz Cc: davem@davemloft.net, kuba@kernel.org, netdev@vger.kernel.org, Andrew Lunn , Vivien Didelot , Florian Fainelli , Vladimir Oltean , Jiri Pirko , Ivan Vecera , Roopa Prabhu , Nikolay Aleksandrov , Shuah Khan , Daniel Borkmann , Ido Schimmel , linux-kernel@vger.kernel.org, bridge@lists.linux-foundation.org, linux-kselftest@vger.kernel.org Subject: Re: [PATCH v2 net-next 4/4] selftests: forwarding: add test of MAC-Auth Bypass to locked port tests Message-ID: References: <20220317093902.1305816-1-schultz.hans+netdev@gmail.com> <20220317093902.1305816-5-schultz.hans+netdev@gmail.com> <86mthnw9gr.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <86mthnw9gr.fsf@gmail.com> X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Mar 18, 2022 at 04:45:24PM +0100, Hans Schultz wrote: > On tor, mar 17, 2022 at 16:57, Ido Schimmel wrote: > > On Thu, Mar 17, 2022 at 10:39:02AM +0100, Hans Schultz wrote: > >> Verify that the MAC-Auth mechanism works by adding a FDB entry with the > >> locked flag set. denying access until the FDB entry is replaced with a > >> FDB entry without the locked flag set. > >> > >> Signed-off-by: Hans Schultz > >> --- > >> .../net/forwarding/bridge_locked_port.sh | 29 ++++++++++++++++++- > >> 1 file changed, 28 insertions(+), 1 deletion(-) > >> > >> diff --git a/tools/testing/selftests/net/forwarding/bridge_locked_port.sh b/tools/testing/selftests/net/forwarding/bridge_locked_port.sh > >> index 6e98efa6d371..2f9519e814b6 100755 > >> --- a/tools/testing/selftests/net/forwarding/bridge_locked_port.sh > >> +++ b/tools/testing/selftests/net/forwarding/bridge_locked_port.sh > >> @@ -1,7 +1,7 @@ > >> #!/bin/bash > >> # SPDX-License-Identifier: GPL-2.0 > >> > >> -ALL_TESTS="locked_port_ipv4 locked_port_ipv6 locked_port_vlan" > >> +ALL_TESTS="locked_port_ipv4 locked_port_ipv6 locked_port_vlan locked_port_mab" > >> NUM_NETIFS=4 > >> CHECK_TC="no" > >> source lib.sh > >> @@ -170,6 +170,33 @@ locked_port_ipv6() > >> log_test "Locked port ipv6" > >> } > >> > >> +locked_port_mab() > >> +{ > >> + RET=0 > >> + check_locked_port_support || return 0 > >> + > >> + ping_do $h1 192.0.2.2 > >> + check_err $? "MAB: Ping did not work before locking port" > >> + > >> + bridge link set dev $swp1 locked on > >> + bridge link set dev $swp1 learning on > >> + > >> + ping_do $h1 192.0.2.2 > >> + check_fail $? "MAB: Ping worked on port just locked" > >> + > >> + if ! bridge fdb show | grep `mac_get $h1` | grep -q "locked"; then > >> + RET=1 > >> + retmsg="MAB: No locked fdb entry after ping on locked port" > >> + fi > > > > bridge fdb show | grep `mac_get $h1 | grep -q "locked" > > check_err $? "MAB: No locked fdb entry after ping on locked port" > > > >> + > >> + bridge fdb del `mac_get $h1` dev $swp1 master > >> + bridge fdb add `mac_get $h1` dev $swp1 master static > > > > bridge fdb replace `mac_get $h1` dev $swp1 master static > > > Unfortunately for some reason 'replace' does not work in several of the > tests, while when replaced with 'del+add', they work. Is it because the 'locked' flag is not removed following the replace? At least I don't see where it's handled in fdb_add_entry(). If so, please fix it and use "bridge fdb replace" in the test. > > >> + > >> + ping_do $h1 192.0.2.2 > >> + check_err $? "MAB: Ping did not work with fdb entry without locked flag" > >> + > >> + log_test "Locked port MAB" > > > > Clean up after the test to revert to initial state: > > > > bridge fdb del `mac_get $h1` dev $swp1 master > > bridge link set dev $swp1 locked off > > > > > >> +} > >> trap cleanup EXIT > >> > >> setup_prepare > >> -- > >> 2.30.2 > >>