Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp597255iog; Mon, 13 Jun 2022 08:51:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzJPtTFRu+Qh+QlxZMvTlMYQ76pwit40Zq7XBx8epe4ihNn+6vNw8E1qTR5+HHy3Za27QCY X-Received: by 2002:a17:906:1f09:b0:70d:b470:1aaa with SMTP id w9-20020a1709061f0900b0070db4701aaamr453041ejj.758.1655135470417; Mon, 13 Jun 2022 08:51:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655135470; cv=none; d=google.com; s=arc-20160816; b=MQGjBgMyhNaa8xWZEQGEvgqI6w1EYSz1LpY6eXqRiFg3q15cC30Mnn15h0RhxQlRM9 hOvvKO4i5cPtdmvLAZwcnkWJO2GyAylBHsqwCr1JEyreftWIaEdjBdAcGzVNY0ZLPeJu lovtR1Szsj1ZuT/6/iuTCB6MAefjC8bRGvgP5MZxEtxU8IwvcJrPvJLSApX6FQK6ZpKi SwrGiGMjFiCCxDCQWgd9pqPS/gFiUlf4VCzaEAS+dVZB+cBrHrl8NUyIEv9a10t3d+hL 0HfAp3jmgKsyp2FlE5gjMikZe+reEI/XgFeZ/hDMCBhbrxFRO8skEKclrypwGS6R/E8p 5Stg== 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=DjlUNBnmE3X5eIlfZDxRtNLDsMa7OMEBSBlW3VsD8II=; b=qCRjDEmkEK7Pmzxo7JBiW9xpH0bbeNdHxkVUVt7B2tgIiwBGAz1WDLxoywmoTwPHWe Dvs2vi0fDpxbv1d1AqoIr0P6JQhv/BGvpdihykCnfpjRoDtAF2fYuwLvB8Bn30xQs7Qd gW42tGBRPLluHvYUpIRdENlvUuik+p1a717D2rtkG+SUpYl5tQgmqYOxAMpW077G14E4 yjXdk26b+VreS2iyHOWG16hZJOLJiNkw8wHrTax4bo+2ea+Zp9i/xF7k8LLCtkM+gblW btqezaX1gUAWoLIlvslyqYpqNBlFjGB37jWz+9XjhxnXAIH99sL5PHk0IGflJYyAF/AT BKXA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Tczd6rX8; 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 i6-20020a05640242c600b0042e1a7667f7si9982335edc.613.2022.06.13.08.50.45; Mon, 13 Jun 2022 08:51:10 -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=Tczd6rX8; 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 S1359505AbiFMNNi (ORCPT + 99 others); Mon, 13 Jun 2022 09:13:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38432 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1357054AbiFMNHQ (ORCPT ); Mon, 13 Jun 2022 09:07:16 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 218E938795; Mon, 13 Jun 2022 04:18:52 -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 0853960F18; Mon, 13 Jun 2022 11:18:51 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 11D22C34114; Mon, 13 Jun 2022 11:18:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1655119130; bh=VAb/NpOY428oAmU6JQGJpbkhTN2C2LxLd0vPS9M/mTg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Tczd6rX8OaYByjnRhWYX3JRfYTHu9UHobBUYaV9n001eLX3ZR++Trd6r0rLPhb3hC kHz7qcUFocH4uU97uz+7+zPjjn0j3hFHxq/sc/cJg/wi5aAGqAcSBLr32Gpsz/TIXZ /jKUr5v8+gIZT1tJ7BCTjnbkLc08vDZCmcIOugTU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Stephen Rothwell , Masahiro Yamada , Steffen Klassert , Jakub Kicinski , Sasha Levin Subject: [PATCH 5.15 152/247] net: xfrm: unexport __init-annotated xfrm4_protocol_init() Date: Mon, 13 Jun 2022 12:10:54 +0200 Message-Id: <20220613094927.565492415@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220613094922.843438024@linuxfoundation.org> References: <20220613094922.843438024@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 4a388f08d8784af48f352193d2b72aaf167a57a1 ] 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, net/ipv4/xfrm4_policy.c is never compiled as modular. (CONFIG_XFRM is boolean) Fixes: 2f32b51b609f ("xfrm: Introduce xfrm_input_afinfo to access the the callbacks properly") Reported-by: Stephen Rothwell Signed-off-by: Masahiro Yamada Acked-by: Steffen Klassert Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin --- net/ipv4/xfrm4_protocol.c | 1 - 1 file changed, 1 deletion(-) diff --git a/net/ipv4/xfrm4_protocol.c b/net/ipv4/xfrm4_protocol.c index 2fe5860c21d6..b146ce88c5d0 100644 --- a/net/ipv4/xfrm4_protocol.c +++ b/net/ipv4/xfrm4_protocol.c @@ -304,4 +304,3 @@ void __init xfrm4_protocol_init(void) { xfrm_input_register_afinfo(&xfrm4_input_afinfo); } -EXPORT_SYMBOL(xfrm4_protocol_init); -- 2.35.1