Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9A2F3316919 for ; Mon, 5 Jan 2026 11:03:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767610989; cv=none; b=kut9Ecr5HivkW6U0bLnNUotWebDEL37jj+RCnYIWLMurirFgannnbN9y6wrZl+470VYcZsbgpI0VoAiXqjMwXFKuhNN724ugWPFlP8pp777CC2iMHevxXYBunShvs2VgTxASVTJcjCMwgjJH0NAFgFsavxFG0LyZ5S8Dj6PPhA4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767610989; c=relaxed/simple; bh=mHehdnx4qSOeTbqqnREMMI0oAbGgfeAdljR16xq4gLI=; h=Subject:To:Cc:From:Date:Message-ID:MIME-Version:Content-Type; b=OOinz0fBc6c6/ak2UoTHEJTI9ceASx5xiGwrUZyqxXGmLB3PEqZzpdK19AFgQmYqhg/MlWgR01iNfcct/B7hINCySCAjfE6olN78coFFMo3vDFBZXi1ZVrZvLT6IvpIpcwTL3T0+uO5ksLRLintAKdfr04Gy7ZlJyA9tWhrC8WE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=hCrurG9r; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="hCrurG9r" Received: by smtp.kernel.org (Postfix) with ESMTPSA id A101BC116D0; Mon, 5 Jan 2026 11:03:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1767610989; bh=mHehdnx4qSOeTbqqnREMMI0oAbGgfeAdljR16xq4gLI=; h=Subject:To:Cc:From:Date:From; b=hCrurG9r6D8SljurnLrGDG5G6oqHN2bpDmhxLCQ1vK5sgM6Nq4ZhR7jtJDEXaqhig LaOykQT1UGykH5m3P46VhwGQkw4Q/Qwp5ZbXAxSghy7u96sx1u4yTUFPeUeRwiIy16 20EXKm/CylQO5Yos3D2NPCWtSmY+/qIkbLO6tbIM= Subject: FAILED: patch "[PATCH] mm/damon/tests/vaddr-kunit: handle alloc failures in" failed to apply to 5.15-stable tree To: sj@kernel.org,akpm@linux-foundation.org,brendan.higgins@linux.dev,davidgow@google.com,stable@vger.kernel.org,wangkefeng.wang@huawei.com Cc: From: Date: Mon, 05 Jan 2026 12:03:02 +0100 Message-ID: <2026010502-turbojet-conducive-b2be@gregkh> Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: 8bit The patch below does not apply to the 5.15-stable tree. If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to . To reproduce the conflict and resubmit, you may use the following commands: git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-5.15.y git checkout FETCH_HEAD git cherry-pick -x 7890e5b5bb6e386155c6e755fe70e0cdcc77f18e # git commit -s git send-email --to '' --in-reply-to '2026010502-turbojet-conducive-b2be@gregkh' --subject-prefix 'PATCH 5.15.y' HEAD^.. Possible dependencies: thanks, greg k-h ------------------ original commit in Linus's tree ------------------ From 7890e5b5bb6e386155c6e755fe70e0cdcc77f18e Mon Sep 17 00:00:00 2001 From: SeongJae Park Date: Sat, 1 Nov 2025 11:20:12 -0700 Subject: [PATCH] mm/damon/tests/vaddr-kunit: handle alloc failures in damon_test_split_evenly_fail() damon_test_split_evenly_fail() is assuming all dynamic memory allocation in it will succeed. Those are indeed likely in the real use cases since those allocations are too small to fail, but theoretically those could fail. In the case, inappropriate memory access can happen. Fix it by appropriately cleanup pre-allocated memory and skip the execution of the remaining tests in the failure cases. Link: https://lkml.kernel.org/r/20251101182021.74868-19-sj@kernel.org Fixes: 17ccae8bb5c9 ("mm/damon: add kunit tests") Signed-off-by: SeongJae Park Cc: Brendan Higgins Cc: David Gow Cc: Kefeng Wang Cc: [5.15+] Signed-off-by: Andrew Morton diff --git a/mm/damon/tests/vaddr-kunit.h b/mm/damon/tests/vaddr-kunit.h index 484223f19545..1b0f21c2e376 100644 --- a/mm/damon/tests/vaddr-kunit.h +++ b/mm/damon/tests/vaddr-kunit.h @@ -256,7 +256,16 @@ static void damon_test_split_evenly_fail(struct kunit *test, unsigned long start, unsigned long end, unsigned int nr_pieces) { struct damon_target *t = damon_new_target(); - struct damon_region *r = damon_new_region(start, end); + struct damon_region *r; + + if (!t) + kunit_skip(test, "target alloc fail"); + + r = damon_new_region(start, end); + if (!r) { + damon_free_target(t); + kunit_skip(test, "region alloc fail"); + } damon_add_region(r, t); KUNIT_EXPECT_EQ(test,