Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp441773iog; Mon, 13 Jun 2022 06:05:21 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxiH9O/KXz4V/nbf6JIEpPw5hoJR+LHNlQIvWqryJ38EV0RvaShSKbDGpJl+l49YD2MANTV X-Received: by 2002:a17:90b:4c0f:b0:1e6:9e44:edcb with SMTP id na15-20020a17090b4c0f00b001e69e44edcbmr16146854pjb.2.1655125521177; Mon, 13 Jun 2022 06:05:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655125521; cv=none; d=google.com; s=arc-20160816; b=rSShsFsqX8MJ8sPmF6uEXJx/A/vgGBqorMyHAVZWS6DoB1gUWHARvVlZGBvOpH9t0S lluUV4BCTG/5peBBWfWMVJ2SBY9ydqKk86EqU+ITTp0rKA+1YNsQK80qS63v9VX6BBd1 gO5+bnu0ztasvLUgKpxrwtzNDt3LwGcV6r+xJiGkgvpJbdOrkz6nCpDDib6mEl8B3QWU Z3EMuMRmmYB98tQ1WcErd1XooAdSD4YNUm5MQmDWx73rsVZbUQR0y+qaIZ4Z2g8SS+yy TnsP6u/0rLzX0rD1T++difF8RCtOWqejX5DgfS9fKOn+wjUWjJXnHIdD4p8Pa9NXjd/R xNiQ== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=mqeAxa3khBTb4Hi3wpCk9/nV7CmDffmLkGRaJ+t7flM=; b=KxP3ZmeQ+kgWcuOC8br+Vu42H/PR5y9M0VH+cR0+P76OLcKW/cUm3+RzEZoqmDa3JU eUElwHHHBHWCCLNSxbP6LEkPyLMaLqgDW9tBzwW94UGQBLD6tGVrKEieOhpMbRarg9Gq j6b0ezUHzBRktTGEhm7U2YxjN3V8qIOE1S7pjMR6CWhLdv9utWfeWQ/E8MQepXlbOeqF O2creTyvwbzyUIFUdvgSIrIeLQIQfFc1o1E4l1Vcavw9E6tWMix7WeLS75ka/DJSy05R sm3cF/k7n6k13NIoojhIn5xwD5DNFypZ18RlJF8YMwUWVB/jKsRzcO0OFQEv+NeGXp+t 1kIQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="R6O/Fxl3"; 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=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f10-20020a056a001aca00b00505b7215af5si9666530pfv.149.2022.06.13.06.05.04; Mon, 13 Jun 2022 06:05:21 -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=@linuxfoundation.org header.s=korg header.b="R6O/Fxl3"; 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=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1356121AbiFMLnr (ORCPT + 99 others); Mon, 13 Jun 2022 07:43:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50708 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1355571AbiFMLjQ (ORCPT ); Mon, 13 Jun 2022 07:39:16 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9FF3A2C121; Mon, 13 Jun 2022 03:48:53 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 5F5D3B80E07; Mon, 13 Jun 2022 10:48:52 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id BEFAFC34114; Mon, 13 Jun 2022 10:48:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1655117331; bh=8sCdvYQ1+2gvup1lrj5dUg4mvoQeyApHc9ZBhju4e1E=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=R6O/Fxl3LqLnD/LtbiGI1Vooa3wi/F7lDCiylsOZNTViVFKQeWj0NiPA34zEvxiE+ UF32iW6tDppSlf2VG5TNAx79SQ8KnIQsEAJEXbyH7bk3xbAcFFDHVPsuBP0np8NDnn 61aBlVUIjwgbqRH/swPOW77uhyzZhi/qGR/0t9+E= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Stephen Rothwell , Masahiro Yamada , Florian Fainelli , "Russell King (Oracle)" , Jakub Kicinski , Sasha Levin Subject: [PATCH 5.4 357/411] net: mdio: unexport __init-annotated mdio_bus_init() Date: Mon, 13 Jun 2022 12:10:30 +0200 Message-Id: <20220613094939.401437878@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220613094928.482772422@linuxfoundation.org> References: <20220613094928.482772422@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-8.3 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 From: Masahiro Yamada [ Upstream commit 35b42dce619701f1300fb8498dae82c9bb1f0263 ] 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 Reviewed-by: Florian Fainelli Reviewed-by: Russell King (Oracle) Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin --- 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 b0a439248ff6..05c24db507a2 100644 --- a/drivers/net/phy/mdio_bus.c +++ b/drivers/net/phy/mdio_bus.c @@ -753,7 +753,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.35.1