Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp2902965iog; Mon, 27 Jun 2022 05:26:21 -0700 (PDT) X-Google-Smtp-Source: AGRyM1tMz4qUOnySxkxACQtQuxJCRz14F1s1AkwjCbbXYPGE/7+3zcVlN2k7MADANXpgrASkCHq7 X-Received: by 2002:a17:906:3f87:b0:722:f8c6:32b0 with SMTP id b7-20020a1709063f8700b00722f8c632b0mr12643619ejj.359.1656332781265; Mon, 27 Jun 2022 05:26:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656332781; cv=none; d=google.com; s=arc-20160816; b=XfvjlEekM7I5mxjJJA1BkpxSFmPcloWTd7SGmXMm9iNrOQnjG5aBhoEaNmj7FxPiLZ 4WRV8YM/Lh9yYDaOp/lxKY95KixuNlxgEpFIqgCTqu03HeD2FFUwl4QoTYE0EojpKcTa cwXADRdA+EOMjKft9Q8FGKe+pXXP874MyGHLFK0wgT+l4KvAo69DHh+B8BK3/sfLSrqf YdxBau0pBL7nnhqdIl20coMeT4ybwe24buYqFh90U3C1DJcpjyP4GF4e6Cv3tymWQ2zv tsep+nET4vva8VUsRN72YkSsQ6y8mG3G1m7cepKHhcdO1qUXDbCmAi6Lt+kbdUgurbiB 6lnw== 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=hpnBbQiYje7AfAbmOjTBFvtIFZqRp5JbEeallwqTRHI=; b=lDwNkucZpAHDGqowYbWBdC9nSXIbFS78rckeG4tYZruzn5S65lTuCWwr75uozupAHu 9DlTKe0AUdXLtl8v7aA+HXoa8a06cRSHNVqOSp9W15127H1AZHmJQP5bTVAcW1wYIvaH YNBpnGJZYUmtx2hlKBAPbwoRYyo6TV/u6oza8tHnsuxIfe7iva+Fs4fjqZdFQ8WN6LPq 9DL/cuOqHCImlircGXHxUfmIghpS1k1yTgmGXO5bbWi6QVYvMNfWqmpsHmpZP1z04JIV NM2WxHTF29gvp8Vj380r6wywzv2jz1Rb/Pxn3cy0Il4snSSH/pEYFaneR37EL1Smfmpq q+Jg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=tkq82g0G; 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 jt24-20020a170906ca1800b00710fb1685ecsi11752831ejb.272.2022.06.27.05.25.52; Mon, 27 Jun 2022 05:26:21 -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=tkq82g0G; 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 S236145AbiF0Lfo (ORCPT + 99 others); Mon, 27 Jun 2022 07:35:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55780 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236179AbiF0LdZ (ORCPT ); Mon, 27 Jun 2022 07:33:25 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6BE8FCE15; Mon, 27 Jun 2022 04:30:30 -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 05F1D612D8; Mon, 27 Jun 2022 11:30:30 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 070A0C3411D; Mon, 27 Jun 2022 11:30:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1656329429; bh=ShsZi12gGKcQZTw4TBWnl6cqCYb50NfFZL+L+POtwTQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=tkq82g0Gfl32HnwCKpJ8oX2gkJDdeEUMiEm2oEZSRUKLssW/4/b+8sl1bfhxeZNT9 YAdZZm+xosWpzPl8okpA3kprP/Dz5qPpa5sKZthSAhHi8MaEukK97Py8s0vBgDv5VP XYLxB60cOj4N2jthdkb9KsZe6NoeD8gdTRHkpUvI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Masahiro Yamada , Nick Desaulniers Subject: [PATCH 5.4 57/60] modpost: fix section mismatch check for exported init/exit sections Date: Mon, 27 Jun 2022 13:22:08 +0200 Message-Id: <20220627111929.368555413@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220627111927.641837068@linuxfoundation.org> References: <20220627111927.641837068@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=-7.5 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 commit 28438794aba47a27e922857d27b31b74e8559143 upstream. Since commit f02e8a6596b7 ("module: Sort exported symbols"), EXPORT_SYMBOL* is placed in the individual section ___ksymtab(_gpl)+ (3 leading underscores instead of 2). Since then, modpost cannot detect the bad combination of EXPORT_SYMBOL and __init/__exit. Fix the .fromsec field. Fixes: f02e8a6596b7 ("module: Sort exported symbols") Signed-off-by: Masahiro Yamada Reviewed-by: Nick Desaulniers Signed-off-by: Greg Kroah-Hartman --- scripts/mod/modpost.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/scripts/mod/modpost.c +++ b/scripts/mod/modpost.c @@ -1131,7 +1131,7 @@ static const struct sectioncheck section }, /* Do not export init/exit functions or data */ { - .fromsec = { "__ksymtab*", NULL }, + .fromsec = { "___ksymtab*", NULL }, .bad_tosec = { INIT_SECTIONS, EXIT_SECTIONS, NULL }, .mismatch = EXPORT_TO_INIT_EXIT, .symbol_white_list = { DEFAULT_SYMBOL_WHITE_LIST, NULL },