Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp438394iog; Mon, 13 Jun 2022 06:02:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzX5PQ26zI4japVUneDWxQ1Dedf8WQno0FcERVyuuaViFmCbUvn00HaeXI6rsHjD1Zcs8SS X-Received: by 2002:a17:906:7290:b0:715:7401:6ed8 with SMTP id b16-20020a170906729000b0071574016ed8mr9220575ejl.76.1655125277969; Mon, 13 Jun 2022 06:01:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655125277; cv=none; d=google.com; s=arc-20160816; b=PREe4KoXAOhmMhMhpCxXHaKu3wjYzLInU4lEI9GKBD+gawUNT16Lm1/bM6Wqgc5rxY R6dSFErs43yBkaS52pQZkRyMs+I37XgQJiBhfeH+sy1/qWnVt+ulZWG+ryU8AjNJ+CH6 +5Ah5K4Ncob9opat4Hn11N9WelOaDmYzQZYVGpCkVYuhVperes1FsO5w9NPjajOq5YvT TOt0BIQ6hvL3a+GfOND6aFnP7SEL+f7Er9JIjdcsXSAA1+l8EBweS0G9a8JlblK/JGT0 u+DWgHEUtqt/SeWVWi0MbFiFC+ZzFyXZYhJtdtbtlZ7olNiNGG+Pzsyi5cWaiLQfEhLB silQ== 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=pxiFpfISxX9lg/oepoMTAd4ZdJVniaXWbLCybkWf9jc=; b=K+TJPD+Yqkgv52r7/fXWv8AKc+//PcQ8VmwldkNGqRXtTBuePQFFnxv7K59g8M58xm V4ke/zELS9SYWCTUOSDAOngOwhpHgyedCR2SUs6TWDOe0u8fOLwh/eay/2MLxF9fkktI kdS8KnJNCAxrusn/2wqGizlEsiMq+U+aLPN9hqDe3e0XQ7lnRNh9rGOZrYGwUttiH6LG QRQOehSF3vfntS0pNmeqqEsuydnZ2ZwtzaFaVxUEtmGXJ+i34n1OlOEryLR6zzhjvuji atKENO7YXBZIu2nvgF+R2+hByUFKpXEGl/8E/UMJGUfV7T9oke6qTc6tS82NIRicdFlQ 1CIA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=JUlP+x8d; 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 b11-20020a056402278b00b0042e2a928df9si9641320ede.287.2022.06.13.06.00.49; Mon, 13 Jun 2022 06:01:17 -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=JUlP+x8d; 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 S1356186AbiFMLnw (ORCPT + 99 others); Mon, 13 Jun 2022 07:43:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55128 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1355576AbiFMLjQ (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 0A0D923BFC; Mon, 13 Jun 2022 03:48:59 -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 B59FDB80E59; Mon, 13 Jun 2022 10:48:57 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 26373C34114; Mon, 13 Jun 2022 10:48:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1655117336; bh=TCgG5lsX2SgS9b2cEbyOiJ4GzHluh7fnO16w+FMHkjI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JUlP+x8d9+DStfdIRBJLfOIh+uQaFsaF0VJ/FSNjnf7yHeb076XARyomZ/14KBzhn nYrYH83/xLb0W1kugMknyHeJbPcIAroQsLXE+XWGjljnIylb/wsAG0w/6YRZMaaVT4 Mg9vB+jU8luLxHCRmWfQY8GXs/E4wKjzQ6JHTRWk= 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.4 358/411] net: xfrm: unexport __init-annotated xfrm4_protocol_init() Date: Mon, 13 Jun 2022 12:10:31 +0200 Message-Id: <20220613094939.430367139@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 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 8a4285712808..9031b7732fec 100644 --- a/net/ipv4/xfrm4_protocol.c +++ b/net/ipv4/xfrm4_protocol.c @@ -298,4 +298,3 @@ void __init xfrm4_protocol_init(void) { xfrm_input_register_afinfo(&xfrm4_input_afinfo); } -EXPORT_SYMBOL(xfrm4_protocol_init); -- 2.35.1