]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
rust: alloc: satisfy POSIX alignment requirement
authorTamir Duberstein <tamird@gmail.com>
Thu, 13 Feb 2025 11:34:18 +0000 (06:34 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 22 Mar 2025 19:54:23 +0000 (12:54 -0700)
commit28d472f153f9551b4436cde7b39e2a16159c10be
treef86b486327679ebbcc1257cd2552b3a12f186571
parent6db379b34a06d449892e60db7b6e7e59a330f1ab
rust: alloc: satisfy POSIX alignment requirement

commit ff64846bee0e7e3e7bc9363ebad3bab42dd27e24 upstream.

ISO C's `aligned_alloc` is partially implementation-defined; on some
systems it inherits stricter requirements from POSIX's `posix_memalign`.

This causes the call added in commit dd09538fb409 ("rust: alloc:
implement `Cmalloc` in module allocator_test") to fail on macOS because
it doesn't meet the requirements of `posix_memalign`.

Adjust the call to meet the POSIX requirement and add a comment. This
fixes failures in `make rusttest` on macOS.

Acked-by: Danilo Krummrich <dakr@kernel.org>
Cc: stable@vger.kernel.org
Fixes: dd09538fb409 ("rust: alloc: implement `Cmalloc` in module allocator_test")
Signed-off-by: Tamir Duberstein <tamird@gmail.com>
Reviewed-by: Gary Guo <gary@garyguo.net>
Link: https://lore.kernel.org/r/20250213-aligned-alloc-v7-1-d2a2d0be164b@gmail.com
[ Added Cc: stable. - Miguel ]
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
rust/kernel/alloc/allocator_test.rs