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]
Date:   Thu, 23 Mar 2023 13:18:15 +0100
From:   "Arnd Bergmann" <arnd@...db.de>
To:     "Asahi Lina" <lina@...hilina.net>,
        "Miguel Ojeda" <ojeda@...nel.org>,
        "Alex Gaynor" <alex.gaynor@...il.com>,
        "Wedson Almeida Filho" <wedsonaf@...il.com>,
        "Boqun Feng" <boqun.feng@...il.com>, "Gary Guo" <gary@...yguo.net>,
        Björn Roy Baron <bjorn3_gh@...tonmail.com>
Cc:     linux-kernel@...r.kernel.org, rust-for-linux@...r.kernel.org,
        asahi@...ts.linux.dev, Linux-Arch <linux-arch@...r.kernel.org>
Subject: Re: [PATCH v2] rust: ioctl: Add ioctl number manipulation functions

On Thu, Mar 23, 2023, at 13:08, Asahi Lina wrote:
> Changes in v2:
> - Changed from assert!() to build_assert!() (static_assert!() can't work here)
...
> +/// Build an ioctl number, analogous to the C macro of the same name.
> +const fn _IOC(dir: u32, ty: u32, nr: u32, size: usize) -> u32 {
> +    core::assert!(dir <= bindings::_IOC_DIRMASK);
> +    core::assert!(ty <= bindings::_IOC_TYPEMASK);
> +    core::assert!(nr <= bindings::_IOC_NRMASK);
> +    core::assert!(size <= (bindings::_IOC_SIZEMASK as usize));

Just to make sure: did you actually change it according
to the changelog? It still looks like a runtime assertion
to me, but I don't really understand any rust.

      Arnd

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ