* [PATCH] rust: macros: allow non-ASCII characters in `authors`
@ 2026-09-17 5:11 Thiébaud Weksteen
2026-09-17 7:20 ` Gary Guo
0 siblings, 1 reply; 4+ messages in thread
From: Thiébaud Weksteen @ 2026-09-17 5:11 UTC (permalink / raw)
To: Miguel Ojeda, Alice Ryhl
Cc: rust-for-linux, linux-modules, linux-kernel, Thiébaud Weksteen
Module authors may have non-ASCII characters in their names. In C,
`MODULE_AUTHOR` allows arbitrary string literals which are emitted as
raw UTF-8 bytes into the `.modinfo` section, and multiple in-tree
modules use non-ASCII author names.
Originally, the single `author` field permitted arbitrary string literals
including non-ASCII characters. When support for multiple authors was
introduced in commit 38559da6afb2 ("rust: module: introduce `authors`
key"), it reused the `expect_string_array` helper that had originally been
added for module aliases. Because that helper enforced an ASCII check,
`authors` inadvertently became restricted to ASCII-only string literals.
Later, when the macro parsing was rewritten to use `syn` in commit
c578ad703ae9 ("rust: macros: use `syn` to parse `module!` macro"), this
restriction was carried over by using AsciiLitStr in `authors` type.
Change the element type of `authors` in `ModuleInfo` from `AsciiLitStr`
to `LitStr` so that UTF-8 author names are permitted.
Fixes: 38559da6afb2 ("rust: module: introduce `authors` key")
Signed-off-by: Thiébaud Weksteen <tweek@google.com>
---
rust/macros/lib.rs | 2 +-
rust/macros/module.rs | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/rust/macros/lib.rs b/rust/macros/lib.rs
index 24f96feaeb34..ea2e232b61b1 100644
--- a/rust/macros/lib.rs
+++ b/rust/macros/lib.rs
@@ -129,7 +129,7 @@
/// # Supported argument types
/// - `type`: type which implements the [`Module`] trait (required).
/// - `name`: ASCII string literal of the name of the kernel module (required).
-/// - `authors`: array of ASCII string literals of the authors of the kernel module.
+/// - `authors`: array of string literals of the authors of the kernel module.
/// - `description`: string literal of the description of the kernel module.
/// - `license`: ASCII string literal of the license of the kernel module (required).
/// - `alias`: array of ASCII string literals of the alias names of the kernel module.
diff --git a/rust/macros/module.rs b/rust/macros/module.rs
index bc7027f8dbb2..0a7b9e24c960 100644
--- a/rust/macros/module.rs
+++ b/rust/macros/module.rs
@@ -369,7 +369,7 @@ pub(crate) struct ModuleInfo {
type_: Type,
license: AsciiLitStr,
name: AsciiLitStr,
- authors: Option<Punctuated<AsciiLitStr, Token![,]>>,
+ authors: Option<Punctuated<LitStr, Token![,]>>,
description: Option<LitStr>,
alias: Option<Punctuated<AsciiLitStr, Token![,]>>,
firmware: Option<Punctuated<AsciiLitStr, Token![,]>>,
--
2.55.0.1082.g2b9226bbc0-goog
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH] rust: macros: allow non-ASCII characters in `authors`
2026-09-17 5:11 [PATCH] rust: macros: allow non-ASCII characters in `authors` Thiébaud Weksteen
@ 2026-09-17 7:20 ` Gary Guo
2026-09-25 12:36 ` Petr Pavlu
0 siblings, 1 reply; 4+ messages in thread
From: Gary Guo @ 2026-09-17 7:20 UTC (permalink / raw)
To: Thiébaud Weksteen, Miguel Ojeda, Alice Ryhl
Cc: rust-for-linux, linux-modules, linux-kernel
On Thu Sep 17, 2026 at 6:11 AM BST, =?UTF-8?q?Thi=C3=A9baud=20Weksteen?= wrote:
> Module authors may have non-ASCII characters in their names. In C,
> `MODULE_AUTHOR` allows arbitrary string literals which are emitted as
> raw UTF-8 bytes into the `.modinfo` section, and multiple in-tree
> modules use non-ASCII author names.
>
> Originally, the single `author` field permitted arbitrary string literals
> including non-ASCII characters. When support for multiple authors was
> introduced in commit 38559da6afb2 ("rust: module: introduce `authors`
> key"), it reused the `expect_string_array` helper that had originally been
> added for module aliases. Because that helper enforced an ASCII check,
> `authors` inadvertently became restricted to ASCII-only string literals.
> Later, when the macro parsing was rewritten to use `syn` in commit
> c578ad703ae9 ("rust: macros: use `syn` to parse `module!` macro"), this
> restriction was carried over by using AsciiLitStr in `authors` type.
>
> Change the element type of `authors` in `ModuleInfo` from `AsciiLitStr`
> to `LitStr` so that UTF-8 author names are permitted.
>
> Fixes: 38559da6afb2 ("rust: module: introduce `authors` key")
> Signed-off-by: Thiébaud Weksteen <tweek@google.com>
Off topic, but I have a question for modules maintainers...
Does the `authors` field still serve this purpose today?
Almost always it is just the initial submitter, while the code has been subject
to many changes (many of them tree wide too), and the maintainers could have
changed as well.
We have copyright comments on top of files, and git for checking the file
history. What's the point of keeping his inside module metadata?
Best,
Gary
> ---
> rust/macros/lib.rs | 2 +-
> rust/macros/module.rs | 2 +-
> 2 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/rust/macros/lib.rs b/rust/macros/lib.rs
> index 24f96feaeb34..ea2e232b61b1 100644
> --- a/rust/macros/lib.rs
> +++ b/rust/macros/lib.rs
> @@ -129,7 +129,7 @@
> /// # Supported argument types
> /// - `type`: type which implements the [`Module`] trait (required).
> /// - `name`: ASCII string literal of the name of the kernel module (required).
> -/// - `authors`: array of ASCII string literals of the authors of the kernel module.
> +/// - `authors`: array of string literals of the authors of the kernel module.
> /// - `description`: string literal of the description of the kernel module.
> /// - `license`: ASCII string literal of the license of the kernel module (required).
> /// - `alias`: array of ASCII string literals of the alias names of the kernel module.
> diff --git a/rust/macros/module.rs b/rust/macros/module.rs
> index bc7027f8dbb2..0a7b9e24c960 100644
> --- a/rust/macros/module.rs
> +++ b/rust/macros/module.rs
> @@ -369,7 +369,7 @@ pub(crate) struct ModuleInfo {
> type_: Type,
> license: AsciiLitStr,
> name: AsciiLitStr,
> - authors: Option<Punctuated<AsciiLitStr, Token![,]>>,
> + authors: Option<Punctuated<LitStr, Token![,]>>,
> description: Option<LitStr>,
> alias: Option<Punctuated<AsciiLitStr, Token![,]>>,
> firmware: Option<Punctuated<AsciiLitStr, Token![,]>>,
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH] rust: macros: allow non-ASCII characters in `authors`
2026-09-17 7:20 ` Gary Guo
@ 2026-09-25 12:36 ` Petr Pavlu
2026-09-25 12:49 ` Gary Guo
0 siblings, 1 reply; 4+ messages in thread
From: Petr Pavlu @ 2026-09-25 12:36 UTC (permalink / raw)
To: Gary Guo
Cc: Thiébaud Weksteen, Miguel Ojeda, Alice Ryhl, rust-for-linux,
linux-modules, linux-kernel
On 9/17/26 9:20 AM, Gary Guo wrote:
> On Thu Sep 17, 2026 at 6:11 AM BST, =?UTF-8?q?Thi=C3=A9baud=20Weksteen?= wrote:
>> Module authors may have non-ASCII characters in their names. In C,
>> `MODULE_AUTHOR` allows arbitrary string literals which are emitted as
>> raw UTF-8 bytes into the `.modinfo` section, and multiple in-tree
>> modules use non-ASCII author names.
>>
>> Originally, the single `author` field permitted arbitrary string literals
>> including non-ASCII characters. When support for multiple authors was
>> introduced in commit 38559da6afb2 ("rust: module: introduce `authors`
>> key"), it reused the `expect_string_array` helper that had originally been
>> added for module aliases. Because that helper enforced an ASCII check,
>> `authors` inadvertently became restricted to ASCII-only string literals.
>> Later, when the macro parsing was rewritten to use `syn` in commit
>> c578ad703ae9 ("rust: macros: use `syn` to parse `module!` macro"), this
>> restriction was carried over by using AsciiLitStr in `authors` type.
>>
>> Change the element type of `authors` in `ModuleInfo` from `AsciiLitStr`
>> to `LitStr` so that UTF-8 author names are permitted.
>>
>> Fixes: 38559da6afb2 ("rust: module: introduce `authors` key")
>> Signed-off-by: Thiébaud Weksteen <tweek@google.com>
>
> Off topic, but I have a question for modules maintainers...
>
> Does the `authors` field still serve this purpose today?
>
> Almost always it is just the initial submitter, while the code has been subject
> to many changes (many of them tree wide too), and the maintainers could have
> changed as well.
>
> We have copyright comments on top of files, and git for checking the file
> history. What's the point of keeping his inside module metadata?
MODULE_AUTHOR() was apparently added in 2.1.18 back in 1996 [1], with
a comment that it is for documentation purposes.
I don't have a full picture of how this modinfo field is currently used
by module authors, maintainers and users. I think it can be useful as
a record of all past and present primary authors of a specific module,
and it has also value for external modules. Unlike copyright statements
and Git history, the information is directly visible to users through
the modinfo utility.
It is up to individual module maintainers whether they want to use this
field and maintain its information. The module loader doesn't enforce
its setting in any way.
[1] https://git.kernel.org/pub/scm/linux/kernel/git/mpe/linux-fullhistory.git/commit/?id=e69db0c2dafd9206cdc859b0361c6d4f07d77676
--
Cheers,
Petr
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH] rust: macros: allow non-ASCII characters in `authors`
2026-09-25 12:36 ` Petr Pavlu
@ 2026-09-25 12:49 ` Gary Guo
0 siblings, 0 replies; 4+ messages in thread
From: Gary Guo @ 2026-09-25 12:49 UTC (permalink / raw)
To: Petr Pavlu, Gary Guo
Cc: Thiébaud Weksteen, Miguel Ojeda, Alice Ryhl, rust-for-linux,
linux-modules, linux-kernel
On Fri Sep 25, 2026 at 1:36 PM BST, Petr Pavlu wrote:
> On 9/17/26 9:20 AM, Gary Guo wrote:
>> On Thu Sep 17, 2026 at 6:11 AM BST, =?UTF-8?q?Thi=C3=A9baud=20Weksteen?= wrote:
>>> Module authors may have non-ASCII characters in their names. In C,
>>> `MODULE_AUTHOR` allows arbitrary string literals which are emitted as
>>> raw UTF-8 bytes into the `.modinfo` section, and multiple in-tree
>>> modules use non-ASCII author names.
>>>
>>> Originally, the single `author` field permitted arbitrary string literals
>>> including non-ASCII characters. When support for multiple authors was
>>> introduced in commit 38559da6afb2 ("rust: module: introduce `authors`
>>> key"), it reused the `expect_string_array` helper that had originally been
>>> added for module aliases. Because that helper enforced an ASCII check,
>>> `authors` inadvertently became restricted to ASCII-only string literals.
>>> Later, when the macro parsing was rewritten to use `syn` in commit
>>> c578ad703ae9 ("rust: macros: use `syn` to parse `module!` macro"), this
>>> restriction was carried over by using AsciiLitStr in `authors` type.
>>>
>>> Change the element type of `authors` in `ModuleInfo` from `AsciiLitStr`
>>> to `LitStr` so that UTF-8 author names are permitted.
>>>
>>> Fixes: 38559da6afb2 ("rust: module: introduce `authors` key")
>>> Signed-off-by: Thiébaud Weksteen <tweek@google.com>
>>
>> Off topic, but I have a question for modules maintainers...
>>
>> Does the `authors` field still serve this purpose today?
>>
>> Almost always it is just the initial submitter, while the code has been subject
>> to many changes (many of them tree wide too), and the maintainers could have
>> changed as well.
>>
>> We have copyright comments on top of files, and git for checking the file
>> history. What's the point of keeping his inside module metadata?
>
> MODULE_AUTHOR() was apparently added in 2.1.18 back in 1996 [1], with
> a comment that it is for documentation purposes.
I am pretty sure the kernel changed a lot since then :)
>
> I don't have a full picture of how this modinfo field is currently used
> by module authors, maintainers and users. I think it can be useful as
> a record of all past and present primary authors of a specific module,
Well, if they're actually updated... But as pointed out that this was usually
not the case.
> and it has also value for external modules.
The version field has value for external modules too, but that was recently
removed. I don't think we should care about external modules too much.
> Unlike copyright statements
> and Git history, the information is directly visible to users through
> the modinfo utility.
Hmm, why does the user want to know who is the primary author of a module?
Users shouldn't try to contact the authors anyway, they should find the current
maintainers...
Even if the field is perfectly up-to-date, a user running an older kernel should
still not use this field as they need to contact the current mainline maintainer
if they have issues.
I just find this info to be hardly useful at all.
Best,
Gary
>
> It is up to individual module maintainers whether they want to use this
> field and maintain its information. The module loader doesn't enforce
> its setting in any way.
>
> [1] https://git.kernel.org/pub/scm/linux/kernel/git/mpe/linux-fullhistory.git/commit/?id=e69db0c2dafd9206cdc859b0361c6d4f07d77676
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2026-09-25 12:49 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-17 5:11 [PATCH] rust: macros: allow non-ASCII characters in `authors` Thiébaud Weksteen
2026-09-17 7:20 ` Gary Guo
2026-09-25 12:36 ` Petr Pavlu
2026-09-25 12:49 ` Gary Guo
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®