* [PATCH] rust: fix typo in bindings
@ 2026-01-13 19:29 Lorenzo Stoakes
2026-01-13 19:31 ` Alice Ryhl
` (3 more replies)
0 siblings, 4 replies; 8+ messages in thread
From: Lorenzo Stoakes @ 2026-01-13 19:29 UTC (permalink / raw)
To: Miguel Ojeda
Cc: Boqun Feng, Gary Guo, Björn Roy Baron, Benno Lossin,
Andreas Hindborg, Alice Ryhl, Trevor Gross, Danilo Krummrich,
rust-for-linux, linux-mm, linux-kernel, Chris Mason
Commit 2b6a3f061f11 ("mm: declare VMA flags by bit") added a number of
overrides to the rust bindings helper as the change performed in the commit
caused the rust binder to not be able to automatically determine values of
VMA flags.
However a typo was introduced leaving VM_MAYSHARE to be incorrectly
interpreted as VM_MAYEXEC in rust code. This patch fixes the typo.
Fixes: 2b6a3f061f11 ("mm: declare VMA flags by bit")
Reported-by: Chris Mason <clm@meta.com>
Closes: https://lore.kernel.org/all/20260113185142.254821-1-clm@meta.com/
Cc: <stable@vger.kernel.org>
Signed-off-by: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
---
rust/bindings/bindings_helper.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/rust/bindings/bindings_helper.h b/rust/bindings/bindings_helper.h
index a067038b4b42..25a8f24f292a 100644
--- a/rust/bindings/bindings_helper.h
+++ b/rust/bindings/bindings_helper.h
@@ -126,7 +126,7 @@ const vm_flags_t RUST_CONST_HELPER_VM_SHARED = VM_SHARED;
const vm_flags_t RUST_CONST_HELPER_VM_MAYREAD = VM_MAYREAD;
const vm_flags_t RUST_CONST_HELPER_VM_MAYWRITE = VM_MAYWRITE;
const vm_flags_t RUST_CONST_HELPER_VM_MAYEXEC = VM_MAYEXEC;
-const vm_flags_t RUST_CONST_HELPER_VM_MAYSHARE = VM_MAYEXEC;
+const vm_flags_t RUST_CONST_HELPER_VM_MAYSHARE = VM_MAYSHARE;
const vm_flags_t RUST_CONST_HELPER_VM_PFNMAP = VM_PFNMAP;
const vm_flags_t RUST_CONST_HELPER_VM_IO = VM_IO;
const vm_flags_t RUST_CONST_HELPER_VM_DONTCOPY = VM_DONTCOPY;
--
2.52.0
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] rust: fix typo in bindings
2026-01-13 19:29 [PATCH] rust: fix typo in bindings Lorenzo Stoakes
@ 2026-01-13 19:31 ` Alice Ryhl
2026-01-14 1:24 ` wang lian
` (2 subsequent siblings)
3 siblings, 0 replies; 8+ messages in thread
From: Alice Ryhl @ 2026-01-13 19:31 UTC (permalink / raw)
To: Lorenzo Stoakes
Cc: Miguel Ojeda, Boqun Feng, Gary Guo, Björn Roy Baron,
Benno Lossin, Andreas Hindborg, Trevor Gross, Danilo Krummrich,
rust-for-linux, linux-mm, linux-kernel, Chris Mason
On Tue, Jan 13, 2026 at 8:30 PM Lorenzo Stoakes
<lorenzo.stoakes@oracle.com> wrote:
>
> Commit 2b6a3f061f11 ("mm: declare VMA flags by bit") added a number of
> overrides to the rust bindings helper as the change performed in the commit
> caused the rust binder to not be able to automatically determine values of
> VMA flags.
>
> However a typo was introduced leaving VM_MAYSHARE to be incorrectly
> interpreted as VM_MAYEXEC in rust code. This patch fixes the typo.
>
> Fixes: 2b6a3f061f11 ("mm: declare VMA flags by bit")
> Reported-by: Chris Mason <clm@meta.com>
> Closes: https://lore.kernel.org/all/20260113185142.254821-1-clm@meta.com/
> Cc: <stable@vger.kernel.org>
> Signed-off-by: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
Reviewed-by: Alice Ryhl <aliceryhl@google.com>
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] rust: fix typo in bindings
2026-01-13 19:29 [PATCH] rust: fix typo in bindings Lorenzo Stoakes
2026-01-13 19:31 ` Alice Ryhl
@ 2026-01-14 1:24 ` wang lian
2026-01-14 1:43 ` Gary Guo
2026-09-17 4:14 ` Chunfeng Song
3 siblings, 0 replies; 8+ messages in thread
From: wang lian @ 2026-01-14 1:24 UTC (permalink / raw)
To: lorenzo.stoakes
Cc: a.hindborg, aliceryhl, bjorn3_gh, boqun.feng, clm, dakr, gary,
linux-kernel, linux-mm, lossin, ojeda, rust-for-linux, tmgross,
wang lian
>
> Commit 2b6a3f061f11 ("mm: declare VMA flags by bit") added a number of
> overrides to the rust bindings helper as the change performed in the commit
> caused the rust binder to not be able to automatically determine values of
> VMA flags.
>
> However a typo was introduced leaving VM_MAYSHARE to be incorrectly
> interpreted as VM_MAYEXEC in rust code. This patch fixes the typo.
>
> Fixes: 2b6a3f061f11 ("mm: declare VMA flags by bit")
> Reported-by: Chris Mason <clm@meta.com>
> Closes: https://lore.kernel.org/all/20260113185142.254821-1-clm@meta.com/
> Cc: <stable@vger.kernel.org>
> Signed-off-by: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
LGTM.
Reviewed-by: wang lian <lianux.mm@gmail.com>
--
Best Regards,
wang lian
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] rust: fix typo in bindings
2026-01-13 19:29 [PATCH] rust: fix typo in bindings Lorenzo Stoakes
2026-01-13 19:31 ` Alice Ryhl
2026-01-14 1:24 ` wang lian
@ 2026-01-14 1:43 ` Gary Guo
2026-09-17 4:14 ` Chunfeng Song
3 siblings, 0 replies; 8+ messages in thread
From: Gary Guo @ 2026-01-14 1:43 UTC (permalink / raw)
To: Lorenzo Stoakes, Miguel Ojeda
Cc: Boqun Feng, Gary Guo, Björn Roy Baron, Benno Lossin,
Andreas Hindborg, Alice Ryhl, Trevor Gross, Danilo Krummrich,
rust-for-linux, linux-mm, linux-kernel, Chris Mason
On Tue Jan 13, 2026 at 7:29 PM GMT, Lorenzo Stoakes wrote:
> Commit 2b6a3f061f11 ("mm: declare VMA flags by bit") added a number of
> overrides to the rust bindings helper as the change performed in the commit
> caused the rust binder to not be able to automatically determine values of
> VMA flags.
>
> However a typo was introduced leaving VM_MAYSHARE to be incorrectly
> interpreted as VM_MAYEXEC in rust code. This patch fixes the typo.
>
> Fixes: 2b6a3f061f11 ("mm: declare VMA flags by bit")
> Reported-by: Chris Mason <clm@meta.com>
> Closes: https://lore.kernel.org/all/20260113185142.254821-1-clm@meta.com/
> Cc: <stable@vger.kernel.org>
> Signed-off-by: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
Reviewed-by: Gary Guo <gary@garyguo.net>
> ---
> rust/bindings/bindings_helper.h | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] rust: fix typo in bindings
2026-01-13 19:29 [PATCH] rust: fix typo in bindings Lorenzo Stoakes
` (2 preceding siblings ...)
2026-01-14 1:43 ` Gary Guo
@ 2026-09-17 4:14 ` Chunfeng Song
2026-09-20 20:54 ` Miguel Ojeda
3 siblings, 1 reply; 8+ messages in thread
From: Chunfeng Song @ 2026-09-17 4:14 UTC (permalink / raw)
To: Lorenzo Stoakes, Miguel Ojeda
Cc: Boqun Feng, Gary Guo, Alice Ryhl, wang lian, Chris Mason,
rust-for-linux, linux-kernel
Hi Lorenzo,
This does not appear to have been picked up -- torvalds/master still carries
the typo as of 238650ef6c7c.
I ran into it while auditing a Rust driver port, and can add a couple of data
points that may help judge whether it is worth taking:
- rust/bindings/bindings_helper.h is architecture independent, so this is
not specific to one configuration or architecture: both the arm64 and the
x86 bindings publish the wrong value.
- It is observable end to end. bindings_generated.rs contains
pub const VM_MAYSHARE: vm_flags_t = 64;
which is VM_MAYEXEC (bit 6), while include/linux/mm.h has
DECLARE_VMA_BIT(MAYSHARE, 7), i.e. 128. Asking the C compiler directly,
with a driver's own flags, returns VM_MAYSHARE == 128 as well. So any Rust
code reading bindings::VM_MAYSHARE silently gets VM_MAYEXEC instead.
Since the fix already has three Reviewed-by tags, I assume it just fell
through the cracks. Would a resend help? I am happy to send one -- I just did
not want to post a duplicate of your patch without checking with you first.
Thanks,
Chunfeng
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] rust: fix typo in bindings
2026-09-17 4:14 ` Chunfeng Song
@ 2026-09-20 20:54 ` Miguel Ojeda
2026-09-20 21:13 ` Miguel Ojeda
0 siblings, 1 reply; 8+ messages in thread
From: Miguel Ojeda @ 2026-09-20 20:54 UTC (permalink / raw)
To: Chunfeng Song
Cc: Lorenzo Stoakes, Miguel Ojeda, Boqun Feng, Gary Guo, Alice Ryhl,
wang lian, Chris Mason, rust-for-linux, linux-kernel
On Thu, Sep 17, 2026 at 6:15 AM Chunfeng Song
<springbreeze@stu.pku.edu.cn> wrote:
>
> Since the fix already has three Reviewed-by tags, I assume it just fell
> through the cracks. Would a resend help? I am happy to send one -- I just did
> not want to post a duplicate of your patch without checking with you first.
I am happy to pick it up as well.
Cheers,
Miguel
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] rust: fix typo in bindings
2026-09-20 20:54 ` Miguel Ojeda
@ 2026-09-20 21:13 ` Miguel Ojeda
2026-09-24 8:25 ` Alice Ryhl
0 siblings, 1 reply; 8+ messages in thread
From: Miguel Ojeda @ 2026-09-20 21:13 UTC (permalink / raw)
To: Chunfeng Song, Lorenzo Stoakes, Chris Mason
Cc: Miguel Ojeda, Boqun Feng, Gary Guo, Alice Ryhl, wang lian,
rust-for-linux, linux-kernel
On Sun, Sep 20, 2026 at 10:54 PM Miguel Ojeda
<miguel.ojeda.sandonis@gmail.com> wrote:
>
> On Thu, Sep 17, 2026 at 6:15 AM Chunfeng Song
> <springbreeze@stu.pku.edu.cn> wrote:
> >
> > Since the fix already has three Reviewed-by tags, I assume it just fell
> > through the cracks. Would a resend help? I am happy to send one -- I just did
> > not want to post a duplicate of your patch without checking with you first.
>
> I am happy to pick it up as well.
Cc'ing new addresses for you since I got some bounces -- hopefully that helps :)
Cheers,
Miguel
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] rust: fix typo in bindings
2026-09-20 21:13 ` Miguel Ojeda
@ 2026-09-24 8:25 ` Alice Ryhl
0 siblings, 0 replies; 8+ messages in thread
From: Alice Ryhl @ 2026-09-24 8:25 UTC (permalink / raw)
To: Miguel Ojeda
Cc: Chunfeng Song, Lorenzo Stoakes, Chris Mason, Miguel Ojeda,
Boqun Feng, Gary Guo, wang lian, rust-for-linux, linux-kernel
On Sun, Sep 20, 2026 at 10:13:41PM +0100, Miguel Ojeda wrote:
> On Sun, Sep 20, 2026 at 10:54 PM Miguel Ojeda
> <miguel.ojeda.sandonis@gmail.com> wrote:
> >
> > On Thu, Sep 17, 2026 at 6:15 AM Chunfeng Song
> > <springbreeze@stu.pku.edu.cn> wrote:
> > >
> > > Since the fix already has three Reviewed-by tags, I assume it just fell
> > > through the cracks. Would a resend help? I am happy to send one -- I just did
> > > not want to post a duplicate of your patch without checking with you first.
> >
> > I am happy to pick it up as well.
>
> Cc'ing new addresses for you since I got some bounces -- hopefully that helps :)
It'd be fine if you took it, thanks.
Alice
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2026-09-24 8:25 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-01-13 19:29 [PATCH] rust: fix typo in bindings Lorenzo Stoakes
2026-01-13 19:31 ` Alice Ryhl
2026-01-14 1:24 ` wang lian
2026-01-14 1:43 ` Gary Guo
2026-09-17 4:14 ` Chunfeng Song
2026-09-20 20:54 ` Miguel Ojeda
2026-09-20 21:13 ` Miguel Ojeda
2026-09-24 8:25 ` Alice Ryhl
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®