diff --git linux-libre-6.12.88-gnu/Makefile linux-libre-6.12.89-gnu/Makefile
index e1f0024a0f74..5c6c827f9e5a 100644
--- linux-libre-6.12.88-gnu/Makefile
+++ linux-libre-6.12.89-gnu/Makefile
@@ -1,7 +1,7 @@
 # SPDX-License-Identifier: GPL-2.0
 VERSION = 6
 PATCHLEVEL = 12
-SUBLEVEL = 88
+SUBLEVEL = 89
 EXTRAVERSION = -gnu
 NAME = Baby Opossum Posse
 
diff --git linux-libre-6.12.88-gnu/include/linux/sched.h linux-libre-6.12.89-gnu/include/linux/sched.h
index 321e088f9ee7..2e4c437c7c90 100644
--- linux-libre-6.12.88-gnu/include/linux/sched.h
+++ linux-libre-6.12.89-gnu/include/linux/sched.h
@@ -969,6 +969,9 @@ struct task_struct {
 	unsigned			sched_rt_mutex:1;
 #endif
 
+	/* Save user-dumpable when mm goes away */
+	unsigned			user_dumpable:1;
+
 	/* Bit to tell TOMOYO we're in execve(): */
 	unsigned			in_execve:1;
 	unsigned			in_iowait:1;
diff --git linux-libre-6.12.88-gnu/kernel/exit.c linux-libre-6.12.89-gnu/kernel/exit.c
index 021403fc756a..b91124b2d334 100644
--- linux-libre-6.12.88-gnu/kernel/exit.c
+++ linux-libre-6.12.89-gnu/kernel/exit.c
@@ -561,6 +561,7 @@ static void exit_mm(void)
 	 */
 	smp_mb__after_spinlock();
 	local_irq_disable();
+	current->user_dumpable = (get_dumpable(mm) == SUID_DUMP_USER);
 	current->mm = NULL;
 	membarrier_update_current_mm(NULL);
 	enter_lazy_tlb(mm, current);
diff --git linux-libre-6.12.88-gnu/kernel/ptrace.c linux-libre-6.12.89-gnu/kernel/ptrace.c
index d5f89f9ef29f..75bcc152606c 100644
--- linux-libre-6.12.88-gnu/kernel/ptrace.c
+++ linux-libre-6.12.89-gnu/kernel/ptrace.c
@@ -272,11 +272,24 @@ static bool ptrace_has_cap(struct user_namespace *ns, unsigned int mode)
 	return ns_capable(ns, CAP_SYS_PTRACE);
 }
 
+static bool task_still_dumpable(struct task_struct *task, unsigned int mode)
+{
+	struct mm_struct *mm = task->mm;
+	if (mm) {
+		if (get_dumpable(mm) == SUID_DUMP_USER)
+			return true;
+		return ptrace_has_cap(mm->user_ns, mode);
+	}
+
+	if (task->user_dumpable)
+		return true;
+	return ptrace_has_cap(&init_user_ns, mode);
+}
+
 /* Returns 0 on success, -errno on denial. */
 static int __ptrace_may_access(struct task_struct *task, unsigned int mode)
 {
 	const struct cred *cred = current_cred(), *tcred;
-	struct mm_struct *mm;
 	kuid_t caller_uid;
 	kgid_t caller_gid;
 
@@ -337,11 +350,8 @@ ok:
 	 * Pairs with a write barrier in commit_creds().
 	 */
 	smp_rmb();
-	mm = task->mm;
-	if (mm &&
-	    ((get_dumpable(mm) != SUID_DUMP_USER) &&
-	     !ptrace_has_cap(mm->user_ns, mode)))
-	    return -EPERM;
+	if (!task_still_dumpable(task, mode))
+		return -EPERM;
 
 	return security_ptrace_access_check(task, mode);
 }
