linux-stable/rust
Miguel Ojeda 6618d69aa1 rust: print: avoid evaluating arguments in `pr_*` macros in `unsafe` blocks
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@gmail.com>
Reported-by: Domen Puncer Kugler <domen.puncerkugler@nccgroup.com>
Link: https://github.com/Rust-for-Linux/linux/issues/479
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
Reviewed-by: Boqun Feng <boqun.feng@gmail.com>
Reviewed-by: Gary Guo <gary@garyguo.net>
Reviewed-by: Björn Roy Baron <bjorn3_gh@protonmail.com>
Reviewed-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
2023-01-16 00:54:35 +01:00
..
alloc rust: alloc: add `Vec::try_with_capacity{,_in}()` constructors 2022-12-04 01:59:15 +01:00
bindings rust: add `bindings` crate 2022-09-28 08:58:00 +02:00
kernel rust: print: avoid evaluating arguments in `pr_*` macros in `unsafe` blocks 2023-01-16 00:54:35 +01:00
macros rust: macros: take string literals in `module!` 2022-12-04 01:59:15 +01:00
.gitignore Kbuild: add Rust support 2022-09-28 09:02:20 +02:00
Makefile rust: add `build_error` crate 2022-12-04 01:59:16 +01:00
bindgen_parameters Kbuild: add Rust support 2022-09-28 09:02:20 +02:00
build_error.rs rust: add `build_error` crate 2022-12-04 01:59:16 +01:00
compiler_builtins.rs rust: add `compiler_builtins` crate 2022-09-28 08:58:00 +02:00
exports.c rust: add `build_error` crate 2022-12-04 01:59:16 +01:00
helpers.c