Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp136529iof; Sun, 5 Jun 2022 23:27:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyZMVv4oMe0hWweJP4y+lb4K7Fm5YdKbHCbtHdtS45El4b5G+e7w7B+lWn6zj4r22m3iQdw X-Received: by 2002:a63:c147:0:b0:3f5:f6f5:fe0e with SMTP id p7-20020a63c147000000b003f5f6f5fe0emr19699748pgi.501.1654496860880; Sun, 05 Jun 2022 23:27:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654496860; cv=none; d=google.com; s=arc-20160816; b=z6l1r7AAvGnhQPW4DCCkgesESlr0fxKMPNCQPLzxqTyTWoXTyCOGm2qI1sHzmL9oMv RANGldRpvk+Ph+P0l59tFAzmQNwzC5ofFak5uqz0amaEsF4B6waIhbeinYAuSaI2tdDs rjpIogvaH0WoUVmtCd2UFZRi718vuU/UZOJTTzOUWNIj18zOUOgFfNgTy61KVZuHovgq MculkeQ6WGLz/YhreHuz8RjAP6SvYqTWrxiIzlmcD4usoM7+Tkp4bPPDJ2qZrf8/rgpO 3e+2HWUEruJGBuToFHS7JDzfZqRn9sEFEUqM81mYW8Gb7rjNlnxeBMO0RKGexhAv2Oi8 IugA== 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=8DsFZaGELYB7JvwytYb5vfoaMr6TS1NLhkVqZf+4BBQ=; b=W9uzSqRTcqApJ1+8oOOFoSP/1XNbl61j3s2ETDh/MxHo13GOlPpeXenbfrbXNSwOTh MJup1ThOT0Jnc1gXD4hIT2WiioupCu2CV20j+rqB/BOaxhh0PCjJIbxdNHTwwZ5rxNUN 921zNSAzzYaCUXGzHWwMjMyGOz3Aw3erb9pdZ1hp7HWxxC/YREwLaEabhN8EjDasQDRS Nd1eZCtnbCpQTTOS4gsahhuYAZ6Kab8wbGurvpmG4f55Ux7cyIkHqbcjGZ1DY7FtCBvG cCI2uVXfIk8YpcqL0VbGg2CJsqXANJhdeJ/+ZJhy4leuzDxtKaoxxjMreYVmlVGkA4Ga TYCQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b="fJ/D8hXj"; 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 h28-20020aa79f5c000000b004fa3a8e005dsi18436196pfr.276.2022.06.05.23.27.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 05 Jun 2022 23:27:40 -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="fJ/D8hXj"; 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 8D0D8118D0B; Sun, 5 Jun 2022 22:31:53 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229660AbiFFF3s (ORCPT + 99 others); Mon, 6 Jun 2022 01:29:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49448 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229494AbiFFF2F (ORCPT ); Mon, 6 Jun 2022 01:28:05 -0400 Received: from condef-08.nifty.com (condef-08.nifty.com [202.248.20.73]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4B65713A2E2; Sun, 5 Jun 2022 22:07:59 -0700 (PDT) Received: from conuserg-10.nifty.com ([10.126.8.73])by condef-08.nifty.com with ESMTP id 2564tuC1017874; Mon, 6 Jun 2022 13:56:17 +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 2564rxUB026256; Mon, 6 Jun 2022 13:54:03 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-10.nifty.com 2564rxUB026256 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1654491244; bh=8DsFZaGELYB7JvwytYb5vfoaMr6TS1NLhkVqZf+4BBQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fJ/D8hXjFIh+wPt+yETn7vdGZzNYq1/3hzgsf0g1WYd5EvNUKb7sFe09qxQP3X6gY LxIASv+ka9fQHrDIPDpxMsTAaO+AlqlWnhFLkNWI+uEk/r6yTEorleWfqnhh/kdpAs KwCsXgpyVxeFWbadM7lVp0wWLOmjLNGcHHyzDhgztK56+fJKLq72cUvYqKOcIbWCGA ZDOFibDqFM4sFQCLqQk+ahSkZcBIpEzZRNhjqiJ2X/3NhdrYp0EOIPVBNW47lG6xNt uGDsC0txo+64CJXCY3FbmnCGOFOV93uRPyVqejSorqsP8z3Z3k2oxDW4ZvKOAT4Frj eu9G5Y/Yl4MSw== 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 , David Lebrun , Hideaki YOSHIFUJI , linux-kernel@vger.kernel.org Subject: [PATCH 3/3] net: ipv6: unexport __init-annotated seg6_hmac_init() Date: Mon, 6 Jun 2022 13:53:55 +0900 Message-Id: <20220606045355.4160711-4-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 caller (net/ipv6/seg6.c) and the callee (net/ipv6/seg6_hmac.c) belong to the same module. It seems an internal function call in ipv6.ko. Fixes: bf355b8d2c30 ("ipv6: sr: add core files for SR HMAC support") Reported-by: Stephen Rothwell Signed-off-by: Masahiro Yamada --- net/ipv6/seg6_hmac.c | 1 - 1 file changed, 1 deletion(-) diff --git a/net/ipv6/seg6_hmac.c b/net/ipv6/seg6_hmac.c index 29bc4e7c3046..6de01185cc68 100644 --- a/net/ipv6/seg6_hmac.c +++ b/net/ipv6/seg6_hmac.c @@ -399,7 +399,6 @@ int __init seg6_hmac_init(void) { return seg6_hmac_init_algo(); } -EXPORT_SYMBOL(seg6_hmac_init); int __net_init seg6_hmac_net_init(struct net *net) { -- 2.32.0