Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp135303iof; Sun, 5 Jun 2022 23:25:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwL6zr9UhD+y0TQAOoea11hyT/3DOt7qSpf4dKOu+e4+dn+SBhhqTomVzjMPhjI3taB8IhS X-Received: by 2002:a17:903:215:b0:15e:cae9:7622 with SMTP id r21-20020a170903021500b0015ecae97622mr22947631plh.28.1654496718070; Sun, 05 Jun 2022 23:25:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654496718; cv=none; d=google.com; s=arc-20160816; b=WezkncbG7Ka/UOTvFXWQ1GPP+TktDMOC/YXD/1LVGwxMKr1wSn+b7em2wgBixVK/w1 EUg6muHU4XmAyKy5gcnRfgmnzVWWf1g/o+rZrUOzSTAqVjpuDkLYNyzQfEEAXuAMxmm7 oEgk5l49w2dEsaQmHIfoBq4Br+HWukjEYtcsjwEmMZ78XnhO6AR/lzIQjfMDmAwIsYOd plG7GmIbJgTBE1NFe3+o3OaM/C7m67lairMUUKgj4I52ff8mOpH/dqHWD/5dre4S2A7r GcwwvQhQM/HWbWi2xGwcZ+a2k1soVjju4MinqALBc4a7wfQ0iPkaBR+FMh9Nz6tZ5h2d xW1w== 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:date:subject:cc:to:from :dkim-signature:dkim-filter; bh=isf+a5aQ1y4P6QoSWZORn/o1CmARhw+dCDmlwB5MUhE=; b=AAKI5mOtLaJEJy+ODvrM4qy418CetzcDa6BqScAnG0ZISW/6Zd+vY/GurtfUe2k3Rt tHDV/MP/K3lLb7Gin2If6wDvdVUXY6fqEdwPlQ9zAu7T/cflxTakbZvQI/HYPVYdkEMf UNzFkgTNkiaVeShJXORRnXHG52NEF5UenufpJU+0lJHW3r1z9Vb8ZMSNQjkEgMeIoFnv 6IUb88xeKfsazAF75glBT/PAOySfQFR5ueBppVWbPzh0d2mYssp7cMqIgiNQbqEBus2w Canogi2BZ2a9sueo3/szKbqEnb7aJD7Y9LihlgMicenHbsUK63F2ZvVK4g813rvVwyDV J9/w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b="m/5LLpef"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id p11-20020a654bcb000000b003c281e1fd7csi20088211pgr.214.2022.06.05.23.25.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 05 Jun 2022 23:25:18 -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=@nifty.com header.s=dec2015msa header.b="m/5LLpef"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 564A9ED8C5; Sun, 5 Jun 2022 22:27:26 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229607AbiFFF1S (ORCPT + 99 others); Mon, 6 Jun 2022 01:27:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46310 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229628AbiFFF1L (ORCPT ); Mon, 6 Jun 2022 01:27:11 -0400 X-Greylist: delayed 83 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Sun, 05 Jun 2022 22:04:29 PDT Received: from condef-04.nifty.com (condef-04.nifty.com [202.248.20.69]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 205BD762BF; Sun, 5 Jun 2022 22:04:28 -0700 (PDT) Received: from conuserg-10.nifty.com ([10.126.8.73])by condef-04.nifty.com with ESMTP id 2564uAao012761; Mon, 6 Jun 2022 13:56:30 +0900 Received: from grover.sesame (133-32-177-133.west.xps.vectant.ne.jp [133.32.177.133]) (authenticated) by conuserg-10.nifty.com with ESMTP id 2564rxU9026256; Mon, 6 Jun 2022 13:54:01 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-10.nifty.com 2564rxU9026256 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1654491242; bh=isf+a5aQ1y4P6QoSWZORn/o1CmARhw+dCDmlwB5MUhE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=m/5LLpefrhB6ls7uUg5UnXmoqagKwB+mQiCQosf9QYbV5pNhS1Gd1Sid/GZWZxGLT vh+oA2onkm3RC6YMqE3CsQ8vU4ilcfWTvMf+W4U6MREze7eLHqRMoh6YXohU9IK6AF 0MHHFHQp0/1b54orxyALK6PMWmzo7jmkHdzFyvRaoAt7lOl6MzELTGlz4ZEgNSGfyL Mdwk4FJ1DCJ3j+fDouhxxcTvseXTgSBGHRJI9lTKmubL8WuSYLBJyGXAmCzHn5itxu pFmcu1h6/DfltJzelsuyJyJPDl+AdHL6bB+h3w00TFPKE6MUtu1qBA5+bkUc6aDn3Y pdafOyHgLu56w== X-Nifty-SrcIP: [133.32.177.133] From: Masahiro Yamada To: "David S . Miller" , Jakub Kicinski , netdev@vger.kernel.org Cc: Eric Dumazet , Paolo Abeni , Masahiro Yamada , Stephen Rothwell , Andrew Lunn , Florian Fainelli , Heiner Kallweit , Russell King , linux-kernel@vger.kernel.org Subject: [PATCH 1/3] net: mdio: unexport __init-annotated mdio_bus_init() Date: Mon, 6 Jun 2022 13:53:53 +0900 Message-Id: <20220606045355.4160711-2-masahiroy@kernel.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220606045355.4160711-1-masahiroy@kernel.org> References: <20220606045355.4160711-1-masahiroy@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,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 EXPORT_SYMBOL and __init is a bad combination because the .init.text section is freed up after the initialization. Hence, modules cannot use symbols annotated __init. The access to a freed symbol may end up with kernel panic. modpost used to detect it, but it has been broken for a decade. Recently, I fixed modpost so it started to warn it again, then this showed up in linux-next builds. There are two ways to fix it: - Remove __init - Remove EXPORT_SYMBOL I chose the latter for this case because the only in-tree call-site, drivers/net/phy/phy_device.c is never compiled as modular. (CONFIG_PHYLIB is boolean) Fixes: 90eff9096c01 ("net: phy: Allow splitting MDIO bus/device support from PHYs") Reported-by: Stephen Rothwell Signed-off-by: Masahiro Yamada --- drivers/net/phy/mdio_bus.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/net/phy/mdio_bus.c b/drivers/net/phy/mdio_bus.c index 58d602985877..8a2dbe849866 100644 --- a/drivers/net/phy/mdio_bus.c +++ b/drivers/net/phy/mdio_bus.c @@ -1046,7 +1046,6 @@ int __init mdio_bus_init(void) return ret; } -EXPORT_SYMBOL_GPL(mdio_bus_init); #if IS_ENABLED(CONFIG_PHYLIB) void mdio_bus_exit(void) -- 2.32.0