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: <202505150845.0F9E154@keescook>
Date: Thu, 15 May 2025 08:47:47 -0700
From: Kees Cook <kees@...nel.org>
To: Shung-Hsi Yu <shung-hsi.yu@...e.com>
Cc: bpf@...r.kernel.org, linux-mm@...ck.org,
	Andrii Nakryiko <andrii@...nel.org>,
	Ihor Solodrai <ihor.solodrai@...ux.dev>,
	Andrew Morton <akpm@...ux-foundation.org>,
	Michal Hocko <mhocko@...e.com>, Vlastimil Babka <vbabka@...e.cz>,
	Uladzislau Rezki <urezki@...il.com>, linux-kernel@...r.kernel.org,
	linux-hardening@...r.kernel.org, regressions@...ts.linux.dev,
	Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
	Alexei Starovoitov <ast@...nel.org>,
	Daniel Borkmann <daniel@...earbox.net>,
	Pawan Gupta <pawan.kumar.gupta@...ux.intel.com>,
	Eduard Zingerman <eddyz87@...il.com>
Subject: Re: [REGRESSION] bpf verifier slowdown due to vrealloc() change
 since 6.15-rc6

On Thu, May 15, 2025 at 09:12:25PM +0800, Shung-Hsi Yu wrote:
> Bisect was done by Pawan and got to commit a0309faf1cb0 "mm: vmalloc:
> support more granular vrealloc() sizing"[2]. To further zoom in the

Can you try this patch? It's a clear bug fix, but if it doesn't improve
things, I have another idea to rearrange the memset.


>From e96a0e2519b1c5b50f45bd05bf60e6117d1132b2 Mon Sep 17 00:00:00 2001
From: Kees Cook <kees@...nel.org>
Date: Thu, 15 May 2025 08:43:12 -0700
Subject: [PATCH] mm: vmalloc: Actually use the in-place vrealloc region

The refactoring to not build a new vmalloc region only actually worked
when shrinking. Actually return the resized area when it grows. Ugh.

Fixes: a0309faf1cb0 ("mm: vmalloc: support more granular vrealloc() sizing")
Signed-off-by: Kees Cook <kees@...nel.org>
---
Cc: Andrew Morton <akpm@...ux-foundation.org>
Cc: Uladzislau Rezki <urezki@...il.com>
Cc: <linux-mm@...ck.org>
---
 mm/vmalloc.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/mm/vmalloc.c b/mm/vmalloc.c
index 2d7511654831..74bd00fd734d 100644
--- a/mm/vmalloc.c
+++ b/mm/vmalloc.c
@@ -4111,6 +4111,7 @@ void *vrealloc_noprof(const void *p, size_t size, gfp_t flags)
 		if (want_init_on_alloc(flags))
 			memset((void *)p + old_size, 0, size - old_size);
 		vm->requested_size = size;
+		return (void *)p;
 	}
 
 	/* TODO: Grow the vm_area, i.e. allocate and map additional pages. */
-- 
2.34.1


-- 
Kees Cook

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ