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]
Message-ID: <aG7YhNnGih9KcQjV@cassiopeiae>
Date: Wed, 9 Jul 2025 23:00:52 +0200
From: Danilo Krummrich <dakr@...nel.org>
To: Vitaly Wool <vitaly.wool@...sulko.se>
Cc: linux-mm@...ck.org, akpm@...ux-foundation.org,
	linux-kernel@...r.kernel.org, Uladzislau Rezki <urezki@...il.com>,
	Alice Ryhl <aliceryhl@...gle.com>, Vlastimil Babka <vbabka@...e.cz>,
	rust-for-linux@...r.kernel.org,
	Lorenzo Stoakes <lorenzo.stoakes@...cle.com>,
	"Liam R . Howlett" <Liam.Howlett@...cle.com>,
	Kent Overstreet <kent.overstreet@...ux.dev>,
	linux-bcachefs@...r.kernel.org, bpf@...r.kernel.org,
	Herbert Xu <herbert@...dor.apana.org.au>,
	Jann Horn <jannh@...gle.com>, Pedro Falcato <pfalcato@...e.de>
Subject: Re: [PATCH v12 4/4] rust: support large alignments in allocations

On Wed, Jul 09, 2025 at 07:25:09PM +0200, Vitaly Wool wrote:
>  void * __must_check __realloc_size(2)
> -rust_helper_krealloc_node(const void *objp, size_t new_size, gfp_t flags, int node)
> +rust_helper_krealloc_node_align(const void *objp, size_t new_size, unsigned long align,
> +				gfp_t flags, int node)

CHECK: Alignment should match open parenthesis
#38: FILE: rust/helpers/slab.c:14:
+rust_helper_kvrealloc_node_align(const void *p, size_t size, unsigned long align,
+                               gfp_t flags, int node)

total: 0 errors, 0 warnings, 1 checks, 94 lines checked

Please make sure to always run scripts/checkpatch.pl. :)

> @@ -185,12 +180,6 @@ unsafe fn realloc(
>          flags: Flags,
>          nid: NumaNode,
>      ) -> Result<NonNull<[u8]>, AllocError> {
> -        // TODO: Support alignments larger than PAGE_SIZE.
> -        if layout.align() > bindings::PAGE_SIZE {
> -            pr_warn!("KVmalloc does not support alignments larger than PAGE_SIZE yet.\n");
> -            return Err(AllocError);
> -        }
> -

Since you remove the pr_warn!(), you also have to remove the corresponding
import, otherwise you get a clippy warning.

Please build with CLIPPY=1, see also [1].

[1] https://rust-for-linux.com/contributing#submit-checklist-addendum

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ