From: Matthias Maennich <maennich@google.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: linux-kernel@vger.kernel.org, Miroslav Benes <mbenes@suse.cz>,
Emil Velikov <emil.l.velikov@gmail.com>,
Jessica Yu <jeyu@kernel.org>, Quentin Perret <qperret@google.com>,
Masahiro Yamada <yamada.masahiro@socionext.com>
Subject: Re: [PATCH] export: fix string handling of namespace in EXPORT_SYMBOL_NS
Date: Mon, 10 Jan 2022 17:38:54 +0000 [thread overview]
Message-ID: <YdxvLkrVJA/oXyhM@google.com> (raw)
In-Reply-To: <20220108140415.3360088-1-gregkh@linuxfoundation.org>
On Sat, Jan 08, 2022 at 03:04:15PM +0100, Greg Kroah-Hartman wrote:
>Commit c3a6cf19e695 ("export: avoid code duplication in
>include/linux/export.h") broke the ability for a defined string to be
>used as a namespace value. Fix this up by adding another layer of
>indirection to preserve the previous functionality.
>
>Fixes: c3a6cf19e695 ("export: avoid code duplication in include/linux/export.h")
>Cc: Miroslav Benes <mbenes@suse.cz>
>Cc: Emil Velikov <emil.l.velikov@gmail.com>
>Cc: Jessica Yu <jeyu@kernel.org>
>Cc: Quentin Perret <qperret@google.com>
>Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
>Cc: Matthias Maennich <maennich@google.com>
>Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Reviewed-by: Matthias Maennich <maennich@google.com>
Cheers,
Matthias
>---
>Note, I found this while forward porting an out-of-tree Android kernel
>patch from 5.4 to 5.10 that used module namespaces to help wall-off vfs
>symbols from being used by non-filesystem modules. This issue does not
>affect any in-kernel code, so I am not so sure if it really is needed
>here, but it does restore the previous functionality that was being used
>in older kernels so it might be good to put back in case others want to
>do much the same thing.
>
> include/linux/export.h | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
>
>diff --git a/include/linux/export.h b/include/linux/export.h
>index 27d848712b90..9a992809f57d 100644
>--- a/include/linux/export.h
>+++ b/include/linux/export.h
>@@ -162,8 +162,10 @@ struct kernel_symbol {
>
> #define EXPORT_SYMBOL(sym) _EXPORT_SYMBOL(sym, "")
> #define EXPORT_SYMBOL_GPL(sym) _EXPORT_SYMBOL(sym, "_gpl")
>-#define EXPORT_SYMBOL_NS(sym, ns) __EXPORT_SYMBOL(sym, "", #ns)
>-#define EXPORT_SYMBOL_NS_GPL(sym, ns) __EXPORT_SYMBOL(sym, "_gpl", #ns)
>+#define _EXPORT_SYMBOL_NS(sym, ns) __EXPORT_SYMBOL(sym, "", #ns)
>+#define _EXPORT_SYMBOL_NS_GPL(sym, ns) __EXPORT_SYMBOL(sym, "_gpl", #ns)
>+#define EXPORT_SYMBOL_NS(sym, ns) _EXPORT_SYMBOL_NS(sym, ns)
>+#define EXPORT_SYMBOL_NS_GPL(sym, ns) _EXPORT_SYMBOL_NS_GPL(sym, ns)
>
> #endif /* !__ASSEMBLY__ */
>
>--
>2.34.1
>
next prev parent reply other threads:[~2022-01-10 17:39 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-01-08 14:04 [PATCH] export: fix string handling of namespace in EXPORT_SYMBOL_NS Greg Kroah-Hartman
2022-01-10 17:38 ` Matthias Maennich [this message]
2022-01-11 19:14 ` Masahiro Yamada
2022-04-27 8:42 ` Greg Kroah-Hartman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=YdxvLkrVJA/oXyhM@google.com \
--to=maennich@google.com \
--cc=emil.l.velikov@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=jeyu@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mbenes@suse.cz \
--cc=qperret@google.com \
--cc=yamada.masahiro@socionext.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox