From patchwork Thu Oct 3 07:58:23 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 175057 Delivered-To: patch@linaro.org Received: by 2002:a92:7e96:0:0:0:0:0 with SMTP id q22csp1855224ill; Thu, 3 Oct 2019 00:59:32 -0700 (PDT) X-Google-Smtp-Source: APXvYqwNRJniRMe3iKwowGM/s9hKxNTZ7UpShqHu1E7URXxuOAxAw+OFLsz4P50iKVwjmsKialoS X-Received: by 2002:a50:eb44:: with SMTP id z4mr7905488edp.207.1570089572430; Thu, 03 Oct 2019 00:59:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570089572; cv=none; d=google.com; s=arc-20160816; b=m9dD98gWDhb3DjP4FMIyK9577zsyVoJvpADcc0Wki7HPsoILIRmAoowsN4cWY3zykU ZM+96d9d6aHfB+dSkpDbUN+gE7Zzp2M2Rq0sTCf8pJOGDq0EaNmrwz0Ot3jZ2y8VPuJK TNOYj24HsYeqxQn3I1bo/HZ5Fzd5KLdal6W5OdJSn8jD+8ItWEiOyEM5ZmSUyUjg3Mxd +Vni0S/m45o048lZUqJJnk8NH8jKr6GMtG7YRnOfrEDh/kjbWW3wG2GTpG6jorN1DqKe 2RmrK2hkpeqm5jQyXdct0bQbnrDk1mOsEsU0/6xtCNRh5hJ7pZXPXsK1CVp5MwEK6CxN jeDQ== 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=120bNVWb/cAQsirkPrw5wuUPD0J6O7LG/eInWnc0GXM=; b=wDRgVDTMBm9QM3Rf9JQnJXDby1a5NbdUchqi53oVYD/tmCv/qUogiaTBurGarxPKUH ZZnBRI/QfExP4TJ9qEMj5hBVlMiPcKut81jiBKeBYnguMxJJX75HVJdftlBnYA9VoWz0 +Rlw9PZjusEuP9sEuqNoLwdlZIc/H3R6UwMpNTsoBGyYmVxY6duTq6I6sHyW501FZG7m pETlxQTd2XsbpgCKmfZ/WZik3igRNjAr1dh/ijxF2icCUImuA6Vpco0/xxnKnbH6JzCB FvsvuEhowz5XI9nGXVYtUF/4IYU5ot3n6Hmr48cYz5rk3meiCccljle9aIu7HNFTN/zp WlOw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=sOufCbPQ; 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 o17si790856ejm.261.2019.10.03.00.59.32; Thu, 03 Oct 2019 00:59:32 -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=sOufCbPQ; 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 S1728682AbfJCH71 (ORCPT + 27 others); Thu, 3 Oct 2019 03:59:27 -0400 Received: from conuserg-11.nifty.com ([210.131.2.78]:59223 "EHLO conuserg-11.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728061AbfJCH7R (ORCPT ); Thu, 3 Oct 2019 03:59:17 -0400 Received: from localhost.localdomain (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-11.nifty.com with ESMTP id x937wTkV007720; Thu, 3 Oct 2019 16:58:32 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-11.nifty.com x937wTkV007720 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1570089512; bh=120bNVWb/cAQsirkPrw5wuUPD0J6O7LG/eInWnc0GXM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=sOufCbPQwtH53jrQ4+SKNS8BTK/E+XQVV/fnQjxwjvk5EUSt/oSWZrt5XQgHu04Yz +dXnPmpBjOZeJgRpfqmsR4OdoiEUmMIzSq/kOO5SoiB1EdqX2XKB3WZxUMamBpaN9v xElB92NZS0pxrpkwlK0EEvIjRMlfaVrXOmATpd+ubKqJUVvc7QEp57uLYEJxzkOqt6 joTmKXLL6IL42K5T511rqnUtMhHiF/HUw/py6SqPqF6uLBzopMEzEEvq4EeKgrHLLn Lf6+lwHVFdpajOGOSHJmWcH+F6yYt5HZK41Ij7ZpZlJJaBSe7jMTKCXvBd9QjsNGU9 N9ehQ6o3sz3FA== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: Jessica Yu Cc: Matthias Maennich , Greg Kroah-Hartman , Shaun Ruffell , linux-kbuild@vger.kernel.org, Masahiro Yamada , Martijn Coenen , Will Deacon , linux-kernel@vger.kernel.org Subject: [PATCH v2 3/6] module: rename __kstrtab_ns_* to __kstrtabns_* to avoid symbol conflict Date: Thu, 3 Oct 2019 16:58:23 +0900 Message-Id: <20191003075826.7478-4-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191003075826.7478-1-yamada.masahiro@socionext.com> References: <20191003075826.7478-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 starting 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 duplicated "__kstrtab_ns_capable". To ensure the uniqueness, rename "__kstrtab_ns_*" to "__kstrtabns_*". Signed-off-by: Masahiro Yamada Reviewed-by: Matthias Maennich --- Changes in v2: None include/linux/export.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) -- 2.17.1 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)