Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp443841iog; Mon, 13 Jun 2022 06:07:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxCHvJ42Pd4ZvuVkRa/b6zEWFdf+FdpkhRbAnWyMGhlhZnb5o7x1M322+WhCywLTNfzbyKM X-Received: by 2002:a17:906:6a0c:b0:711:d9d9:45ce with SMTP id qw12-20020a1709066a0c00b00711d9d945cemr33008596ejc.184.1655125625132; Mon, 13 Jun 2022 06:07:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655125625; cv=none; d=google.com; s=arc-20160816; b=BMsyRClXFSOHBO4WntH6JMziC9FZA9jR7R7B7L9pM2zAIbNBMXy/iVFMQl8Nm6AyOk 78gTH+NRqqP2kse6/x7H/54vhQTTMNZKYIcDKDGNaC75Whu3BBtgYLGA2UrQ2CxE0bvQ +a2YaMHjKC2HTVA13QcsKPKL4CaZnlEScd5yB3thXBBZi6IYboXdRb67F7HhUXjN7ZwI Q1AqbzT7mOihE3rVb5OPGpZSplTu8BiUofmb7na6T3SCCynmQ1ZAwY4UgagtRq6QjvIk x1YVxRiw9fP8aklLCD85XVrAIz2WEvGzWR89S4+NzpAFZxW7/B4v+FvxQ6c3yf4Iqcr5 LiKw== 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=sVOy+w6xoOALUIRrpApJPHIhkB+zb81Dr7/ovrxFy6E=; b=JBuX7lXVjmZRRmiT4ydAeOCr0iIa+iav1uJrwagJW/s6H36e6Dx38wqXMVwVqpwkby uxrn3cZY8vczEMyx/O5O3PyZzcN9jiVJKdaNAjJ1CT6KohiDvwFIv+5tYgNcjoIYA4KN AfwSGbrADsXRPOp71tCUM1MHA/rDtwnQjHgOrV0dlUUS/JqLL5F1FehZpaiAnSMJON0b SK6BgnxObUJvhVtXyGN51A1O61ocDeCtNPzQc8MNtLJh1wN3ln58/TbLFNERKMS7dgxs u1nhYerxWzO/ip6gPOgbv7ulswe20v5yhtLcbMRyaqDn2VJ3y8t7GQYN8+8vrqAPILWL GoFA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=vsPmn3ci; 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 i4-20020a05640242c400b004313584a817si9333345edc.611.2022.06.13.06.06.38; Mon, 13 Jun 2022 06:07:05 -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=vsPmn3ci; 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 S1351930AbiFMLIu (ORCPT + 99 others); Mon, 13 Jun 2022 07:08:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60674 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1351508AbiFMLEP (ORCPT ); Mon, 13 Jun 2022 07:04:15 -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 995AC32050; Mon, 13 Jun 2022 03:33:36 -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 8808261018; Mon, 13 Jun 2022 10:33:35 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 928B0C34114; Mon, 13 Jun 2022 10:33:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1655116415; bh=H8Z+ndZuiGxGxR4N1ftinv1o4dhPyZWHaycrC3/83p0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=vsPmn3ci1EAYC1Rz/dDJlDVlzyG0KOlHMNUp8BNQH/qCyX9vb3IrXOy7aXsm1BOnI R0oqTrZ6cayd/4kD1n8UhYffFES2QiTVD/SOubsa4i/BcCwdNi/8OA8ufRQFG+jp7V t0o1dh9SBS/HdIMbLWFlS+eRuLW8gRj30LatqoQs= 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.14 176/218] net: mdio: unexport __init-annotated mdio_bus_init() Date: Mon, 13 Jun 2022 12:10:34 +0200 Message-Id: <20220613094925.944494019@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220613094908.257446132@linuxfoundation.org> References: <20220613094908.257446132@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 7b9480ce21a2..2911648d4669 100644 --- a/drivers/net/phy/mdio_bus.c +++ b/drivers/net/phy/mdio_bus.c @@ -716,7 +716,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