Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp793915rwl; Fri, 31 Mar 2023 02:25:32 -0700 (PDT) X-Google-Smtp-Source: AKy350bwJeDwXe4kfo8qMeyvuUZ2a1CCpl7bsIrWUwESpqS5QqV7PxW8ZobKxM6Mn//RoUMrmRe9 X-Received: by 2002:a05:6402:4413:b0:502:92d:4f51 with SMTP id y19-20020a056402441300b00502092d4f51mr6015996eda.1.1680254732556; Fri, 31 Mar 2023 02:25:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680254732; cv=none; d=google.com; s=arc-20160816; b=H0T/9GI/P4AekKYNsyJU0XdB8+wN8zAVJIDLtZp1ElhKaZ6dlXGY10nPF3TIb1+pF3 nAzc7KaxLZ/jn6PkwYlmSpGxVMsHnHXfUe99aIcKoIgOAVpPbEC43nas3azgwcXhCHrI wgZay0gJeXL4LEIw5XLMz0aUbO5ECvB0IRHJYA3wmPc4Z7xoAr3+XoSBwelfAJcupSdY KsIDPjUL20jPxglYTuPno0AmBA9CfhiYQpiLxdlIlgNpo8K1hLUvZzzy3pb72KTJoEYQ AEznXX/TodD7tFSt7OI3eo0bebthsAqjdDTnouG1k93jhNpdn0HdS8TQY7DRce+gKV5i 2m5g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:message-id:date:subject :cc:to:from; bh=5G5k7U3Kz7t2029veOnxBC6PVEl4xZjLFeVzGs5ZXt4=; b=pEuWI7rHzoI6kgZtEP4162NCsAoByZSOaiCZe0BFkv0+ouWF+42rdmU8aPdOGeAWER 7ify7VveN+9LPHMRHnx0Gctd9qiD9t4uELffSMrKjb2gjiV7+HCod6ETW+amq2tRUTIZ rEcEJH0BIml1lyP2Bwq5vmDQo4PrAnRjn+I2Kyb3BC42Kk1OA7Bc1lZxH5xGnd+ja8At wxBa5ImDZVSBFVVmNA2s6AxEqlc62/HwRO9u1rDO2kpURRyCS7KqijyDzMqNs6eDsULR Y69dQyKCakFXIqykFa93cpAWCjFm85L9P/R4X7S/VQ0jObireFsb6+w4UeVVGYNegcA0 YZ1A== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i2-20020aa7c702000000b004fa760de417si1751663edq.122.2023.03.31.02.25.08; Fri, 31 Mar 2023 02:25:32 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231213AbjCaJQc (ORCPT + 99 others); Fri, 31 Mar 2023 05:16:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37686 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231255AbjCaJQO (ORCPT ); Fri, 31 Mar 2023 05:16:14 -0400 Received: from loongson.cn (mail.loongson.cn [114.242.206.163]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 31B249754; Fri, 31 Mar 2023 02:16:03 -0700 (PDT) Received: from loongson.cn (unknown [113.200.148.30]) by gateway (Coremail) with SMTP id _____8BxONnSpCZkvOQUAA--.32103S3; Fri, 31 Mar 2023 17:16:02 +0800 (CST) Received: from linux.localdomain (unknown [113.200.148.30]) by localhost.localdomain (Coremail) with SMTP id AQAAf8DxC77OpCZkVfMRAA--.14538S3; Fri, 31 Mar 2023 17:16:01 +0800 (CST) From: Tiezhu Yang To: Luis Chamberlain Cc: linux-modules@vger.kernel.org, linux-kernel@vger.kernel.org, loongson-kernel@lists.loongnix.cn Subject: [PATCH 1/3] module: Sync code of is_arm_mapping_symbol() Date: Fri, 31 Mar 2023 17:15:51 +0800 Message-Id: <1680254153-14582-2-git-send-email-yangtiezhu@loongson.cn> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1680254153-14582-1-git-send-email-yangtiezhu@loongson.cn> References: <1680254153-14582-1-git-send-email-yangtiezhu@loongson.cn> X-CM-TRANSID: AQAAf8DxC77OpCZkVfMRAA--.14538S3 X-CM-SenderInfo: p1dqw3xlh2x3gn0dqz5rrqw2lrqou0/ X-Coremail-Antispam: 1Uk129KBjvJXoW7WF1ktFy3GFWftrWDKF45KFg_yoW8WF4Upr 1DG3y5Gw4Fyr1DGayfWF1kWryUua4vqw4kA3sxKryfZFnxXFW0qr47t3W3uw1IvFy5GFsY gr1rAa45Aa4fCF7anT9S1TB71UUUUUDqnTZGkaVYY2UrUUUUj1kv1TuYvTs0mT0YCTnIWj qI5I8CrVACY4xI64kE6c02F40Ex7xfYxn0WfASr-VFAUDa7-sFnT9fnUUIcSsGvfJTRUUU b7AYFVCjjxCrM7AC8VAFwI0_Jr0_Gr1l1xkIjI8I6I8E6xAIw20EY4v20xvaj40_Wr0E3s 1l1IIY67AEw4v_Jrv_JF1l8cAvFVAK0II2c7xJM28CjxkF64kEwVA0rcxSw2x7M28EF7xv wVC0I7IYx2IY67AKxVWUCVW8JwA2z4x0Y4vE2Ix0cI8IcVCY1x0267AKxVW8JVWxJwA2z4 x0Y4vEx4A2jsIE14v26r4UJVWxJr1l84ACjcxK6I8E87Iv6xkF7I0E14v26F4UJVW0owAS 0I0E0xvYzxvE52x082IY62kv0487Mc804VCY07AIYIkI8VC2zVCFFI0UMc02F40EFcxC0V AKzVAqx4xG6I80ewAv7VC0I7IYx2IY67AKxVWUAVWUtwAv7VC2z280aVAFwI0_Gr0_Cr1l Ox8S6xCaFVCjc4AY6r1j6r4UM4x0Y48IcxkI7VAKI48JMxAIw28IcxkI7VAKI48JMxC20s 026xCaFVCjc4AY6r1j6r4UMI8I3I0E5I8CrVAFwI0_Jr0_Jr4lx2IqxVCjr7xvwVAFwI0_ JrI_JrWlx4CE17CEb7AF67AKxVWUAVWUtwCIc40Y0x0EwIxGrwCI42IY6xIIjxv20xvE14 v26r1I6r4UMIIF0xvE2Ix0cI8IcVCY1x0267AKxVWUJVW8JwCI42IY6xAIw20EY4v20xva j40_Jr0_JF4lIxAIcVC2z280aVAFwI0_Gr0_Cr1lIxAIcVC2z280aVCY1x0267AKxVW8JV W8JrUvcSsGvfC2KfnxnUUI43ZEXa7IU8P5r7UUUUU== X-Spam-Status: No, score=-0.0 required=5.0 tests=SPF_HELO_PASS,SPF_PASS autolearn=unavailable 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 After commit 2e3a10a1551d ("ARM: avoid ARM binutils leaking ELF local symbols") and commit d6b732666a1b ("modpost: fix undefined behavior of is_arm_mapping_symbol()"), many differences of is_arm_mapping_symbol() exist in kernel/module/kallsyms.c and scripts/mod/modpost.c, just sync the code to keep consistent. Signed-off-by: Tiezhu Yang --- kernel/module/kallsyms.c | 5 +++-- scripts/mod/modpost.c | 2 ++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/kernel/module/kallsyms.c b/kernel/module/kallsyms.c index 3320586..a9045fe 100644 --- a/kernel/module/kallsyms.c +++ b/kernel/module/kallsyms.c @@ -251,8 +251,9 @@ static inline int is_arm_mapping_symbol(const char *str) { if (str[0] == '.' && str[1] == 'L') return true; - return str[0] == '$' && strchr("axtd", str[1]) && - (str[2] == '\0' || str[2] == '.'); + return str[0] == '$' && + (str[1] == 'a' || str[1] == 'd' || str[1] == 't' || str[1] == 'x') + && (str[2] == '\0' || str[2] == '.'); } static const char *kallsyms_symbol_name(struct mod_kallsyms *kallsyms, unsigned int symnum) diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c index efff807..79a27cc 100644 --- a/scripts/mod/modpost.c +++ b/scripts/mod/modpost.c @@ -1114,6 +1114,8 @@ static int secref_whitelist(const struct sectioncheck *mismatch, static inline int is_arm_mapping_symbol(const char *str) { + if (str[0] == '.' && str[1] == 'L') + return true; return str[0] == '$' && (str[1] == 'a' || str[1] == 'd' || str[1] == 't' || str[1] == 'x') && (str[2] == '\0' || str[2] == '.'); -- 2.1.0