Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp1617000pxp; Thu, 17 Mar 2022 12:49:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzRxFvBDuz/NM/VqRAGtspZKuGs5gRhZ43hkK4RBCqgjGSHUQrJX2Hyu8e5QqU8hTt38VJb X-Received: by 2002:a17:902:c745:b0:151:e8fa:629b with SMTP id q5-20020a170902c74500b00151e8fa629bmr7017840plq.90.1647546565619; Thu, 17 Mar 2022 12:49:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1647546565; cv=none; d=google.com; s=arc-20160816; b=Wii1wIAw4RFeAGdaGnGsWsSKxT7Bih5CBLg2nkmX7lYhvHsUIpiblqdTRU1bQqNXi4 HFvDA59MR0jEQYeeE62EQV0HO3BTOCTtV3MHaupL+h8ENPuKOtZRKZd30FFa860ob2Tm c+IjkgbQXQmuAvNQJ5l0N5ZD055xKyLxBeOYFb5O2FTdIN9OvmTWh7Nhl8FflIDh9rsA i5iI/U1mV+e3N5PMxRfhpav2SW4NO5fDQfmOFquuT1p6r5pDFVn8DQUmrfYyC0kVSsp4 H/Pt6l3qmtmMKMATnLF/Z9nNcniJUBWauaEaR/oAdN5qsV1cAlzbPJiCLavU6DweVp+N NzrA== 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=jWX0ErRmdHl2MMr3l9xYOPX3cELcq3q9BO5puqjFVX8=; b=cj9uxE/G5gqk8A6QeTYiRMW9PgpYCLAGzTPbzPBTuO/ZopXZRaBdWDhRYAXP36uyjC i7pOIf78/0ATWw/doryEvO0bTzJb62BJd89F3m6jTIYKx4CuSmNTQx/kwXEssQA5QKrW WsmnFm76aVCYPcl99fAa9Ida4HqSOBFjmt6vsup035agdQjml6C8fnDuYf0+VSuGOnTf W/CHEZq5rRzPxZ1ybM8+B6n0XX//ym38zvETip1JouDvKWxbEUcUByjZhLZyJYpoqaEQ Lx1YACk8oWtQ71Vvg4yZxWeJ0XS6frbDj1O3W1TvRCiv34YqOQyZikT5kI/X8+t9DVZO 1LFQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=rwgF0iK7; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id a38-20020a056a001d2600b004f7285d54fesi5990088pfx.316.2022.03.17.12.49.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 17 Mar 2022 12:49:25 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=rwgF0iK7; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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 6E1BA2597FF; Thu, 17 Mar 2022 12:47:44 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235016AbiCQOVU (ORCPT + 99 others); Thu, 17 Mar 2022 10:21:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40832 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235002AbiCQOVT (ORCPT ); Thu, 17 Mar 2022 10:21:19 -0400 Received: from vps0.lunn.ch (vps0.lunn.ch [185.16.172.187]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 940E1169B0E; Thu, 17 Mar 2022 07:20:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lunn.ch; s=20171124; h=In-Reply-To:Content-Disposition:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:From:Sender:Reply-To:Subject: Date:Message-ID:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:Content-Disposition:In-Reply-To:References; bh=jWX0ErRmdHl2MMr3l9xYOPX3cELcq3q9BO5puqjFVX8=; b=rwgF0iK79Q1WES0TwTF6Ir0PLT ZAX1ts7rE4L6FXuSKGFW/iMq3a/kmMpKhRBLRIO8lbMI16pgg+qwNyy5P3rWfM8+zFDH3HL1hE1uB BqidmqRKl250oRAnoskdS4eeJbusyXueReOuCmq1m48tLaxWG1KIxLCpg+0Ve1PuwCyw=; Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2) (envelope-from ) id 1nUqyg-00BQGd-35; Thu, 17 Mar 2022 15:19:46 +0100 Date: Thu, 17 Mar 2022 15:19:46 +0100 From: Andrew Lunn To: Hans Schultz Cc: Vladimir Oltean , davem@davemloft.net, kuba@kernel.org, netdev@vger.kernel.org, Vivien Didelot , Florian Fainelli , Jiri Pirko , Ivan Vecera , Roopa Prabhu , Nikolay Aleksandrov , Daniel Borkmann , Ido Schimmel , linux-kernel@vger.kernel.org, bridge@lists.linux-foundation.org Subject: Re: [PATCH net-next 3/3] net: dsa: mv88e6xxx: mac-auth/MAB implementation Message-ID: References: <20220310142320.611738-1-schultz.hans+netdev@gmail.com> <20220310142320.611738-4-schultz.hans+netdev@gmail.com> <20220310142836.m5onuelv4jej5gvs@skbuf> <86r17495gk.fsf@gmail.com> <20220316233447.kwyirxckgancdqmh@skbuf> <86lex9hsg0.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <86lex9hsg0.fsf@gmail.com> X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,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 Thu, Mar 17, 2022 at 09:52:15AM +0100, Hans Schultz wrote: > On tor, mar 17, 2022 at 01:34, Vladimir Oltean wrote: > > On Mon, Mar 14, 2022 at 11:46:51AM +0100, Hans Schultz wrote: > >> >> @@ -396,6 +414,13 @@ static irqreturn_t mv88e6xxx_g1_atu_prob_irq_thread_fn(int irq, void *dev_id) > >> >> "ATU miss violation for %pM portvec %x spid %d\n", > >> >> entry.mac, entry.portvec, spid); > >> >> chip->ports[spid].atu_miss_violation++; > >> >> + if (mv88e6xxx_port_is_locked(chip, chip->ports[spid].port)) > >> >> + err = mv88e6xxx_switchdev_handle_atu_miss_violation(chip, > >> >> + chip->ports[spid].port, > >> >> + &entry, > >> >> + fid); > >> > > >> > Do we want to suppress the ATU miss violation warnings if we're going to > >> > notify the bridge, or is it better to keep them for some reason? > >> > My logic is that they're part of normal operation, so suppressing makes > >> > sense. > >> > > >> > >> I have been seeing many ATU member violations after the miss violation is > >> handled (using ping), and I think it could be considered to suppress the ATU member > >> violations interrupts by setting the IgnoreWrongData bit for the > >> port (sect 4.4.7). This would be something to do whenever a port is set in locked mode? > > > > So the first packet with a given MAC SA triggers an ATU miss violation > > interrupt. > > > > You program that MAC SA into the ATU with a destination port mask of all > > zeroes. This suppresses further ATU miss interrupts for this MAC SA, but > > now generates ATU member violations, because the MAC SA _is_ present in > > the ATU, but not towards the expected port (in fact, towards _no_ port). > > > > Especially if user space decides it doesn't want to authorize this MAC > > SA, it really becomes a problem because this is now a vector for denial > > of service, with every packet triggering an ATU member violation > > interrupt. > > > > So your suggestion is to set the IgnoreWrongData bit on locked ports, > > and this will suppress the actual member violation interrupts for > > traffic coming from these ports. > > > > So if the user decides to unplug a previously authorized printer from > > switch port 1 and move it to port 2, how is this handled? If there isn't > > a mechanism in place to delete the locked FDB entry when the printer > > goes away, then by setting IgnoreWrongData you're effectively also > > suppressing migration notifications. > > I don't think such a scenario is so realistic, as changing port is not > just something done casually, besides port 2 then must also be a locked > port to have the same policy. I think it is very realistic. It is also something which does not work is going to cause a lot of confusion. People will blame the printer, when in fact they should be blaming the switch. They will be rebooting the printer, when in fact, they need to reboot the switch etc. I expect there is a way to cleanly support this, you just need to figure it out. > The other aspect is that the user space daemon that authorizes catches > the fdb add entry events and checks if it is a locked entry. So it will > be up to said daemon to decide the policy, like remove the fdb entry > after a timeout. > > > > > Oh, btw, my question was: could you consider suppressing the _prints_ on > > an ATU miss violation on a locked port? > > As there will only be such on the first packet, I think it should be > logged and those prints serve that purpose, so I think it is best to > keep the print. > If in the future some tests or other can argue for suppressing the > prints, it is an easy thing to do. Please use a traffic generator and try to DOS one of your own switches. Can you? Andrew