lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAK7LNATaf=HyCBhZu-CPCGDG6PqHDVMXJFaiygBH3s-BmZE8tA@mail.gmail.com>
Date: Fri, 7 Feb 2025 17:09:45 +0900
From: Masahiro Yamada <masahiroy@...nel.org>
To: Peter Zijlstra <peterz@...radead.org>
Cc: mcgrof@...nel.org, x86@...nel.org, hpa@...or.com, petr.pavlu@...e.com, 
	samitolvanen@...gle.com, da.gomez@...sung.com, nathan@...nel.org, 
	nicolas@...sle.eu, linux-kernel@...r.kernel.org, 
	linux-modules@...r.kernel.org, linux-kbuild@...r.kernel.org, 
	hch@...radead.org, gregkh@...uxfoundation.org
Subject: Re: [PATCH -v2 7/7] module: Provide EXPORT_SYMBOL_GPL_FOR() helper

On Tue, Dec 3, 2024 at 12:11 AM Peter Zijlstra <peterz@...radead.org> wrote:
>

Commit description is needed.


[bikeshed]
Perhaps, I slightly prefer EXPORT_SYMBOL_GPL_FOR_MODULES().




>
> -#define ___EXPORT_SYMBOL(sym, license, ns)             \
> +/*
> + * LLVM intregrated assembler refuses to merge adjacent string literals (like

 "intregrated"  is a typo.




> + * C and GNU-as) and chokes on:
> + *
> + *   .asciz "MODULE_" "kvm" ;
> + *
> + * As would be generated when using EXPORT_SYMBOL_GPL_FOR(foo, "kvm"), use
> + * varargs to assemble it like so:
> + *
> + *   .ascii "MODULE_", "kvm", "\0" ;


But, you do not need  comma separators, right?



The following less-invasive diff worked for me with LLVM=1.



diff --git a/include/linux/export.h b/include/linux/export.h
index a8c23d945634..546279f4d0c2 100644
--- a/include/linux/export.h
+++ b/include/linux/export.h
@@ -24,11 +24,17 @@
        .long sym
 #endif

+/*
+ * LLVM integrated assembler can merge adjacent string literals (like
+ * C and GNU-as) passed to '.ascii', but not to '.asciz' and chokes on:
+ *
+ *   .asciz "MODULE_" "kvm" ;
+ */
 #define ___EXPORT_SYMBOL(sym, license, ns)             \
        .section ".export_symbol","a"           ASM_NL  \
        __export_symbol_##sym:                  ASM_NL  \
                .asciz license                  ASM_NL  \
-               .asciz ns                       ASM_NL  \
+               .ascii ns "\0"                  ASM_NL  \
                __EXPORT_SYMBOL_REF(sym)        ASM_NL  \
        .previous

@@ -85,4 +91,6 @@
 #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_GPL_FOR(sym, mods) __EXPORT_SYMBOL(sym, "GPL",
"MODULE_" mods)
+






-- 
Best Regards
Masahiro Yamada

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ