The patch titled Subject: mm: (k)vrealloc: document concurrency restrictions has been added to the -mm mm-unstable branch. Its filename is mm-vmalloc-implement-vrealloc-fix-2.patch This patch will shortly appear at https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/mm-vmalloc-implement-vrealloc-fix-2.patch This patch will later appear in the mm-unstable branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/process/submit-checklist.rst when testing your code *** The -mm tree is included into linux-next via the mm-everything branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm and is updated there every 2-3 working days ------------------------------------------------------ From: Danilo Krummrich <dakr@xxxxxxxxxx> Subject: mm: (k)vrealloc: document concurrency restrictions Date: Thu, 25 Jul 2024 14:54:37 +0200 Document that concurrent calls to vrealloc() with itself or vfree() for the same memory allocation are not permitted, since it leads to undefined behavior. Consequently, the same applies for kvrealloc(), hence also document it for kvrealloc(). Link: https://lkml.kernel.org/r/20240725125442.4957-1-dakr@xxxxxxxxxx Signed-off-by: Danilo Krummrich <dakr@xxxxxxxxxx> Suggested-by: Christoph Hellwig <hch@xxxxxxxxxxxxx> Suggested-by: Uladzislau Rezki <urezki@xxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- mm/vmalloc.c | 3 +++ 1 file changed, 3 insertions(+) --- a/mm/vmalloc.c~mm-vmalloc-implement-vrealloc-fix-2 +++ a/mm/vmalloc.c @@ -4049,6 +4049,9 @@ EXPORT_SYMBOL(vzalloc_node_noprof); * If @p is %NULL, vrealloc() behaves exactly like vmalloc(). If @size is 0 and * @p is not a %NULL pointer, the object pointed to is freed. * + * This function must not be called concurrently with itself or vfree() for the + * same memory allocation. + * * Return: pointer to the allocated memory; %NULL if @size is zero or in case of * failure */ _ Patches currently in -mm which might be from dakr@xxxxxxxxxx are mm-vmalloc-implement-vrealloc.patch mm-vmalloc-implement-vrealloc-fix.patch mm-vmalloc-implement-vrealloc-fix-2.patch mm-kvmalloc-align-kvrealloc-with-krealloc.patch mm-kvmalloc-align-kvrealloc-with-krealloc-fix.patch