Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp4270261rwi; Sat, 22 Oct 2022 07:33:55 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6Xo6Zfts6d+nvNbY+zJQ++xzlyLo/y1kYQaOJkctIYHk1mAu/+8AjgvpdSxrB35jPWegYw X-Received: by 2002:a17:906:fd85:b0:77b:b538:6472 with SMTP id xa5-20020a170906fd8500b0077bb5386472mr19959775ejb.48.1666449225181; Sat, 22 Oct 2022 07:33:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666449225; cv=none; d=google.com; s=arc-20160816; b=z9ksAIf1JJAUUq71/VtvDOUHXMu473pA4aDtA6KX2xUlV4KbEfTnQspnmvtP4pS+91 55zyPWA+E+Qf2T4sqUoGp/BUrULHdJXV5GHVo7mq4DHGwlXAiqUJ186qABLJcHAoHhB4 VeBTW7jiNR9p2W+MstAE121cAYi9CyKXfOmZn2qUNi69ugPF2MIuPaxHDssYN8x9I0Bu S29tC59jf83sLn4YcvnB9Duceg7CGA0qtMxbY6xEFl+hAT0YD88da99+zj+z8h+FRmBI uTbZIcFXpPjisXHQpViMf7rVhaXw8cLVyBuRjhdtDEAyI0cMltr4Qo+GsdVZC/ely89G Pe6g== 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=ONqnfeRbIJEBHcDA0JYek+JtscZ4zltaVyYcDCSC9kw=; b=YRrEBH2+mHKOYGr6c8jO8FHXxE8bfqEwxLHdB+RiWfqGab4gDTWKvJOQQM45kLI7yI EVM5iXPhNAJNBMeyZhr1i1r/K4lZ8OE5/5jzhIS2pwgya4rLUp/WYxNr4Tn2JjYLRyBg MPYKwzwR93D1U/HVkH0oBwgFhXK4wE8bsJ9wfP0yvxLA15iWI5HONmLhoyypNSAS7Q2Q QkuUh6qs6Sh6NwQ3L8Faqvp+10TRcL0FyIS7siYoslXOj/BjkcdATTkuT/GSlPRmjdka Lf02jnINRuIRzXSluO8jv8BqrZFLVYVVqqNBBAjG50V4mL7csgdpWyFrG3PnPmiZZE5r vhXA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=fYrsxTBT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id mp34-20020a1709071b2200b0078c6abf19bfsi20796192ejc.948.2022.10.22.07.33.19; Sat, 22 Oct 2022 07:33:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=fYrsxTBT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229744AbiJVNjr (ORCPT + 99 others); Sat, 22 Oct 2022 09:39:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49700 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229635AbiJVNjq (ORCPT ); Sat, 22 Oct 2022 09:39:46 -0400 Received: from mail-ed1-x52d.google.com (mail-ed1-x52d.google.com [IPv6:2a00:1450:4864:20::52d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CD3924D142; Sat, 22 Oct 2022 06:39:43 -0700 (PDT) Received: by mail-ed1-x52d.google.com with SMTP id b12so15610983edd.6; Sat, 22 Oct 2022 06:39:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=ONqnfeRbIJEBHcDA0JYek+JtscZ4zltaVyYcDCSC9kw=; b=fYrsxTBTWLXveezVAf3JTB5d1JyTHlrtLy9F2w+mCV3f9qlz4zaL6/KTHWUm9h/MaY ml7uAqQR7ELdaNdsh8CMrwhkVd2tVPYE6NutMYTX5/DbWGpLIxzkGkwQSfEL4IC7b+G4 SvKMOXuG4rl0pJDR4qXG1aNtEM7afgMx4jmNbEo+5o9nOmH71LDVrrweaDE4lN27Mxe8 /AmFI8FeeE1TTg2SGAzP6qrDDqejZXUWcSIds86ZMkEQdpwzyg2K4Cc+kMUIjGkGfFDi 1gKAAyMnObim1Vzp8cBs3o667dOJYCsuMtSoeelmb9050ZwCvcYPWWS/k6FIBTPH1qSY doEg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=ONqnfeRbIJEBHcDA0JYek+JtscZ4zltaVyYcDCSC9kw=; b=kfpwaNXwHCjYuttEsY1rleSoy2AcrWGtmhUtsvqPkg3HWIVLueY99Kc03MU6dvWT4P YUvPMvoeNvE+4ORgZJAmrBSGRATk92vbqHL+EOKbNiyzgkaFEN8Pdhr4syF7XxdKSd7Z kyqi15mKWXavEeJhK5Q4A9Gvj2Zub1GQtxoEGQLtph3gfCE/VFSaUJEq4emKiW3uHFgx aOMfbAmwS4CKC0gnTedv9US6kBppPAQg7EqzzKnp5pvaIUd1IhcGyGJt3f+ihTyvA8uT CUg4dDUZyk+84UYgC6melTYyRxQeazXzgCBXsG7gVsvvGOQCxnSCs09NMK/hgFrDRhB8 hX2g== X-Gm-Message-State: ACrzQf2p6hCm4Vecq9mOy9+tt+JBTHNCupJgpgp39cdFxKsFt4yIAuWW mTc67ifRAYx5Lw9tjZDyg6c= X-Received: by 2002:a05:6402:144a:b0:461:8e34:d07b with SMTP id d10-20020a056402144a00b004618e34d07bmr1085496edx.426.1666445982163; Sat, 22 Oct 2022 06:39:42 -0700 (PDT) Received: from skbuf ([188.27.184.197]) by smtp.gmail.com with ESMTPSA id q11-20020a17090676cb00b0074150f51d86sm13083352ejn.162.2022.10.22.06.39.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 22 Oct 2022 06:39:41 -0700 (PDT) Date: Sat, 22 Oct 2022 16:39:37 +0300 From: Vladimir Oltean To: Oleksandr Mazur Cc: "netdev@kapio-technology.com" , "davem@davemloft.net" , "kuba@kernel.org" , "netdev@vger.kernel.org" , Florian Fainelli , Andrew Lunn , Vivien Didelot , Eric Dumazet , Paolo Abeni , Kurt Kanzenbach , Hauke Mehrtens , Woojung Huh , "UNGLinuxDriver@microchip.com" , Sean Wang , Landen Chao , DENG Qingfang , Matthias Brugger , Claudiu Manoil , Alexandre Belloni , Jiri Pirko , Ivan Vecera , Roopa Prabhu , Nikolay Aleksandrov , Shuah Khan , Russell King , Christian Marangi , Daniel Borkmann , Yuwei Wang , Petr Machata , Ido Schimmel , Florent Fourcot , Hans Schultz , Joachim Wiberg , Amit Cohen , "linux-kernel@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , "linux-mediatek@lists.infradead.org" , "bridge@lists.linux-foundation.org" , "linux-kselftest@vger.kernel.org" Subject: Re: [PATCH v8 net-next 10/12] net: dsa: mv88e6xxx: mac-auth/MAB implementation Message-ID: <20221022133937.hfrr7sxaq2zlbnoq@skbuf> References: <20221021112216.6bw6sjrieh2znlti@skbuf> <7bfaae46b1913fe81654a4cd257d98b1@kapio-technology.com> <20221021163005.xljk2j3fkikr6uge@skbuf> <20221021173014.oit3qmpkrsjwzbgu@skbuf> <20221021181411.sv52q4yxr5r7urab@skbuf> <20221022113238.beo5zhufl2x645lf@skbuf> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham 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 Sat, Oct 22, 2022 at 12:55:14PM +0000, Oleksandr Mazur wrote: > > > I hope the following script will exemplify what I mean. > .. > Oh, i get it now. > > Frankly speaking we haven't stumbled across such scenario / issue > before. But i can tell it does indeed seems a bit broken; > > I think there are 2 options here: > 1. The setup itself seems insecure, and user should be aware of such behavior / issue; Be aware, and do what? Port locking is unfit for use if learning is left enabled (in the way learning is currently done). > 2. Bridge indeed should not learn MACs if BR_PORT_LOCKED is set. > E.g. learning condition should be something like: not BR_PORT_locked > and learning is on; Rather than violate the BR_LEARNING flag (have it set but do nothing, which would require even more checks in the fast path), I was proposing to not allow the BR_PORT_LOCKED | BR_LEARNING configuration at all. My question to you was if you're aware of any regression in prestera with such a change. > > I don't understand the last step. Why is the BR_PORT_LOCKED flag disabled? > > If disabled, the port will receive frames with any unknown MAC SA, > > not just the authorized ones. > > Sorry for the confusion. Basically, what i described what i would > expect from a daemon (e.g. daemon would disable LOCKED); So just > ignore that part. But still, why would the daemon disable BR_PORT_LOCKED once a station is authorized? You're describing a sample/test application, not a port security solution...