Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp135342iof; Sun, 5 Jun 2022 23:25:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzN3F5rsc5B3fjP2YBnRcwXbobUuFhJ9jNjx0M9aWDUnxc1d0RzTKJVzRl0ZM/2NPpxXCHa X-Received: by 2002:a63:6a85:0:b0:3fa:722a:fbdc with SMTP id f127-20020a636a85000000b003fa722afbdcmr19787663pgc.174.1654496721595; Sun, 05 Jun 2022 23:25:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654496721; cv=none; d=google.com; s=arc-20160816; b=oy2qTLbbqixee9smQ5RXd6fgrL1/TYznMT8VmtHAKXvHTGRvAEWtNFEJnwua7dzMY0 WgZNZiK3tWMrZFgmafcsv7hVMM6cSl6H+a7oDXogyRklH/aq2u/pPh4vTZmEuDrTA8MD GiXU7cgSXhLmw0sE7pi3qDSm4f0UqSgUUzgYN3RTWuAbuv66GK3fwbxJlD8m8jJk6+d/ aM/FfDtlYV3iMgprc7RmTigrcAtna9MRmxbmMGnUg+szTCBSjEeDnN+rQstT80nPgNxk RjzdTTBXu4JE4Qt4k5nJbtG/31jfUfpRqmspEcoZobHJQRI6I0Jd3u3OgDj1hNVFF+yP 7l+w== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:dkim-filter; bh=ziQR3Y2YVkVjwU2FN5ZC+RUigUk86AY6lP77BM69cbg=; b=Oqf6IhyA8nx0NWD8bXOCGH1fQhmgchk3cdhfjJft7/CazghMUT+7E9bDdfPF2Z2FFE t06V5Va0I7vmH3Sp7ybH4VSwL3KcQoA2imE15pZJvpJyWfOUByyiDdw8R6v7pgq6GDaK 5SJz4cXfILSPsXdCy0xFj1CyIdcNl30nV6S5tSXO+nzVCqCMnkvxiG5R7q5gir/n+sFH gwPk54YoJN8iE25u8zoFPCq+nKRi8JxYXM2ezy0nnl0D2Lj6bHoH9ATBaT2ENdg0EbKD B0OgfNYmYaabl15+bcM7I3QbPnhjDJGniwU8I5taqjOpffhu15eSLDnAgMi/b/jNdOmp 034g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=YK9ljVsi; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id 77-20020a630050000000b003fcee2c3403si15609724pga.166.2022.06.05.23.25.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 05 Jun 2022 23:25:21 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=YK9ljVsi; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 8E09C113B51; Sun, 5 Jun 2022 22:27:54 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229630AbiFFF1r (ORCPT + 99 others); Mon, 6 Jun 2022 01:27:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47972 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229660AbiFFF1k (ORCPT ); Mon, 6 Jun 2022 01:27:40 -0400 Received: from condef-07.nifty.com (condef-07.nifty.com [202.248.20.72]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BE529119069; Sun, 5 Jun 2022 22:06:05 -0700 (PDT) Received: from conuserg-10.nifty.com ([10.126.8.73])by condef-07.nifty.com with ESMTP id 2564ttqF026112; Mon, 6 Jun 2022 13:56:15 +0900 Received: from grover.sesame (133-32-177-133.west.xps.vectant.ne.jp [133.32.177.133]) (authenticated) by conuserg-10.nifty.com with ESMTP id 2564rxUA026256; Mon, 6 Jun 2022 13:54:02 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-10.nifty.com 2564rxUA026256 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1654491243; bh=ziQR3Y2YVkVjwU2FN5ZC+RUigUk86AY6lP77BM69cbg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=YK9ljVsieM/Oe6LIGFVOj3act3Y+vtt/qbzrdfidezomn2THxtGDQwGpxvOTi+RZm pF6qs15bi0tyntc8Wl2uv9tH2cyTx1n1tjZBxaA7Qrlo/N+bRY7zTY6r2eMQ3aucBy qKx3ZvjyvPzBa0urhSQlaHECANtaYdh97M9CA1GDGnSa6nuzgE81NbhkbnNqY1mfKs AazrY8ger8oAZ/HhDmhCEIVwD/G2WRymdTVF5iixsIqcsRkckW3FVQ4TLXq5X5SgJk XK0lqGi8TpdbWNPWX/0Y21f68B5Gu3gNa8dTCk/FyDWtGaHASScGNl7Gm9EKZbSIb2 US58dmCjmgOsA== X-Nifty-SrcIP: [133.32.177.133] From: Masahiro Yamada To: "David S . Miller" , Jakub Kicinski , netdev@vger.kernel.org Cc: Eric Dumazet , Paolo Abeni , Masahiro Yamada , Stephen Rothwell , David Ahern , Herbert Xu , Hideaki YOSHIFUJI , Steffen Klassert , linux-kernel@vger.kernel.org Subject: [PATCH 2/3] net: xfrm: unexport __init-annotated xfrm4_protocol_init() Date: Mon, 6 Jun 2022 13:53:54 +0900 Message-Id: <20220606045355.4160711-3-masahiroy@kernel.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220606045355.4160711-1-masahiroy@kernel.org> References: <20220606045355.4160711-1-masahiroy@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE, T_SCC_BODY_TEXT_LINE autolearn=no 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 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 --- 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.32.0