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: <ajiq9UHMeP48LeNuGAPzLS38mW-fCL0OlXZKOCzg1D9H1JSQo2NroOEEjzLuuClpn7b3Do-IuDO8DqAT3z9s8ozEHAdqyGhHXUl0fvUKDDg=@proton.me>
Date:   Fri, 01 Dec 2023 17:37:06 +0000
From:   Benno Lossin <benno.lossin@...ton.me>
To:     David Laight <David.Laight@...LAB.COM>
Cc:     Theodore Ts'o <tytso@....edu>, Alice Ryhl <aliceryhl@...gle.com>,
        "a.hindborg@...sung.com" <a.hindborg@...sung.com>,
        "alex.gaynor@...il.com" <alex.gaynor@...il.com>,
        "arve@...roid.com" <arve@...roid.com>,
        "bjorn3_gh@...tonmail.com" <bjorn3_gh@...tonmail.com>,
        "boqun.feng@...il.com" <boqun.feng@...il.com>,
        "brauner@...nel.org" <brauner@...nel.org>,
        "cmllamas@...gle.com" <cmllamas@...gle.com>,
        "dan.j.williams@...el.com" <dan.j.williams@...el.com>,
        "dxu@...uu.xyz" <dxu@...uu.xyz>,
        "gary@...yguo.net" <gary@...yguo.net>,
        "gregkh@...uxfoundation.org" <gregkh@...uxfoundation.org>,
        "joel@...lfernandes.org" <joel@...lfernandes.org>,
        "keescook@...omium.org" <keescook@...omium.org>,
        "linux-fsdevel@...r.kernel.org" <linux-fsdevel@...r.kernel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "maco@...roid.com" <maco@...roid.com>,
        "ojeda@...nel.org" <ojeda@...nel.org>,
        "peterz@...radead.org" <peterz@...radead.org>,
        "rust-for-linux@...r.kernel.org" <rust-for-linux@...r.kernel.org>,
        "surenb@...gle.com" <surenb@...gle.com>,
        "tglx@...utronix.de" <tglx@...utronix.de>,
        "tkjos@...roid.com" <tkjos@...roid.com>,
        "viro@...iv.linux.org.uk" <viro@...iv.linux.org.uk>,
        "wedsonaf@...il.com" <wedsonaf@...il.com>,
        "willy@...radead.org" <willy@...radead.org>
Subject: RE: [PATCH 1/7] rust: file: add Rust abstraction for `struct file`

On 12/1/23 18:25, David Laight wrote:
> From: Benno Lossin
>> Sent: 01 December 2023 15:14
>>
>> On 12/1/23 16:04, Theodore Ts'o wrote:
>>> On Fri, Dec 01, 2023 at 12:27:40PM +0000, Alice Ryhl wrote:
>>>>
>>>> You can import it with a use statement. For example:
>>>>
>>>> use kernel::file::flags::O_RDONLY;
>>>> // use as O_RDONLY
>>>
>>> That's good to hear,
> 
> Except that the examples here seem to imply you can't import
> all of the values without listing them all.

Alice has given an example above, but you might not have noticed:

    use kernel::file::flags::*;
    
    // usage:

    O_RDONLY
    O_APPEND

> From what I've seen of the rust patches the language seems
> to have a lower SNR than ADA or VHDL.
> Too much syntatic 'goop' makes it difficult to see what code
> is actually doing.

This is done for better readability, e.g. when you do not have
rust-analyzer to help you jump to the right definition. But there are
certainly instances where we use the `::*` imports (just look at the
first patch).

> ....
>> Alternatively if we end up with multiple flags modules you can do this
>> (the sixth option from Alice):
>>
>>     use kernel::file::flags as file_flags;
>>     use kernel::foo::flags as foo_flags;
>>
>>     // usage:
>>
>>     file_flags::O_RDONLY
>>
>>     foo_flags::O_RDONLY
> 
> That looks useful for the 'obfuscated rust' competition.
> Consider:
> 	use kernel::file::flags as foo_flags;
> 	use kernel::foo::flags as file_flags;

This is no worse than C preprocessor macros doing funky stuff.
We will just have to catch this in review.

-- 
Cheers,
Benno

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ