[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CANiq72k9OP2TTPty2OcC5Od-R3wHsfhnc0BFR_XYjBtC5zf3gA@mail.gmail.com>
Date: Mon, 16 Jan 2023 01:03:05 +0100
From: Miguel Ojeda <miguel.ojeda.sandonis@...il.com>
To: Miguel Ojeda <ojeda@...nel.org>
Cc: Wedson Almeida Filho <wedsonaf@...il.com>,
Alex Gaynor <alex.gaynor@...il.com>,
Boqun Feng <boqun.feng@...il.com>, Gary Guo <gary@...yguo.net>,
Björn Roy Baron <bjorn3_gh@...tonmail.com>,
rust-for-linux@...r.kernel.org, linux-kernel@...r.kernel.org,
patches@...ts.linux.dev,
Domen Puncer Kugler <domen.puncerkugler@...group.com>
Subject: Re: [PATCH] rust: print: avoid evaluating arguments in `pr_*` macros
in `unsafe` blocks
On Mon, Jan 9, 2023 at 9:49 PM Miguel Ojeda <ojeda@...nel.org> wrote:
>
> At the moment it is possible to perform unsafe operations in
> the arguments of `pr_*` macros since they are evaluated inside
> an `unsafe` block:
>
> let x = &10u32 as *const u32;
> pr_info!("{}", *x);
>
> In other words, this is a soundness issue.
>
> Fix it so that it requires an explicit `unsafe` block.
>
> Reported-by: Wedson Almeida Filho <wedsonaf@...il.com>
> Reported-by: Domen Puncer Kugler <domen.puncerkugler@...group.com>
> Link: https://github.com/Rust-for-Linux/linux/issues/479
> Signed-off-by: Miguel Ojeda <ojeda@...nel.org>
Applied to rust-fixes, thanks all!
Cheers,
Miguel
Powered by blists - more mailing lists