From mboxrd@z Thu Jan 1 00:00:00 1970 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 948043375AA for ; Mon, 5 Jan 2026 11:06:28 +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=1767611188; cv=none; b=Y3Hn6yV6Hdmr/bnvGBfQbg/SorbISGoq96VN5B2cJOuzEXj3anMdENzoUoxb4LyrE+1y3wzIIHDiWp6r3+DpWzBQdRPJl24YtVvvGqfpzqM7Wocrt3wVjQUjRF9BDsDNJKodz+w5XK6wfaLIq/gyH7v21adUndL2sVIkUPco6FM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767611188; c=relaxed/simple; bh=ai+x07a6+X0u1lU5NK4jE+d31vU19sBoySOQjc+wHwQ=; h=Subject:To:Cc:From:Date:Message-ID:MIME-Version:Content-Type; b=jTSdgCSH+jJ6TuOm0sHLgaV/cOCO9KN4RYFOogvUvzstFCT3MOvmOXxWf6rXk9/y1NiNuPANhVffQc/vx8dlApcD9dWUD5sr7kDbdjUnObiGxa+XM8a014VH21dsqiAkN3F/bFvu0ZaANAnw6IuIae5ptVadvncB7t2xD/QDT1o= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=1qtpAdba; 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="1qtpAdba" Received: by smtp.kernel.org (Postfix) with ESMTPSA id B036DC19421; Mon, 5 Jan 2026 11:06:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1767611188; bh=ai+x07a6+X0u1lU5NK4jE+d31vU19sBoySOQjc+wHwQ=; h=Subject:To:Cc:From:Date:From; b=1qtpAdbaVms+UKPR2aA5q4NfcQAPZrHrkdjiNLbW8DdtwiBFzakwAlcnH6FnH7Spf ldHYtJ/zafdu/QWafmHdhkRAd8j4WOgeCnyWtRHyCG49IH6uM1Ziqa9demwkEf73bS qsgFbY9dbN6bg4XG1tZDgjUSAMgBTbe23uyNkgjs= Subject: FAILED: patch "[PATCH] mm/damon/tests/core-kunit: handle alloc failures on" failed to apply to 6.12-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:06:25 +0100 Message-ID: <2026010525-mama-amuck-306c@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 6.12-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-6.12.y git checkout FETCH_HEAD git cherry-pick -x d14d5671e7c9cc788c5a1edfa94e6f9064275905 # git commit -s git send-email --to '' --in-reply-to '2026010525-mama-amuck-306c@gregkh' --subject-prefix 'PATCH 6.12.y' HEAD^.. Possible dependencies: thanks, greg k-h ------------------ original commit in Linus's tree ------------------ >From d14d5671e7c9cc788c5a1edfa94e6f9064275905 Mon Sep 17 00:00:00 2001 From: SeongJae Park Date: Sat, 1 Nov 2025 11:20:09 -0700 Subject: [PATCH] mm/damon/tests/core-kunit: handle alloc failures on damos_test_filter_out() damon_test_filter_out() 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-16-sj@kernel.org Fixes: 26713c890875 ("mm/damon/core-test: add a unit test for __damos_filter_out()") Signed-off-by: SeongJae Park Cc: Brendan Higgins Cc: David Gow Cc: Kefeng Wang Cc: [6.6+] Signed-off-by: Andrew Morton diff --git a/mm/damon/tests/core-kunit.h b/mm/damon/tests/core-kunit.h index 5af8275ffd7d..a03ae9ddd88a 100644 --- a/mm/damon/tests/core-kunit.h +++ b/mm/damon/tests/core-kunit.h @@ -542,11 +542,22 @@ static void damos_test_filter_out(struct kunit *test) struct damos_filter *f; f = damos_new_filter(DAMOS_FILTER_TYPE_ADDR, true, false); + if (!f) + kunit_skip(test, "filter alloc fail"); f->addr_range = (struct damon_addr_range){ .start = DAMON_MIN_REGION * 2, .end = DAMON_MIN_REGION * 6}; t = damon_new_target(); + if (!t) { + damos_destroy_filter(f); + kunit_skip(test, "target alloc fail"); + } r = damon_new_region(DAMON_MIN_REGION * 3, DAMON_MIN_REGION * 5); + if (!r) { + damos_destroy_filter(f); + damon_free_target(t); + kunit_skip(test, "region alloc fail"); + } damon_add_region(r, t); /* region in the range */