Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp575042iog; Mon, 13 Jun 2022 08:25:11 -0700 (PDT) X-Google-Smtp-Source: AGRyM1tsU0ufhiXBghHJnJTZv2yFfbA5j2jg72MjtOQcpYC12KOrfhZiSkMfy8dsk1Pc7zKKfZrR X-Received: by 2002:a17:907:3e0d:b0:711:dbff:b830 with SMTP id hp13-20020a1709073e0d00b00711dbffb830mr325791ejc.601.1655133911495; Mon, 13 Jun 2022 08:25:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655133911; cv=none; d=google.com; s=arc-20160816; b=v/NxOcElaRCPpsViqv5d6dRC4MdPXl/RhTqp9qzzJjfT/+Uc8U0UdvZgtKpp2FRx70 s0ouaTX4yNj+iZeZWfGSy/Q0i27KZ12YzXKJswKLGIbUo2ADm66UlWhCiv0iiPZCMh7G q2dhD1wmfI1JfqzyBVqp4jj6EkWKFQ3jVVdTbSVQD2H/EFNrgdoHEIWNPNAv9Naxo/zZ liI/FmVJ+dWRNeYLfn9F4WCYBmFVSVr0LDOySB2OXwVPFNlNXUx344hzwcUKDaSoOwFH 78qNpwQtHurgprYoK6ppgK7NeR3Vf9Z6xoGcIm5SJI95KUOB+KVKbXYhGmH5jwB52jdX awrw== 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=POJqJuw8HTRRdP5QhC22wYr2rtv6gzXxlLUwxaJ2d6Q=; b=VJchHqEno54fr63TNTmTsoiKI7e0Zp1WEG/aBQI8dB8zsfY5n5n0Qzhax9IEFxPFJ8 A4ueeFgVlQ39+0CbkRk5pUI7XWC8Ovij4TZ4pFkOXIbSM9qW9ZTUL/TbunCPaR8FZfUx jeG+13kOZ4n52ApW6myRNlt4Nk25luuSgvv24cY1QLwD3RpGboImMAsFYXdq3H1HIDU7 4roXHGcsKdvcUDRBCnjl6yzQ+FiFaLdYtjC+Fs6q/4cXi4teN6KypQXzboB9hVPuWZOW ERila2JPcCSCAB3x91b71dnYMyGVreNHzIFJ0R3+gq5MpTkHKUO0sQYC7x1VwwgKEom2 1X4w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="VI/n4QZs"; 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 b18-20020a056402279200b00430262e2b6dsi8673391ede.206.2022.06.13.08.24.46; Mon, 13 Jun 2022 08:25:11 -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="VI/n4QZs"; 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 S1352057AbiFMLJU (ORCPT + 99 others); Mon, 13 Jun 2022 07:09:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45418 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1351712AbiFMLEz (ORCPT ); Mon, 13 Jun 2022 07:04:55 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 879233206A; Mon, 13 Jun 2022 03:33: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 16EFFB80EA3; Mon, 13 Jun 2022 10:33:39 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4B6FAC34114; Mon, 13 Jun 2022 10:33:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1655116417; bh=kxf9ci/BCQtqhZJhZS8r0uz52LFijqgOzZISz+S4H7A=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=VI/n4QZsjGibicoXIM8tId1qnEWGpyJrkJe8EMcg5FcZgmamKPbG481QgL2feFh50 lZ+Uime+PZ8BCodexh84DKFpG3xJgzl5idCjVm52y0MOSVtFjDcJ8c3qb81bmzIYw7 HS5WODueTiptpaZV3LT6G+r7ieQb6cSolQWuX3YA= 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 4.14 177/218] net: xfrm: unexport __init-annotated xfrm4_protocol_init() Date: Mon, 13 Jun 2022 12:10:35 +0200 Message-Id: <20220613094925.975978630@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 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 8dd0e6ab8606..0e1f5dc2766b 100644 --- a/net/ipv4/xfrm4_protocol.c +++ b/net/ipv4/xfrm4_protocol.c @@ -297,4 +297,3 @@ void __init xfrm4_protocol_init(void) { xfrm_input_register_afinfo(&xfrm4_input_afinfo); } -EXPORT_SYMBOL(xfrm4_protocol_init); -- 2.35.1