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 E2480C982ED for ; Mon, 21 Sep 2026 13:18:05 +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=vvcsxsRxXvYdSZBdxYG2TwIlnc3dqgZ4nde1ngJWmtg=; b=TlGFdzpOmNzVBG PvKGzcofv3/r/rGysWE8GInW6Rk8M6BHZ5dGuFW/jy73ifR7JCf97BWPl+sA+f6kFafIpE98uJZOA KdALiec0mVBbHBAlBfTzAHU7bOZQwRDrShsJuSoZpsbik55W66tIaFtP0A73aibPQx/L2ztF3xhZQ osmeTjn4wI8vOa6XRQstZIVYzWux3TWO0obgpMAU0z8Qbbz9QA42c6DJFOy/XjZIYguXgybcnAIWB 4gcrUPSBZAOdOuPko5gzLim82yLidzBiV+RIs3fGkcVDpz3oKsHo8g2YuOMSTtFCsymU0uSLFhOBs W12QufIAHwYNEnNqZ0Lw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.99.1 #2 (Red Hat Linux)) id 1x8du4-00000002DZN-0Mbv; Mon, 21 Sep 2026 13:17:52 +0000 Received: from out-230.mta0.migadu.com ([2001:41d0:1004:224b::e6] helo=mta0.migadu.com) by bombadil.infradead.org with esmtps (Exim 4.99.1 #2 (Red Hat Linux)) id 1x8du2-00000002DYH-0Vzs for linux-riscv@lists.infradead.org; Mon, 21 Sep 2026 13:17:51 +0000 X-Envelope-To: linux-riscv@lists.infradead.org DKIM-Signature: a=rsa-sha256; bh=TgBqgmk/OGkiRG4oFsrkPk1fFb54WBL3zueWiSKqe7I=; c=simple/simple; d=linux.dev; h=from:to:subject:date:message-id:mime-version:content-type; s=key1; t=1789996668; v=1; x=1790601468; b=E4vNZoGT1Z9K7ZSq8aTtO8JWLC+bxKugBY5+nu/e0Zu3M/HhYKxssxvflfUQqzbWM2Sqsywx 4uitAdpslgeTvro0v2ET1uPLP9ZOv/xjnkybrDjkoDcwmX9b4o8R8L3iFKziwWVv8bw0FRMvnus Ih7RxqEmgQ1AADo942YiqV48= X-Envelope-To: linux-riscv@lists.infradead.org Received: by smtp.migadu.com with ESMTPS id f052238703df67d5; Mon, 21 Sep 2026 13:17:48 +0000 X-Mizu-Trace-ID: f052238703df67d5 X-Migadu-Flow: FLOW_OUT From: Ye Liu Date: Mon, 21 Sep 2026 21:17:21 +0800 Subject: [PATCH v2 1/3] mm/vmalloc: fix vmalloc_dump_obj address alignment for last-page lookups MIME-Version: 1.0 Message-Id: <20260921-vmalloc_dump_obj-v2-1-73fceb3ed1c8@linux.dev> References: <20260921-vmalloc_dump_obj-v2-0-73fceb3ed1c8@linux.dev> In-Reply-To: <20260921-vmalloc_dump_obj-v2-0-73fceb3ed1c8@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-20260921_061750_313689_2236062E X-CRM114-Status: GOOD ( 11.43 ) 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 --- 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