From patchwork Fri Sep 27 09:35:59 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 174623 Delivered-To: patch@linaro.org Received: by 2002:a92:7e96:0:0:0:0:0 with SMTP id q22csp3245769ill; Fri, 27 Sep 2019 02:37:27 -0700 (PDT) X-Google-Smtp-Source: APXvYqzEREJtpIfJsmJKgKocF2q+3tgGhijVsr/yXHoe5+BrM3VvHMtimktYNwulLj5VIQGFLymj X-Received: by 2002:a17:906:d97a:: with SMTP id rp26mr7031731ejb.251.1569577047196; Fri, 27 Sep 2019 02:37:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1569577047; cv=none; d=google.com; s=arc-20160816; b=CLzlIAsmw5zmWVUARoqYtJCaspa5+wlgmPm85U1+ql6OplVMXtnmw1qK06oTeSZJh/ Hiwlb15CEkddksGzvMSRMRG3HpRnxxUXJo7nerEd0IJ6OX85gcXB0bkb32UXtcVbK5yp jQC44Z79T1TFn7+wHcFsGstM8hc1RtSWRMhXQw9CmsihyrpVLICvkEJlRFEb0z0KOFWa ZTMrKeW0lJNGXDpNTGfytvuR/dRRf8XcJ3INVQwTRfSjI79Nv2Z/i9XB8S8NU2wtNPTd aCwifdEK1/hbyziuUiV2DoRk8zBcn5oGTtmdmTRSrinwRhwFA6ExLS1qOL9LNSiZmkYp JWdA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:dkim-filter; bh=Fynp0G6evPgfPqhsg7r4WZQkR9spuRzwJdxpkYdeONU=; b=W994lwQf2ERM5bV42OFyxQ+MjKQKQfMw0KU3F/d41uInBObDKvH4LkNxASGfMMs+IZ Lwy7uEmWT4Lwn017phTyz73Y2ukfkAWeBbFVlZvUveibGlw/LYi/sGnlfm4SiVH+Pc43 bQTWklxKfgAI/BFKWXxMncC9mwQwPzLtK3ekMBbfx7MtoHDio7QVeJak/GMavGFQWUYr q0/bR+IVSf/xgKIJRVcgwEn8gBjzsdABZp09FjMjtKSGRSHxnARL+QUkMmJzgg139dDl rgr0OwrcUODKXGU/QmKGZMZACvtkrO7z7NYG1H8owtDH6HbQ3aX/1CGZpVC/lFKLDTaX gcPw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=NKUk7uGl; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z7si2386219ejr.99.2019.09.27.02.37.27; Fri, 27 Sep 2019 02:37:27 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=NKUk7uGl; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727198AbfI0Jh0 (ORCPT + 26 others); Fri, 27 Sep 2019 05:37:26 -0400 Received: from conuserg-07.nifty.com ([210.131.2.74]:33056 "EHLO conuserg-07.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726339AbfI0JhB (ORCPT ); Fri, 27 Sep 2019 05:37:01 -0400 Received: from localhost.localdomain (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-07.nifty.com with ESMTP id x8R9a5ud001372; Fri, 27 Sep 2019 18:36:09 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-07.nifty.com x8R9a5ud001372 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1569576969; bh=Fynp0G6evPgfPqhsg7r4WZQkR9spuRzwJdxpkYdeONU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=NKUk7uGll+V8LdUDPB1GVeeJOolszILWQCZ7SBQwkVdpbGuFn/6kDpUjNB0/QnynN 2qtuscgntP19CTgrkmvl5MSiiiCNBM8MTMvqvOQ4ZMK6qxLZECMooRQMg6/8GhwHCg 4qU/g9rGsuM3KtYDnkAKAF8mdbt1DU2+OHsXQWxPZbNlhE1f7JA0E0NXhTwlDXPVww 4avl6+5iYDzdjgiBkx4qQI4Jn3n3WKQrBxF1+7k8g8hxJW9+fKH4EYxiht2YQCla4r xGD/ItNo3FzzIpks94EAkkrKdxQaT80bh4XJSdYX5FJ+9Eyq/pDWRgWKZzoce+x0d1 X55tIS908scnw== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: Jessica Yu Cc: Matthias Maennich , Greg Kroah-Hartman , Joel Fernandes , Martijn Coenen , Will Deacon , Masahiro Yamada , Will Deacon , linux-kernel@vger.kernel.org Subject: [PATCH 3/7] module: rename __kstrtab_ns_* to __kstrtabns_* to avoid symbol conflict Date: Fri, 27 Sep 2019 18:35:59 +0900 Message-Id: <20190927093603.9140-4-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190927093603.9140-1-yamada.masahiro@socionext.com> References: <20190927093603.9140-1-yamada.masahiro@socionext.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The module namespace produces __strtab_ns_ symbols to store namespace strings, but it does not guarantee the name uniqueness. This is a potential problem because we have exported symbols staring with "ns_". For example, kernel/capability.c exports the following symbols: EXPORT_SYMBOL(ns_capable); EXPORT_SYMBOL(capable); Assume a situation where those are converted as follows: EXPORT_SYMBOL_NS(ns_capable, some_namespace); EXPORT_SYMBOL_NS(capable, some_namespace); The former expands to "__kstrtab_ns_capable" and "__kstrtab_ns_ns_capable", and the latter to "__kstrtab_capable" and "__kstrtab_ns_capable". Then, we have the duplication for "__kstrtab_ns_capable". To ensure the uniqueness, rename "__kstrtab_ns_*" to "__kstrtabns_*". Signed-off-by: Masahiro Yamada --- include/linux/export.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) -- 2.17.1 Reviewed-by: Matthias Maennich diff --git a/include/linux/export.h b/include/linux/export.h index 0695d4e847d9..621158ecd2e2 100644 --- a/include/linux/export.h +++ b/include/linux/export.h @@ -55,7 +55,7 @@ extern struct module __this_module; "__ksymtab_" #ns NS_SEPARATOR #sym ": \n" \ " .long " #sym "- . \n" \ " .long __kstrtab_" #sym "- . \n" \ - " .long __kstrtab_ns_" #sym "- . \n" \ + " .long __kstrtabns_" #sym "- . \n" \ " .previous \n") #define __KSYMTAB_ENTRY(sym, sec) \ @@ -79,7 +79,7 @@ struct kernel_symbol { asm("__ksymtab_" #ns NS_SEPARATOR #sym) \ __attribute__((section("___ksymtab" sec "+" #sym), used)) \ __aligned(sizeof(void *)) \ - = { (unsigned long)&sym, __kstrtab_##sym, __kstrtab_ns_##sym } + = { (unsigned long)&sym, __kstrtab_##sym, __kstrtabns_##sym } #define __KSYMTAB_ENTRY(sym, sec) \ static const struct kernel_symbol __ksymtab_##sym \ @@ -112,7 +112,7 @@ struct kernel_symbol { /* For every exported symbol, place a struct in the __ksymtab section */ #define ___EXPORT_SYMBOL_NS(sym, sec, ns) \ ___export_symbol_common(sym, sec); \ - static const char __kstrtab_ns_##sym[] \ + static const char __kstrtabns_##sym[] \ __attribute__((section("__ksymtab_strings"), used, aligned(1))) \ = #ns; \ __KSYMTAB_ENTRY_NS(sym, sec, ns)