From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 5F0DFC9833E for ; Mon, 28 Sep 2026 08:16:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References:Message-Id :MIME-Version:Subject:Date:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=UTUeSEEwclno7Sz7VltWpucRcybA9CDtbP6oiLOUbgI=; b=al+KiiW6OOfF2O uDu+d/C/+S49F6so9iTGwAPpHoPjUihQ83O81V/UjFJuvGoKLJdTckDu9ZVKCypOFREPAGShIRgPj zlqcvAsd6VvLALDepSEYGe5hrDuZ4vM46cjcTeFXl9iyAvc2tfL9/ZerZIjygsId3v3VghGLCJNcN jqSQjNEBwmEqeh8PPYII4+e1eLSw28unBNtp7eK8Rv6SjvyfqV4c/hExA8a0wK7/f0gdFGRluLemi 9wRPMBA7pvhplja04mBgIQ7SGTscswfFdXcSPAUTcldlsAdXz0NLTNDwjcGlC8CC2RwCc2uU48XiY iwKLWNI3Hdlz0LkTUjIA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.99.1 #2 (Red Hat Linux)) id 1xB6X0-000000003EH-25Ds; Mon, 28 Sep 2026 08:16:14 +0000 Received: from out-70.mta1.migadu.com ([2001:41d0:203:375::46] helo=mta1.migadu.com) by bombadil.infradead.org with esmtps (Exim 4.99.1 #2 (Red Hat Linux)) id 1xB6Wx-000000003Bz-2TAf for linux-riscv@lists.infradead.org; Mon, 28 Sep 2026 08:16:12 +0000 X-Envelope-To: linux-riscv@lists.infradead.org DKIM-Signature: a=rsa-sha256; bh=VMcXVA6Q//nucy9IuPEO+cpUVY2addflHX+2AAjGN8s=; c=simple/simple; d=linux.dev; h=from:to:subject:date:message-id:mime-version:content-type; s=key1; t=1790583369; v=1; x=1791188169; b=q7EnVjPGsA2MPgdvy4SRmdL6nLfeABvwkDrtR7Bkx7AXEyA1csFUVqkM6q9wKM56NbLhqDt5 p8JhBZtzUaZiR09kx6orWO2yi/cNRYbqWEwmh+bk9qyDPA9gs1pDipcoPtp1XFYa3s+GypHFg4A 1PaLf8wbjsTN8MO6zWVpexcM= X-Envelope-To: linux-riscv@lists.infradead.org Received: by smtp.migadu.com with ESMTPS id 954cb9b4744235b9; Mon, 28 Sep 2026 08:16:09 +0000 X-Mizu-Trace-ID: 954cb9b4744235b9 X-Migadu-Flow: FLOW_OUT From: Ye Liu Date: Mon, 28 Sep 2026 16:15:54 +0800 Subject: [PATCH v4 1/2] mm/vmalloc: fix vmalloc_dump_obj address alignment for last-page lookups MIME-Version: 1.0 Message-Id: <20260928-vmalloc_dump_obj-v4-1-6f288a431edc@linux.dev> References: <20260928-vmalloc_dump_obj-v4-0-6f288a431edc@linux.dev> In-Reply-To: <20260928-vmalloc_dump_obj-v4-0-6f288a431edc@linux.dev> To: Andrew Morton , Uladzislau Rezki , Paul Walmsley , Palmer Dabbelt , Albert Ou , Alexandre Ghiti Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org, Ye Liu X-Mailer: b4 0.14.3 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.9.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20260928_011611_777268_ADB3CAD6 X-CRM114-Status: GOOD ( 11.14 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org From: Ye Liu vmalloc_dump_obj() uses PAGE_ALIGN() to normalize the input address before looking it up in the per-node busy tree. PAGE_ALIGN() rounds up, which can push an address in the last page of a vmalloc allocation to va_end -- outside the [va_start, va_end) range that __find_vmap_area() searches. This causes the lookup to miss the VA and return false, degrading diagnostic output in OOM dumps and KASAN reports to the less informative "vmalloc memory" fallback. The upward alignment can also change the addr_to_node() mapping when the page boundary crosses a vmap zone boundary, causing the search to hit the wrong node entirely. Use PAGE_ALIGN_DOWN() instead, which rounds down to the page containing the address. This keeps the address within the VA range and preserves the correct node mapping. Signed-off-by: Ye Liu Reviewed-by: Uladzislau Rezki (Sony) --- mm/vmalloc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/vmalloc.c b/mm/vmalloc.c index 859e6d2d57a3..df42d8a6f058 100644 --- a/mm/vmalloc.c +++ b/mm/vmalloc.c @@ -5277,7 +5277,7 @@ bool vmalloc_dump_obj(void *object) unsigned long addr; unsigned long nr_pages; - addr = PAGE_ALIGN((unsigned long) object); + addr = PAGE_ALIGN_DOWN((unsigned long) object); vn = addr_to_node(addr); if (!spin_trylock(&vn->busy.lock)) -- 2.25.1 _______________________________________________ linux-riscv mailing list linux-riscv@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-riscv