Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp591765iog; Mon, 13 Jun 2022 08:45:13 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxi0qwsdNBLGEscUmURBqUZg5gw20i1D3rzfKZAagP4U38FVNvVL0R9LbUX50S6wGXZFs9k X-Received: by 2002:a05:6402:2999:b0:434:edcc:f12c with SMTP id eq25-20020a056402299900b00434edccf12cmr409162edb.96.1655135113132; Mon, 13 Jun 2022 08:45:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655135113; cv=none; d=google.com; s=arc-20160816; b=I+1FRHbS2ygpjLivX4uA33rCwiE0NN2p31pYM++AeRnzSc0OV+IBx/l9Nk3+roZXI5 pgqYiEvhNcMSmxf/pQA5Bq6DFzAD6laFtSADuZJd+duZLG8Hkw2wSwDlWVG1mqD8u1lE YG0DI2r2pOaxq7I3afaHijZNUrvW2fN8IZS/iJSfCl9ZD+Y2454rj/t/RTSa1WWcdEV1 hnM6vlmRDHnylXN6wTHqOqjaBILeEP9KtHAzuyXy839kIY9J6gsuWPvLpjOl90TJ5OLx VEIrEejwK2/o4t0lQzBej4ZqXiooo1VFzB4JR31zAAHjxPJSM2OkGmXLyYRboPok0GnO jEug== 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=eempXQ2NePUJ6/RlBE4agVHUw6miChcIcdSl3uG+a6c=; b=Eo2ZVjv6A1rUEerKlvuNefFdS+vGrscHGT+JaN8jfviyq+vwiaIkCj6s1NFVAbHvnI KGiinq0z7OEohDDY0gnWCiNOyoSwOUCOhdSDZDkij8iL6j9ZXQJrm6Z2BnBjTwBJqyJQ E1+mO7z0MLxELAIT/W9taBcZiCPw9eBgvjuDEy2t4nfX8tVnml7f/mHIbXU/+tiRbPcA FcjSzy8m6f7YyE/YNkFQF3L9CY3m9Rpp3NR26u0GcHf/1U61+iEhZ9wjXXflzDG3ZG73 WTXysuVGHF/W55QMF/iQmQ1v5ph5/MdX3WBWYB7ehQlor2MJHRaQpAsfosD1QYloJHam 9chQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=j6l4LxzH; 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 hp8-20020a1709073e0800b00701eb604fffsi8641080ejc.5.2022.06.13.08.44.48; Mon, 13 Jun 2022 08:45:13 -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=j6l4LxzH; 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 S1351957AbiFMMQx (ORCPT + 99 others); Mon, 13 Jun 2022 08:16:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48140 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1357499AbiFMMOA (ORCPT ); Mon, 13 Jun 2022 08:14:00 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C62B554194; Mon, 13 Jun 2022 04:01:34 -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 dfw.source.kernel.org (Postfix) with ESMTPS id 0994061445; Mon, 13 Jun 2022 11:01:34 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 136D3C34114; Mon, 13 Jun 2022 11:01:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1655118093; bh=wBTgbzAlBHnpwemiBc67jc18++WoUd+7ldSlE8d/NmQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=j6l4LxzHbJDqiPUXDj6QAaEoTCQLijK644BEBLtq50UUeBYCBEL30fDrar/vcxHIk 6dTCVem3n7sguKBk7fyXBx1EBb4T/HeM7jewQbmSTnqkMS1UWBBlgmZxNdRws66B2j NXenA92eu0UV/vI8qHiwm6OtFllMYaxsWd4b4quk= 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 4.19 241/287] net: mdio: unexport __init-annotated mdio_bus_init() Date: Mon, 13 Jun 2022 12:11:05 +0200 Message-Id: <20220613094931.323838550@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220613094923.832156175@linuxfoundation.org> References: <20220613094923.832156175@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 eaa890a6a5d2..efdac68da7f4 100644 --- a/drivers/net/phy/mdio_bus.c +++ b/drivers/net/phy/mdio_bus.c @@ -746,7 +746,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