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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20260113185142.254821-1-clm@meta.com>
Date: Tue, 13 Jan 2026 10:51:37 -0800
From: Chris Mason <clm@...a.com>
To: Lorenzo Stoakes <lorenzo.stoakes@...cle.com>
CC: Chris Mason <clm@...a.com>, Andrew Morton <akpm@...ux-foundation.org>,
        Oscar Salvador <osalvador@...e.de>,
        David Hildenbrand <david@...hat.com>,
        "Liam R . Howlett" <Liam.Howlett@...cle.com>,
        Vlastimil Babka
	<vbabka@...e.cz>, Mike Rapoport <rppt@...nel.org>,
        Suren Baghdasaryan
	<surenb@...gle.com>,
        Michal Hocko <mhocko@...e.com>,
        Axel Rasmussen
	<axelrasmussen@...gle.com>,
        Yuanchu Xie <yuanchu@...gle.com>, Wei Xu
	<weixugc@...gle.com>,
        Peter Xu <peterx@...hat.com>, Ingo Molnar
	<mingo@...hat.com>,
        Peter Zijlstra <peterz@...radead.org>,
        Juri Lelli
	<juri.lelli@...hat.com>,
        Vincent Guittot <vincent.guittot@...aro.org>,
        Dietmar Eggemann <dietmar.eggemann@....com>,
        Steven Rostedt
	<rostedt@...dmis.org>, Ben Segall <bsegall@...gle.com>,
        Mel Gorman
	<mgorman@...e.de>,
        Valentin Schneider <vschneid@...hat.com>, Kees Cook
	<kees@...nel.org>,
        Matthew Wilcox <willy@...radead.org>, Jason Gunthorpe
	<jgg@...pe.ca>,
        John Hubbard <jhubbard@...dia.com>, Leon Romanovsky
	<leon@...nel.org>,
        Zi Yan <ziy@...dia.com>, Baolin Wang
	<baolin.wang@...ux.alibaba.com>,
        Nico Pache <npache@...hat.com>, Ryan Roberts
	<ryan.roberts@....com>,
        Dev Jain <dev.jain@....com>, Barry Song
	<baohua@...nel.org>,
        Lance Yang <lance.yang@...ux.dev>, Xu Xin
	<xu.xin16@....com.cn>,
        Chengming Zhou <chengming.zhou@...ux.dev>,
        Jann Horn
	<jannh@...gle.com>, Matthew Brost <matthew.brost@...el.com>,
        Joshua Hahn
	<joshua.hahnjy@...il.com>, Rakie Kim <rakie.kim@...com>,
        Byungchul Park
	<byungchul@...com>, Gregory Price <gourry@...rry.net>,
        Ying Huang
	<ying.huang@...ux.alibaba.com>,
        Alistair Popple <apopple@...dia.com>,
        "Pedro
 Falcato" <pfalcato@...e.de>,
        Shakeel Butt <shakeel.butt@...ux.dev>,
        "David
 Rientjes" <rientjes@...gle.com>,
        Rik van Riel <riel@...riel.com>, Harry Yoo
	<harry.yoo@...cle.com>,
        Kemeng Shi <shikemeng@...weicloud.com>,
        Kairui Song
	<kasong@...cent.com>, Nhat Pham <nphamcs@...il.com>,
        Baoquan He
	<bhe@...hat.com>, Chris Li <chrisl@...nel.org>,
        Johannes Weiner
	<hannes@...xchg.org>,
        Qi Zheng <zhengqi.arch@...edance.com>, <linux-kernel@...r.kernel.org>,
        <linux-fsdevel@...r.kernel.org>, <linux-mm@...ck.org>,
        Miguel Ojeda <ojeda@...nel.org>, Alex Gaynor
	<alex.gaynor@...il.com>,
        Boqun Feng <boqun.feng@...il.com>, Gary Guo
	<gary@...yguo.net>,
        Bjorn Roy Baron <bjorn3_gh@...tonmail.com>,
        Benno Lossin
	<lossin@...nel.org>,
        Andreas Hindborg <a.hindborg@...nel.org>,
        Alice Ryhl
	<aliceryhl@...gle.com>, Trevor Gross <tmgross@...ch.edu>,
        Danilo Krummrich
	<dakr@...nel.org>, <rust-for-linux@...r.kernel.org>
Subject: Re: [PATCH v3 1/4] mm: declare VMA flags by bit

On Tue, 25 Nov 2025 10:00:59 +0000 Lorenzo Stoakes <lorenzo.stoakes@...cle.com> wrote:

[ ... ]
> 
> Finally, we update the rust binding helper as now it cannot auto-detect the
> flags at all.
> 

I did a run of all the MM commits from 6.18 to today's linus, and this one
had a copy/paste error.   I'd normally just send a patch for this, but in
terms of showing the review output:

> diff --git a/rust/bindings/bindings_helper.h b/rust/bindings/bindings_helper.h
> index 2e43c66635a2c..4c327db01ca03 100644
> --- a/rust/bindings/bindings_helper.h
> +++ b/rust/bindings/bindings_helper.h
> @@ -108,7 +108,32 @@ const xa_mark_t RUST_CONST_HELPER_XA_PRESENT = XA_PRESENT;

[ ... ]

> +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;
                                                   ^^^^^^^^^^

Should this be VM_MAYSHARE instead of VM_MAYEXEC? This appears to be a
copy-paste error that would cause Rust code using VmFlags::MAYSHARE to
get bit 6 (VM_MAYEXEC) instead of bit 7 (VM_MAYSHARE).

The pattern of the preceding lines shows each constant should reference
its matching flag:

    RUST_CONST_HELPER_VM_MAYREAD  = VM_MAYREAD
    RUST_CONST_HELPER_VM_MAYWRITE = VM_MAYWRITE
    RUST_CONST_HELPER_VM_MAYEXEC  = VM_MAYEXEC
    RUST_CONST_HELPER_VM_MAYSHARE = VM_MAYSHARE  <- expected

> +const vm_flags_t RUST_CONST_HELPER_VM_PFNMAP = VM_PFNMAP;

[ ... ]



Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ