Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp2970897rwd; Wed, 14 Jun 2023 09:29:35 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5f4+l6m4zQsDZvYrJ7pTHG1jOV5hVFSpXAys3Wu7WrDk4jSpQ+0lJuIO0zBXZaeYWj4p4Y X-Received: by 2002:a92:d6d2:0:b0:33e:7540:1bb0 with SMTP id z18-20020a92d6d2000000b0033e75401bb0mr12830421ilp.6.1686760174687; Wed, 14 Jun 2023 09:29:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686760174; cv=none; d=google.com; s=arc-20160816; b=PYLBL1yK9GU8GdP8dqjmMGWsISmSiddDA2aZVv38xJzXK7lFVWL3DFMAuKMsncnJT0 FMkZJlgpUzNX1uS7GsNcjxBYS1vvAo3EbMuBmNeLi5uQOBR/xk2YFjAc+1nDHc5BwA6S cCm54PiLeOB7r2NmAR4wCjXemYUYFVi855Yj3i34MzBXSXxkXCPoQwWOqgDJcSnQBycH SJZP6ZbeU1KyImdqIUX8o6oP7TG3nLXzjVaKDo26+uvaJuFJ2duRIz1rb0WZzh5Jndc6 GmnYBqgsm0InhaSkv22OjYEotM3wZMdjMELdKln1M8G/lrF5xCn3HdYLjOpMjIT4dP4H lX5A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=WJOUBggKTUhKb3poWoSgAvRIqN7AJm8eTebSFv89DwQ=; b=qRPfHuIvzGU52+HKEkVbGK6hVG4JpC21l0ZHYdGgp3bpWlHxMtWrR052uSWS/twAi6 eBaqMpI6SDzIZjwBZVDRXtq+SmHkBDLioCTF6L2osumv6eD35FXl+WdD9gcIVwNF9vH8 L7W5NkTeo6DpDkP28GpX4rIOR5MKn50b1e/ZlqmLphz984SEpg/6VzGF/0MD6IKVrykb 0unA0dnbNUtZLUtCGrQYRTRkbJCKVDFx97qM5D815c84ZcvwDazKGD3F5+NdLoU/5i3I CjMQCKRqNyubc28JF1u/e+fVO4yCuHAk+NimTOG7nUHln6j/vYSFb4GhWWL+iRYvViz9 UlCg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="oSYDBXh/"; 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=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k189-20020a636fc6000000b00543e355adb3si11011564pgc.275.2023.06.14.09.29.21; Wed, 14 Jun 2023 09:29:34 -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=@kernel.org header.s=k20201202 header.b="oSYDBXh/"; 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=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245376AbjFNQB7 (ORCPT + 99 others); Wed, 14 Jun 2023 12:01:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54526 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236871AbjFNQBu (ORCPT ); Wed, 14 Jun 2023 12:01:50 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 916C42116 for ; Wed, 14 Jun 2023 09:01:30 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 23C9D64410 for ; Wed, 14 Jun 2023 16:01:29 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 09CCAC433C0; Wed, 14 Jun 2023 16:01:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1686758488; bh=c/w30hWZPq7B/xF67XMBljxlZ1LiFXkgssX8UYL4sVU=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=oSYDBXh/T+vZ89y12Y2Ui0TIGUC+XmnpqzCftxHWAsrc1igZbdGpK2Cmfkfsd3SOm 04sXTBbwJwKI8TWMpjEp2+93uGQ+STTU7g9riaCKjA+lyQKcLwn8LcEsidVhBKG+0v hGGVf3q/HVZZE6w9EO3G3qij2XSNRJon6zNcm0NuycxURdV65WtJldVZms9AvW/RGg iRqh+23gxW5LdD8y80nUJe9hW8VG1kkU1UyPzPHgGXIsC4Er0jWD1LKqMMKai7jE9e 5hzR8h11oofrPEwINz3t5QuAsuRHnY6w/dZ0fotIw2YT93OmaTC3NFrLqVMLhWGtZB ITfJdFhpBXyYg== Date: Wed, 14 Jun 2023 09:01:26 -0700 From: Jakub Kicinski To: Sabrina Dubroca Cc: Fedor Pchelkin , "David S. Miller" , Eric Dumazet , Paolo Abeni , Raed Salem , Lior Nahmanson , Saeed Mahameed , Hannes Frederic Sowa , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Alexey Khoroshilov , lvc-project@linuxtesting.org Subject: Re: [PATCH] net: macsec: fix double free of percpu stats Message-ID: <20230614090126.149049b1@kernel.org> In-Reply-To: References: <20230613192220.159407-1-pchelkin@ispras.ru> <20230613200150.361bc462@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, 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 Wed, 14 Jun 2023 14:26:14 +0200 Sabrina Dubroca wrote: > > What prevents the device from being opened and used before > > macsec_add_dev() has finished? I think we need a fix which > > would move this code before register_netdev(), instead :( > > Can the device be opened in parallel? We're under rtnl here. > > If we want to move that code, then we'll also have to move the > eth_hw_addr_inherit call that's currently in macsec's ndo_init: in > case the user didn't give an SCI, we have to make it up based on the > device's mac address (dev_to_sci(dev, ...)), whether it's set by the > user or inherited. I can't remember if I had a good reason to put the > inherit in ndo_init. Ah, you're right, this is a link creation path. -- pw-bot: ur