Re: [PATCH] rust: fix typo in bindings

From: Chunfeng Song

Date: Thu Sep 17 2026 - 00:20:53 EST


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