From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 C7B7D2F4A0C for ; Tue, 21 Jul 2026 09:15:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784625353; cv=none; b=jGUIA76bUnD+zskYHejy1y3uqkXUk2LwmcrmwMci74jKdoKuW+GvA9cfdEhvmeBujMOBK/CvBqbFqPZQHkmSLFZv9pnOMTsh7geqgsfOQAW3Oc7vUXXNfama+gpZsgHjiYbLs1Blrmj/TGbrT00OZaImcXNKUoV+Si0Rn8eSBpY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784625353; c=relaxed/simple; bh=3d5t6XFPfxyVmJG7/zdG2zVdy4zDbtFaa0kNgPNMviM=; h=Subject:To:Cc:From:Date:Message-ID:MIME-Version:Content-Type; b=uMivX3/YA+1K/5qz5ldmayz8i4eDUBvLISRHHe+b6jgxamEMAGCfKspEcz1VFY0yzAXcnAfIuF3lPWJAtryHVrsFvml6TkQArrA0nVuBbSsKBhQM9UhXPjSUwjrZOUn4b9FbQ1l3hKXVa3ekC4er2JA0bqaMiIR61FvpAMssF2M= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=xOJBn566; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="xOJBn566" Received: by smtp.kernel.org (Postfix) with ESMTPSA id D0D4E1F000E9; Tue, 21 Jul 2026 09:15:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1784625352; bh=py3QZQdnA/fFPEH2OXd9uqiWcFm6LUNYdwwF19J2WqY=; h=Subject:To:Cc:From:Date; b=xOJBn566CYb3ByqQL2OAGaEVWPbxJK8ZGiEcV90GWuNV9+MV7hg6xm/+DMN+pU6RP eJrHTyisxKHlsef7wTVKjHhNKagheINFxqIQpUSruk9q00gQmie8eDsZcj6HNTA7Ky QnQc3M6htOokThTyvJGZGrRoMBGGJyHxlxWuRfQQ= Subject: FAILED: patch "[PATCH] fs/resctrl: Fix double-add of pseudo-locked region's RMID to" failed to apply to 6.1-stable tree To: reinette.chatre@intel.com,bp@alien8.de,stable@kernel.org Cc: From: Date: Tue, 21 Jul 2026 11:15:35 +0200 Message-ID: <2026072135-tricolor-chaps-010c@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.1-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.1.y git checkout FETCH_HEAD git cherry-pick -x b9f089723aee892efc77c349ae47a6b452b293c4 # git commit -s git send-email --to '' --in-reply-to '2026072135-tricolor-chaps-010c@gregkh' --subject-prefix 'PATCH 6.1.y' 'HEAD^..' Possible dependencies: thanks, greg k-h ------------------ original commit in Linus's tree ------------------ >From b9f089723aee892efc77c349ae47a6b452b293c4 Mon Sep 17 00:00:00 2001 From: Reinette Chatre Date: Mon, 6 Jul 2026 15:46:23 -0700 Subject: [PATCH] fs/resctrl: Fix double-add of pseudo-locked region's RMID to free list A pseudo-locked group's RMID is freed when it is created. On unmount rmdir_all_sub() unconditionally frees all RMID of all groups, resulting in a double-free of the pseudo-locked group's RMID. The consequence of this is that the original free results in the pseudo-locked group's RMID being added to the rmid_free_lru linked list and the second free then attempts to add the same RMID entry to the rmid_free_lru again. Do not double-free a pseudo-locked group's RMID. Fixes: e0bdfe8e36f3 ("x86/intel_rdt: Support creation/removal of pseudo-locked region") Signed-off-by: Reinette Chatre Signed-off-by: Borislav Petkov (AMD) Cc: Link: https://patch.msgid.link/551432dd7e624a862b8e58314c38aaba0afff3e9.1783377598.git.reinette.chatre@intel.com diff --git a/fs/resctrl/rdtgroup.c b/fs/resctrl/rdtgroup.c index ce277f16ea12..cc9966ff6cdf 100644 --- a/fs/resctrl/rdtgroup.c +++ b/fs/resctrl/rdtgroup.c @@ -3084,10 +3084,6 @@ static void rmdir_all_sub(void) if (rdtgrp == &rdtgroup_default) continue; - if (rdtgrp->mode == RDT_MODE_PSEUDO_LOCKSETUP || - rdtgrp->mode == RDT_MODE_PSEUDO_LOCKED) - rdtgroup_pseudo_lock_remove(rdtgrp); - /* * Give any CPUs back to the default group. We cannot copy * cpu_online_mask because a CPU might have executed the @@ -3098,7 +3094,13 @@ static void rmdir_all_sub(void) rdtgroup_unassign_cntrs(rdtgrp); - free_rmid(rdtgrp->closid, rdtgrp->mon.rmid); + if (rdtgrp->mode == RDT_MODE_PSEUDO_LOCKSETUP || + rdtgrp->mode == RDT_MODE_PSEUDO_LOCKED) { + rdtgroup_pseudo_lock_remove(rdtgrp); + } else { + /* Pseudo-locked group's RMID is freed during setup. */ + free_rmid(rdtgrp->closid, rdtgrp->mon.rmid); + } kernfs_remove(rdtgrp->kn); list_del(&rdtgrp->rdtgroup_list);