Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp225831imw; Mon, 4 Jul 2022 08:08:27 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vYGWGseYJr3r7OwE8aCeM1kamufL+C73TREUAiEs9fSqlMv9WxDA75Htt9surVeFanNJIy X-Received: by 2002:aa7:d542:0:b0:43a:875:64d3 with SMTP id u2-20020aa7d542000000b0043a087564d3mr15250505edr.139.1656947307482; Mon, 04 Jul 2022 08:08:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656947307; cv=none; d=google.com; s=arc-20160816; b=nK+v0gWmtQRhD4+/QmrCwJjST7I5X0/bV7rAjoTKDer6k7W5h3QlOLDsSbypi95fdO 1rm/JsTJrL9bbGDXlIdjJco1nsLfwEPRHlRpbtSIv/sblnbtQsgB0d6xttcI2O/f8D0h ZpjSaldOvRHuIqNw/3FAYN1Xe2GbmtpZWsw6UPQzsxXMYGrnMDfbfE306iW8aJQxgxEX XbW0V4z7AvzS1mBUo1jgeu8HnQDf9dIg3NQGX/r8shlMm9jlj+5MqfDt/QzzvI47vczA KBm2llKMkq4/tIJYqNQ77O3rSeC2ofFezz/9+EET6j8J7evIosCrpX1eKs2uW9Uebic+ yqcg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=8FvyoCcZIIWT/+d0TYytTEN4tkuREx1whLnCxZohGlQ=; b=Zn9kiIYC3B9imCPH/u8WHld32XpMGLpLB8B93ETi6Sm4JHr0tMPuY9mzElghG7TDMN JR6RtEcWq3yVBlK7e6yWVK+0EZZcYDH/cZe+Isrzv3Az9S4rTpP/OAe/wqoJjmaCyEO3 gQNTs7+5o/8gpyLreLmTqiRUcz8aRcHNORMOVQkgiel2ZLcvBA4z6n7QREC/nq3vAwQr 9gCVJ9LQbDBwUnIMCDNPlBKRH83QBfosjnSLoNF6f9X424Cfcx2haGO0LFApio4U/2Z6 sWsV2oIuETtTwMu0iD2GOHLXktCICK1PhSBWlVWwMNCc32JO5InVque1RXrHiV+L4t+p f7Wg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=KHZG5UXy; 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 gm1-20020a1709073d0100b0072693a80bf2si14890168ejc.105.2022.07.04.08.07.59; Mon, 04 Jul 2022 08:08:27 -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=KHZG5UXy; 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 S233980AbiGDOg3 (ORCPT + 99 others); Mon, 4 Jul 2022 10:36:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36420 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234383AbiGDOg0 (ORCPT ); Mon, 4 Jul 2022 10:36:26 -0400 Received: from mail-wm1-x32b.google.com (mail-wm1-x32b.google.com [IPv6:2a00:1450:4864:20::32b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 89A47AE5A; Mon, 4 Jul 2022 07:36:25 -0700 (PDT) Received: by mail-wm1-x32b.google.com with SMTP id 205-20020a1c02d6000000b003a03567d5e9so7694905wmc.1; Mon, 04 Jul 2022 07:36:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=8FvyoCcZIIWT/+d0TYytTEN4tkuREx1whLnCxZohGlQ=; b=KHZG5UXy9v/MjhNrt3cHkM3YTmdVYJaL2BcNPKrJQaopiKoqiAyrqNgWY49OmWQyCL 7DC45L0lQS0jnG9b6KpwONbUHu7Vp0wjfNIctqYY10AJ2IOAocf+gUe8Edg3O3pyQ1Og VweJVuLEdPT50/6ORDjR5bhbKJGdZZInziAksmp1ZS1qZNrzdyTeWUBTJJg9AY8VAPwb CFAiwK21HXoBexPaEQtykodppTzSk4sjV2+CRP6ZzUXDDK0YsSnS244i7bMljTk4JYf8 eDn6nfn+TT8vWK1rsJPtM1dP1oPs5OyriPhBZ8SM/osUaOHwtijzHOT6r7pkRdsKgKyp xdVA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=8FvyoCcZIIWT/+d0TYytTEN4tkuREx1whLnCxZohGlQ=; b=tM4y6qmWH4aUh2AXtnfHRmfVehHMKrteOOggqE1Z52zPGgyC2FgwvS42BmR8Q0PPK4 Ug15apvADQDcVP8EJlgHYwfLvVqh3f7EKLDUNrVggkNTQxHJECd+bsuQd9DPSk+KmBRJ q+DJyrTGXRfA3p3N1lU54/OFzBtG3BvC0lOsZkaALJSiKtovY4NMQNJJ2TvBn2CFunTg rhs0easR3DdC5sOEp3wbFZRSoJTGCWjLnsasFleOXutkWxsmzTmDU0727thF0mfNGXMn Gd+efDy9X65I4tg2yTcmJZcK1DI2/m6HjNBunmO+hVisY5CRcz/sUR40oL0D9VWTRpI1 oIKQ== X-Gm-Message-State: AJIora9JFfps+q5ndXSEpVPa5nj3GzAE7jNm9rsnXCmsGgvM8W7RmB2G 3lh38psIicrz+UyhJ3HEjjXc8ZCbe87lfvuGKI4= X-Received: by 2002:a05:600c:386:b0:3a1:8cd8:fee4 with SMTP id w6-20020a05600c038600b003a18cd8fee4mr18584805wmd.44.1656945383975; Mon, 04 Jul 2022 07:36:23 -0700 (PDT) MIME-Version: 1.0 References: <20220630111634.610320-1-hans@kapio-technology.com> In-Reply-To: From: Hans S Date: Mon, 4 Jul 2022 16:36:12 +0200 Message-ID: Subject: Re: [PATCH net-next v1 1/1] net: bridge: ensure that link-local traffic cannot unlock a locked port To: Ido Schimmel Cc: "David S. Miller" , Jakub Kicinski , netdev@vger.kernel.org, Andrew Lunn , Vivien Didelot , Florian Fainelli , Vladimir Oltean , Eric Dumazet , Paolo Abeni , Jiri Pirko , Ivan Vecera , Roopa Prabhu , Nikolay Aleksandrov , Shuah Khan , Daniel Borkmann , Hans Schultz , linux-kernel@vger.kernel.org, bridge@lists.linux-foundation.org, linux-kselftest@vger.kernel.org Content-Type: text/plain; charset="UTF-8" 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,T_SCC_BODY_TEXT_LINE 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 Mon, Jul 4, 2022 at 1:00 PM Ido Schimmel wrote: > > On Mon, Jul 04, 2022 at 09:54:31AM +0200, Hans S wrote: > > > > > > IIUC, with mv88e6xxx, when the port is locked and learning is disabled: > > > > > > 1. You do not get miss violation interrupts. Meaning, you can't report > > > 'locked' entries to the bridge driver. > > > > > > 2. You do not get aged-out interrupts. Meaning, you can't tell the > > > bridge driver to remove aged-out entries. > > > > > > My point is that this should happen regardless if learning is enabled on > > > the bridge driver or not. Just make sure it is always enabled in > > > mv88e6xxx when the port is locked. Learning in the bridge driver itself > > > can be off, thereby eliminating the need to disable learning from > > > link-local packets. > > > > So you suggest that we enable learning in the driver when locking the > > port and document that learning should be turned off from user space > > before locking the port? > > Yes. Ideally, the bridge driver would reject configurations where > learning is enabled and the port is locked, but it might be too late for > that. It would be good to add a note in the man page that learning > should be disabled when the port is locked to avoid "unlocking" the port > by accident. Well you cannot unlock the port by either enabling or disabling learning after the port is locked, but Mac-Auth and refreshing might not work. I clarify just so that no-one gets confused. I can do so that the driver returns -EINVAL if learning is on when locking the port, but that would of course only be for mv88e6xxx...