Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp438902iog; Mon, 13 Jun 2022 06:03:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxKo5ZgaCXI8hYLP6gLxS7TtToUCmjxUKIPeksDjmlp7v29aaKY8PVdua0iTDvTTa790ClB X-Received: by 2002:a17:906:77d1:b0:712:57a7:e897 with SMTP id m17-20020a17090677d100b0071257a7e897mr11310074ejn.431.1655125383433; Mon, 13 Jun 2022 06:03:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655125383; cv=none; d=google.com; s=arc-20160816; b=mKQyYf/9Hk1NIO5/yuRJeUeb55yTQbhdvvXy3P4sEzuqJk4UweRPLxxRbkNW84UwuO rZkX18TTyyKOi8MjgfbaQdjN5HMVwuVtvHi7k4yphTe5AYZAekDIvrfzmYKcuhHenwUn 5wkUbU4D/5tfAxBsPPovRY8veA1d12XyeX+xR16TyA9i2rIk9wdT1pLU9+6m0c1tDBqu EqH5tATsAUVnVFseUtmbntM8z/g/tVtoryqaEFnpIaWEKoN3kqQXK+/Q/kYwzlUpV8Wa tUipG3oP9Sd1HXGieTsDybMgKIOUJKI4EQuKdp2d/FCy+vFpWGl8KC8U20Jk0upJLpVw F0WQ== 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=xDcHQCZ7k++z/h4M0rY5AkuhTb5/qdLagJbS6yu2aiw=; b=w6R7Lo97drTusyZ6XTAHNVckvWNPvW7ir4Jcsc1LNx6FuG0FIQrVR9L7QinTXPlHGj ggUFmjUnNsCl/BixNzBL2veBy3yj+jrKnZ55gO/DRYx3ExZGCs/CGpJAMHQTeUG5Z1Bw IFyCw+INJJiqchu7gi0gsXV1aSLZHpy4TkFGLfAv1aPhMbyxd0XEifqqTIc1ehiYbihA 5p6R089G8cVlQOs6pYM/75F5goyrOCmu5O739tfKUThhXrV1w7eqAwCy4lP36sRYLQL5 3WffLZ0tG73r4Zg6ErmxqBxF6bcngQRppLuhqua2HYbPZPCPpSmk3tRyFkwhHEHD4iyd yK6w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=xDtu1Vyk; 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 l17-20020a50d6d1000000b0042dfcc43f17si8286169edj.274.2022.06.13.06.02.36; Mon, 13 Jun 2022 06:03:03 -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=xDtu1Vyk; 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 S1356153AbiFMLnu (ORCPT + 99 others); Mon, 13 Jun 2022 07:43:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46086 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1355583AbiFMLjQ (ORCPT ); Mon, 13 Jun 2022 07:39:16 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2AFC62408B; Mon, 13 Jun 2022 03:49:03 -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 BABF46112A; Mon, 13 Jun 2022 10:49:02 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id CADEAC34114; Mon, 13 Jun 2022 10:49:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1655117342; bh=kFi8FSqGoOk15KA+28maHSnPzFxrYRhoHR+leMFLd8k=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=xDtu1VyknV/7ACFD4dQxcRsw4ghjV2DojPElh28adrZdOdS9ei58wbq5X1FlZcEpo kG0A2Kcr6LhTj0Mo/7RMxnjb7oZ2bTaF++EgmXhtDodXy67K/F0ajkK63nGAkJD8nF ngRKdSS3EWhTNW2DcVjwpsT1WLTJ3ejgkxFV9ZKA= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Stephen Rothwell , Masahiro Yamada , Jakub Kicinski , Sasha Levin Subject: [PATCH 5.4 359/411] net: ipv6: unexport __init-annotated seg6_hmac_init() Date: Mon, 13 Jun 2022 12:10:32 +0200 Message-Id: <20220613094939.459486488@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 5801f064e35181c71857a80ff18af4dbec3c5f5c ] 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 Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin --- 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 ffcfcd2b128f..a4cad71c4204 100644 --- a/net/ipv6/seg6_hmac.c +++ b/net/ipv6/seg6_hmac.c @@ -401,7 +401,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.35.1