linux/rust
Asahi Lina 84fc3616b2 rust: alloc: Fix ArrayLayout allocations
commit b7ed2b6f4e upstream.

We were accidentally allocating a layout for the *square* of the object
size due to a variable shadowing mishap.

Fixes memory bloat and page allocation failures in drm/asahi.

Reported-by: Janne Grunau <j@jannau.net>
Fixes: 9e7bbfa182 ("rust: alloc: introduce `ArrayLayout`")
Signed-off-by: Asahi Lina <lina@asahilina.net>
Acked-by: Danilo Krummrich <dakr@kernel.org>
Reviewed-by: Neal Gompa <neal@gompa.dev>
Link: https://lore.kernel.org/r/20241123-rust-fix-arraylayout-v1-1-197e64c95bd4@asahilina.net
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
History 2025-03-13 13:01:49 +01:00
..
bindings rust: map __kernel_size_t and friends also to usize/isize 2025-03-13 13:01:48 +01:00
helpers rust: alloc: implement KVmalloc allocator 2025-03-13 13:01:44 +01:00
kernel rust: alloc: Fix ArrayLayout allocations 2025-03-13 13:01:49 +01:00
macros rust: use custom FFI integer types 2025-03-13 13:01:49 +01:00
uapi rust: map __kernel_size_t and friends also to usize/isize 2025-03-13 13:01:48 +01:00
.gitignore rust: support running Rust documentation tests as KUnit ones 2023-07-19 09:32:53 -06:00
bindgen_parameters rust: map __kernel_size_t and friends also to usize/isize 2025-03-13 13:01:48 +01:00
build_error.rs rust: add build_error crate 2022-12-04 01:59:16 +01:00
compiler_builtins.rs rust: add intrinsics to fix -Os builds 2024-08-10 00:05:10 +02:00
exports.c kbuild: rust: remove the alloc crate and GlobalAlloc 2025-03-13 13:01:47 +01:00
ffi.rs rust: use custom FFI integer types 2025-03-13 13:01:49 +01:00
Makefile rust: use custom FFI integer types 2025-03-13 13:01:49 +01:00