Skip to contentSkip to conversation

6.12.77-rc1 review

PATCH In review Greg Kroah-Hartman 16 participants 297 messages Mar 12 – Apr 8 Page 3 of 3

Subsystems (10)
lore
Share & tools
lore
author maintainer
#275 lore raw

PATCH 260/265 apparmor: fix race between freeing data and fs accessing it

In reply to Greg Kroah-Hartman

6.12-stable review patch. If anyone has any objections, please let me know.

------------------

From: John Johansen <[email protected]>

commit 8e135b8aee5a06c52a4347a5a6d51223c6f36ba3 upstream.

AppArmor was putting the reference to i_private data on its end after removing the original entry from the file system. However the inode can aand does live beyond that point and it is possible that some of the fs call back functions will be invoked after the reference has been put, which results in a race between freeing the data and accessing it through the fs.

While the rawdata/loaddata is the most likely candidate to fail the race, as it has the fewest references. If properly crafted it might be possible to trigger a race for the other types stored in i_private.

Fix this by moving the put of i_private referenced data to the correct place which is during inode eviction.

Fixes c961ee5f21b20 ("apparmor: convert from securityfs to apparmorfs for policy ns files")
---
 security/apparmor/apparmorfs.c            |  194 +++++++++++++++++-------------
 security/apparmor/include/label.h         |   16 +-
 security/apparmor/include/lib.h           |   12 +
 security/apparmor/include/policy.h        |    8 -
 security/apparmor/include/policy_unpack.h |    6 
 security/apparmor/label.c                 |   12 +
 security/apparmor/policy_unpack.c         |    6 
 7 files changed, 153 insertions(+), 101 deletions(-)
security/apparmor/apparmorfs.c +114 -80
@@ -32,6 +32,7 @@
 #include "include/crypto.h"
 #include "include/ipc.h"
 #include "include/label.h"
+#include "include/lib.h"
 #include "include/policy.h"
 #include "include/policy_ns.h"
 #include "include/resource.h"
@@ -62,6 +63,7 @@
  * securityfs and apparmorfs filesystems.
  */
 
+#define IREF_POISON 101
 
 /*
  * support fns
@@ -153,6 +155,71 @@ static int aafs_show_path(struct seq_fil
 	return 0;
 }
 
+static struct aa_ns *get_ns_common_ref(struct aa_common_ref *ref)
+{
+	if (ref) {
+		struct aa_label *reflabel = container_of(ref, struct aa_label,
+							 count);
+		return aa_get_ns(labels_ns(reflabel));
+	}
+
+	return NULL;
+}
+
+static struct aa_proxy *get_proxy_common_ref(struct aa_common_ref *ref)
+{
+	if (ref)
+		return aa_get_proxy(container_of(ref, struct aa_proxy, count));
+
+	return NULL;
+}
+
+static struct aa_loaddata *get_loaddata_common_ref(struct aa_common_ref *ref)
+{
+	if (ref)
+		return aa_get_i_loaddata(container_of(ref, struct aa_loaddata,
+						      count));
+	return NULL;
+}
+
+static void aa_put_common_ref(struct aa_common_ref *ref)
+{
+	if (!ref)
+		return;
+
+	switch (ref->reftype) {
+	case REF_RAWDATA:
+		aa_put_i_loaddata(container_of(ref, struct aa_loaddata,
+					       count));
+		break;
+	case REF_PROXY:
+		aa_put_proxy(container_of(ref, struct aa_proxy,
+					  count));
+		break;
+	case REF_NS:
+		/* ns count is held on its unconfined label */
+		aa_put_ns(labels_ns(container_of(ref, struct aa_label, count)));
+		break;
+	default:
+		AA_BUG(true, "unknown refcount type");
+		break;
+	}
+}
+
+static void aa_get_common_ref(struct aa_common_ref *ref)
+{
+	kref_get(&ref->count);
+}
+
+static void aafs_evict(struct inode *inode)
+{
+	struct aa_common_ref *ref = inode->i_private;
+
+	clear_inode(inode);
+	aa_put_common_ref(ref);
+	inode->i_private = (void *) IREF_POISON;
+}
+
 static void aafs_free_inode(struct inode *inode)
 {
 	if (S_ISLNK(inode->i_mode))
@@ -162,6 +229,7 @@ static void aafs_free_inode(struct inode
 
 static const struct super_operations aafs_super_ops = {
 	.statfs = simple_statfs,
+	.evict_inode = aafs_evict,
 	.free_inode = aafs_free_inode,
 	.show_path = aafs_show_path,
 };
@@ -262,7 +330,8 @@ static int __aafs_setup_d_inode(struct i
  * aafs_remove(). Will return ERR_PTR on failure.
  */
 static struct dentry *aafs_create(const char *name, umode_t mode,
-				  struct dentry *parent, void *data, void *link,
+				  struct dentry *parent,
+				  struct aa_common_ref *data, void *link,
 				  const struct file_operations *fops,
 				  const struct inode_operations *iops)
 {
@@ -299,6 +368,9 @@ static struct dentry *aafs_create(const
 		goto fail_dentry;
 	inode_unlock(dir);
 
+	if (data)
+		aa_get_common_ref(data);
+
 	return dentry;
 
 fail_dentry:
@@ -323,7 +395,8 @@ fail_lock:
  * see aafs_create
  */
 static struct dentry *aafs_create_file(const char *name, umode_t mode,
-				       struct dentry *parent, void *data,
+				       struct dentry *parent,
+				       struct aa_common_ref *data,
 				       const struct file_operations *fops)
 {
 	return aafs_create(name, mode, parent, data, NULL, fops, NULL);
@@ -448,7 +521,7 @@ end_section:
 static ssize_t profile_load(struct file *f, const char __user *buf, size_t size,
 			    loff_t *pos)
 {
-	struct aa_ns *ns = aa_get_ns(f->f_inode->i_private);
+	struct aa_ns *ns = get_ns_common_ref(f->f_inode->i_private);
 	int error = policy_update(AA_MAY_LOAD_POLICY, buf, size, pos, ns,
 				  f->f_cred);
 
@@ -466,7 +539,7 @@ static const struct file_operations aa_f
 static ssize_t profile_replace(struct file *f, const char __user *buf,
 			       size_t size, loff_t *pos)
 {
-	struct aa_ns *ns = aa_get_ns(f->f_inode->i_private);
+	struct aa_ns *ns = get_ns_common_ref(f->f_inode->i_private);
 	int error = policy_update(AA_MAY_LOAD_POLICY | AA_MAY_REPLACE_POLICY,
 				  buf, size, pos, ns, f->f_cred);
 	aa_put_ns(ns);
@@ -486,7 +559,7 @@ static ssize_t profile_remove(struct fil
 	struct aa_loaddata *data;
 	struct aa_label *label;
 	ssize_t error;
-	struct aa_ns *ns = aa_get_ns(f->f_inode->i_private);
+	struct aa_ns *ns = get_ns_common_ref(f->f_inode->i_private);
 
 	label = begin_current_label_crit_section();
 	/* high level check about policy management - fine grained in
@@ -576,7 +649,7 @@ static int ns_revision_open(struct inode
 	if (!rev)
 		return -ENOMEM;
 
-	rev->ns = aa_get_ns(inode->i_private);
+	rev->ns = get_ns_common_ref(inode->i_private);
 	if (!rev->ns)
 		rev->ns = aa_get_current_ns();
 	file->private_data = rev;
@@ -1054,7 +1127,7 @@ static const struct file_operations seq_
 static int seq_profile_open(struct inode *inode, struct file *file,
 			    int (*show)(struct seq_file *, void *))
 {
-	struct aa_proxy *proxy = aa_get_proxy(inode->i_private);
+	struct aa_proxy *proxy = get_proxy_common_ref(inode->i_private);
 	int error = single_open(file, show, proxy);
 
 	if (error) {
@@ -1246,7 +1319,7 @@ static const struct file_operations seq_
 static int seq_rawdata_open(struct inode *inode, struct file *file,
 			    int (*show)(struct seq_file *, void *))
 {
-	struct aa_loaddata *data = aa_get_i_loaddata(inode->i_private);
+	struct aa_loaddata *data = get_loaddata_common_ref(inode->i_private);
 	int error;
 
 	if (!data)
@@ -1379,7 +1452,7 @@ static int rawdata_open(struct inode *in
 	if (!aa_current_policy_view_capable(NULL))
 		return -EACCES;
 
-	loaddata = aa_get_i_loaddata(inode->i_private);
+	loaddata = get_loaddata_common_ref(inode->i_private);
 	if (!loaddata)
 		return -ENOENT;
 
@@ -1424,7 +1497,6 @@ static void remove_rawdata_dents(struct
 		if (!IS_ERR_OR_NULL(rawdata->dents[i])) {
 			aafs_remove(rawdata->dents[i]);
 			rawdata->dents[i] = NULL;
-			aa_put_i_loaddata(rawdata);
 		}
 	}
 }
@@ -1463,45 +1535,41 @@ int __aa_fs_create_rawdata(struct aa_ns
 	if (IS_ERR(dir))
 		/* ->name freed when rawdata freed */
 		return PTR_ERR(dir);
-	aa_get_i_loaddata(rawdata);
 	rawdata->dents[AAFS_LOADDATA_DIR] = dir;
 
-	dent = aafs_create_file("abi", S_IFREG | 0444, dir, rawdata,
+	dent = aafs_create_file("abi", S_IFREG | 0444, dir, &rawdata->count,
 				      &seq_rawdata_abi_fops);
 	if (IS_ERR(dent))
 		goto fail;
-	aa_get_i_loaddata(rawdata);
 	rawdata->dents[AAFS_LOADDATA_ABI] = dent;
 
-	dent = aafs_create_file("revision", S_IFREG | 0444, dir, rawdata,
-				      &seq_rawdata_revision_fops);
+	dent = aafs_create_file("revision", S_IFREG | 0444, dir,
+				&rawdata->count,
+				&seq_rawdata_revision_fops);
 	if (IS_ERR(dent))
 		goto fail;
-	aa_get_i_loaddata(rawdata);
 	rawdata->dents[AAFS_LOADDATA_REVISION] = dent;
 
 	if (aa_g_hash_policy) {
 		dent = aafs_create_file("sha256", S_IFREG | 0444, dir,
-					      rawdata, &seq_rawdata_hash_fops);
+					&rawdata->count,
+					&seq_rawdata_hash_fops);
 		if (IS_ERR(dent))
 			goto fail;
-		aa_get_i_loaddata(rawdata);
 		rawdata->dents[AAFS_LOADDATA_HASH] = dent;
 	}
 
 	dent = aafs_create_file("compressed_size", S_IFREG | 0444, dir,
-				rawdata,
+				&rawdata->count,
 				&seq_rawdata_compressed_size_fops);
 	if (IS_ERR(dent))
 		goto fail;
-	aa_get_i_loaddata(rawdata);
 	rawdata->dents[AAFS_LOADDATA_COMPRESSED_SIZE] = dent;
 
-	dent = aafs_create_file("raw_data", S_IFREG | 0444,
-				      dir, rawdata, &rawdata_fops);
+	dent = aafs_create_file("raw_data", S_IFREG | 0444, dir,
+				&rawdata->count, &rawdata_fops);
 	if (IS_ERR(dent))
 		goto fail;
-	aa_get_i_loaddata(rawdata);
 	rawdata->dents[AAFS_LOADDATA_DATA] = dent;
 	d_inode(dent)->i_size = rawdata->size;
 
@@ -1512,7 +1580,6 @@ int __aa_fs_create_rawdata(struct aa_ns
 
 fail:
 	remove_rawdata_dents(rawdata);
-	aa_put_i_loaddata(rawdata);
 	return PTR_ERR(dent);
 }
 #endif /* CONFIG_SECURITY_APPARMOR_EXPORT_BINARY */
@@ -1536,13 +1603,10 @@ void __aafs_profile_rmdir(struct aa_prof
 		__aafs_profile_rmdir(child);
 
 	for (i = AAFS_PROF_SIZEOF - 1; i >= 0; --i) {
-		struct aa_proxy *proxy;
 		if (!profile->dents[i])
 			continue;
 
-		proxy = d_inode(profile->dents[i])->i_private;
 		aafs_remove(profile->dents[i]);
-		aa_put_proxy(proxy);
 		profile->dents[i] = NULL;
 	}
 }
@@ -1576,14 +1640,7 @@ static struct dentry *create_profile_fil
 					  struct aa_profile *profile,
 					  const struct file_operations *fops)
 {
-	struct aa_proxy *proxy = aa_get_proxy(profile->label.proxy);
-	struct dentry *dent;
-
-	dent = aafs_create_file(name, S_IFREG | 0444, dir, proxy, fops);
-	if (IS_ERR(dent))
-		aa_put_proxy(proxy);
-
-	return dent;
+	return aafs_create_file(name, S_IFREG | 0444, dir, &profile->label.proxy->count, fops);
 }
 
 #ifdef CONFIG_SECURITY_APPARMOR_EXPORT_BINARY
@@ -1629,7 +1686,8 @@ static const char *rawdata_get_link_base
 					 struct delayed_call *done,
 					 const char *name)
 {
-	struct aa_proxy *proxy = inode->i_private;
+	struct aa_common_ref *ref = inode->i_private;
+	struct aa_proxy *proxy = container_of(ref, struct aa_proxy, count);
 	struct aa_label *label;
 	struct aa_profile *profile;
 	char *target;
@@ -1771,27 +1829,24 @@ int __aafs_profile_mkdir(struct aa_profi
 	if (profile->rawdata) {
 		if (aa_g_hash_policy) {
 			dent = aafs_create("raw_sha256", S_IFLNK | 0444, dir,
-					   profile->label.proxy, NULL, NULL,
-					   &rawdata_link_sha256_iops);
+					   &profile->label.proxy->count, NULL,
+					   NULL, &rawdata_link_sha256_iops);
 			if (IS_ERR(dent))
 				goto fail;
-			aa_get_proxy(profile->label.proxy);
 			profile->dents[AAFS_PROF_RAW_HASH] = dent;
 		}
 		dent = aafs_create("raw_abi", S_IFLNK | 0444, dir,
-				   profile->label.proxy, NULL, NULL,
+				   &profile->label.proxy->count, NULL, NULL,
 				   &rawdata_link_abi_iops);
 		if (IS_ERR(dent))
 			goto fail;
-		aa_get_proxy(profile->label.proxy);
 		profile->dents[AAFS_PROF_RAW_ABI] = dent;
 
 		dent = aafs_create("raw_data", S_IFLNK | 0444, dir,
-				   profile->label.proxy, NULL, NULL,
+				   &profile->label.proxy->count, NULL, NULL,
 				   &rawdata_link_data_iops);
 		if (IS_ERR(dent))
 			goto fail;
-		aa_get_proxy(profile->label.proxy);
 		profile->dents[AAFS_PROF_RAW_DATA] = dent;
 	}
 #endif /*CONFIG_SECURITY_APPARMOR_EXPORT_BINARY */
@@ -1828,7 +1883,7 @@ static int ns_mkdir_op(struct mnt_idmap
 	if (error)
 		return error;
 
-	parent = aa_get_ns(dir->i_private);
+	parent = get_ns_common_ref(dir->i_private);
 	AA_BUG(d_inode(ns_subns_dir(parent)) != dir);
 
 	/* we have to unlock and then relock to get locking order right
@@ -1878,7 +1933,7 @@ static int ns_rmdir_op(struct inode *dir
 	if (error)
 		return error;
 
-	parent = aa_get_ns(dir->i_private);
+	parent = get_ns_common_ref(dir->i_private);
 	/* rmdir calls the generic securityfs functions to remove files
 	 * from the apparmor dir. It is up to the apparmor ns locking
 	 * to avoid races.
@@ -1948,27 +2003,6 @@ void __aafs_ns_rmdir(struct aa_ns *ns)
 
 	__aa_fs_list_remove_rawdata(ns);
 
-	if (ns_subns_dir(ns)) {
-		sub = d_inode(ns_subns_dir(ns))->i_private;
-		aa_put_ns(sub);
-	}
-	if (ns_subload(ns)) {
-		sub = d_inode(ns_subload(ns))->i_private;
-		aa_put_ns(sub);
-	}
-	if (ns_subreplace(ns)) {
-		sub = d_inode(ns_subreplace(ns))->i_private;
-		aa_put_ns(sub);
-	}
-	if (ns_subremove(ns)) {
-		sub = d_inode(ns_subremove(ns))->i_private;
-		aa_put_ns(sub);
-	}
-	if (ns_subrevision(ns)) {
-		sub = d_inode(ns_subrevision(ns))->i_private;
-		aa_put_ns(sub);
-	}
-
 	for (i = AAFS_NS_SIZEOF - 1; i >= 0; --i) {
 		aafs_remove(ns->dents[i]);
 		ns->dents[i] = NULL;
@@ -1993,40 +2027,40 @@ static int __aafs_ns_mkdir_entries(struc
 		return PTR_ERR(dent);
 	ns_subdata_dir(ns) = dent;
 
-	dent = aafs_create_file("revision", 0444, dir, ns,
+	dent = aafs_create_file("revision", 0444, dir,
+				&ns->unconfined->label.count,
 				&aa_fs_ns_revision_fops);
 	if (IS_ERR(dent))
 		return PTR_ERR(dent);
-	aa_get_ns(ns);
 	ns_subrevision(ns) = dent;
 
-	dent = aafs_create_file(".load", 0640, dir, ns,
-				      &aa_fs_profile_load);
+	dent = aafs_create_file(".load", 0640, dir,
+				&ns->unconfined->label.count,
+				&aa_fs_profile_load);
 	if (IS_ERR(dent))
 		return PTR_ERR(dent);
-	aa_get_ns(ns);
 	ns_subload(ns) = dent;
 
-	dent = aafs_create_file(".replace", 0640, dir, ns,
-				      &aa_fs_profile_replace);
+	dent = aafs_create_file(".replace", 0640, dir,
+				&ns->unconfined->label.count,
+				&aa_fs_profile_replace);
 	if (IS_ERR(dent))
 		return PTR_ERR(dent);
-	aa_get_ns(ns);
 	ns_subreplace(ns) = dent;
 
-	dent = aafs_create_file(".remove", 0640, dir, ns,
-				      &aa_fs_profile_remove);
+	dent = aafs_create_file(".remove", 0640, dir,
+				&ns->unconfined->label.count,
+				&aa_fs_profile_remove);
 	if (IS_ERR(dent))
 		return PTR_ERR(dent);
-	aa_get_ns(ns);
 	ns_subremove(ns) = dent;
 
 	  /* use create_dentry so we can supply private data */
-	dent = aafs_create("namespaces", S_IFDIR | 0755, dir, ns, NULL, NULL,
-			   &ns_dir_inode_operations);
+	dent = aafs_create("namespaces", S_IFDIR | 0755, dir,
+			   &ns->unconfined->label.count,
+			   NULL, NULL, &ns_dir_inode_operations);
 	if (IS_ERR(dent))
 		return PTR_ERR(dent);
-	aa_get_ns(ns);
 	ns_subns_dir(ns) = dent;
 
 	return 0;
security/apparmor/include/label.h +8 -8
@@ -101,7 +101,7 @@ enum label_flags {
 
 struct aa_label;
 struct aa_proxy {
-	struct kref count;
+	struct aa_common_ref count;
 	struct aa_label __rcu *label;
 };
 
@@ -121,7 +121,7 @@ struct label_it {
  * @ent: set of profiles for label, actual size determined by @size
  */
 struct aa_label {
-	struct kref count;
+	struct aa_common_ref count;
 	struct rb_node node;
 	struct rcu_head rcu;
 	struct aa_proxy *proxy;
@@ -373,7 +373,7 @@ int aa_label_match(struct aa_profile *pr
  */
 static inline struct aa_label *__aa_get_label(struct aa_label *l)
 {
-	if (l && kref_get_unless_zero(&l->count))
+	if (l && kref_get_unless_zero(&l->count.count))
 		return l;
 
 	return NULL;
@@ -382,7 +382,7 @@ static inline struct aa_label *__aa_get_
 static inline struct aa_label *aa_get_label(struct aa_label *l)
 {
 	if (l)
-		kref_get(&(l->count));
+		kref_get(&(l->count.count));
 
 	return l;
 }
@@ -402,7 +402,7 @@ static inline struct aa_label *aa_get_la
 	rcu_read_lock();
 	do {
 		c = rcu_dereference(*l);
-	} while (c && !kref_get_unless_zero(&c->count));
+	} while (c && !kref_get_unless_zero(&c->count.count));
 	rcu_read_unlock();
 
 	return c;
@@ -442,7 +442,7 @@ static inline struct aa_label *aa_get_ne
 static inline void aa_put_label(struct aa_label *l)
 {
 	if (l)
-		kref_put(&l->count, aa_label_kref);
+		kref_put(&l->count.count, aa_label_kref);
 }
 
 
@@ -452,7 +452,7 @@ void aa_proxy_kref(struct kref *kref);
 static inline struct aa_proxy *aa_get_proxy(struct aa_proxy *proxy)
 {
 	if (proxy)
-		kref_get(&(proxy->count));
+		kref_get(&(proxy->count.count));
 
 	return proxy;
 }
@@ -460,7 +460,7 @@ static inline struct aa_proxy *aa_get_pr
 static inline void aa_put_proxy(struct aa_proxy *proxy)
 {
 	if (proxy)
-		kref_put(&proxy->count, aa_proxy_kref);
+		kref_put(&proxy->count.count, aa_proxy_kref);
 }
 
 void __aa_proxy_redirect(struct aa_label *orig, struct aa_label *new);
security/apparmor/include/lib.h +12 -0
@@ -71,6 +71,18 @@ void aa_info_message(const char *str);
 /* Security blob offsets */
 extern struct lsm_blob_sizes apparmor_blob_sizes;
 
+enum reftype {
+	REF_NS,
+	REF_PROXY,
+	REF_RAWDATA,
+};
+
+/* common reference count used by data the shows up in aafs */
+struct aa_common_ref {
+	struct kref count;
+	enum reftype reftype;
+};
+
 /**
  * aa_strneq - compare null terminated @str to a non null terminated substring
  * @str: a null terminated string
security/apparmor/include/policy.h +4 -4
@@ -329,7 +329,7 @@ static inline aa_state_t ANY_RULE_MEDIAT
 static inline struct aa_profile *aa_get_profile(struct aa_profile *p)
 {
 	if (p)
-		kref_get(&(p->label.count));
+		kref_get(&(p->label.count.count));
 
 	return p;
 }
@@ -343,7 +343,7 @@ static inline struct aa_profile *aa_get_
  */
 static inline struct aa_profile *aa_get_profile_not0(struct aa_profile *p)
 {
-	if (p && kref_get_unless_zero(&p->label.count))
+	if (p && kref_get_unless_zero(&p->label.count.count))
 		return p;
 
 	return NULL;
@@ -363,7 +363,7 @@ static inline struct aa_profile *aa_get_
 	rcu_read_lock();
 	do {
 		c = rcu_dereference(*p);
-	} while (c && !kref_get_unless_zero(&c->label.count));
+	} while (c && !kref_get_unless_zero(&c->label.count.count));
 	rcu_read_unlock();
 
 	return c;
@@ -376,7 +376,7 @@ static inline struct aa_profile *aa_get_
 static inline void aa_put_profile(struct aa_profile *p)
 {
 	if (p)
-		kref_put(&p->label.count, aa_label_kref);
+		kref_put(&p->label.count.count, aa_label_kref);
 }
 
 static inline int AUDIT_MODE(struct aa_profile *profile)
security/apparmor/include/policy_unpack.h +3 -3
@@ -108,7 +108,7 @@ struct aa_ext {
  * fs entries and drops the associated @count ref.
  */
 struct aa_loaddata {
-	struct kref count;
+	struct aa_common_ref count;
 	struct kref pcount;
 	struct list_head list;
 	struct work_struct work;
@@ -143,7 +143,7 @@ aa_get_i_loaddata(struct aa_loaddata *da
 {
 
 	if (data)
-		kref_get(&(data->count));
+		kref_get(&(data->count.count));
 	return data;
 }
 
@@ -171,7 +171,7 @@ struct aa_loaddata *aa_loaddata_alloc(si
 static inline void aa_put_i_loaddata(struct aa_loaddata *data)
 {
 	if (data)
-		kref_put(&data->count, aa_loaddata_kref);
+		kref_put(&data->count.count, aa_loaddata_kref);
 }
 
 static inline void aa_put_profile_loaddata(struct aa_loaddata *data)
security/apparmor/label.c +8 -4
@@ -52,7 +52,8 @@ static void free_proxy(struct aa_proxy *
 
 void aa_proxy_kref(struct kref *kref)
 {
-	struct aa_proxy *proxy = container_of(kref, struct aa_proxy, count);
+	struct aa_proxy *proxy = container_of(kref, struct aa_proxy,
+					      count.count);
 
 	free_proxy(proxy);
 }
@@ -63,7 +64,8 @@ struct aa_proxy *aa_alloc_proxy(struct a
 
 	new = kzalloc(sizeof(struct aa_proxy), gfp);
 	if (new) {
-		kref_init(&new->count);
+		kref_init(&new->count.count);
+		new->count.reftype = REF_PROXY;
 		rcu_assign_pointer(new->label, aa_get_label(label));
 	}
 	return new;
@@ -371,7 +373,8 @@ static void label_free_rcu(struct rcu_he
 
 void aa_label_kref(struct kref *kref)
 {
-	struct aa_label *label = container_of(kref, struct aa_label, count);
+	struct aa_label *label = container_of(kref, struct aa_label,
+					      count.count);
 	struct aa_ns *ns = labels_ns(label);
 
 	if (!ns) {
@@ -408,7 +411,8 @@ bool aa_label_init(struct aa_label *labe
 
 	label->size = size;			/* doesn't include null */
 	label->vec[size] = NULL;		/* null terminate */
-	kref_init(&label->count);
+	kref_init(&label->count.count);
+	label->count.reftype = REF_NS;		/* for aafs purposes */
 	RB_CLEAR_NODE(&label->node);
 
 	return true;
security/apparmor/policy_unpack.c +4 -2
@@ -118,7 +118,8 @@ static void do_loaddata_free(struct aa_l
 
 void aa_loaddata_kref(struct kref *kref)
 {
-	struct aa_loaddata *d = container_of(kref, struct aa_loaddata, count);
+	struct aa_loaddata *d = container_of(kref, struct aa_loaddata,
+					     count.count);
 
 	do_loaddata_free(d);
 }
@@ -165,7 +166,8 @@ struct aa_loaddata *aa_loaddata_alloc(si
 		kfree(d);
 		return ERR_PTR(-ENOMEM);
 	}
-	kref_init(&d->count);
+	kref_init(&d->count.count);
+	d->count.reftype = REF_RAWDATA;
 	kref_init(&d->pcount);
 	INIT_LIST_HEAD(&d->list);
 
author maintainer
#276 lore raw

PATCH 261/265 ext4: fix potential null deref in ext4_mb_init()

In reply to Greg Kroah-Hartman

6.12-stable review patch. If anyone has any objections, please let me know.

------------------

From: Baokun Li <[email protected]>

commit 3c3fac6bc0a9c00dbe65d8dc0d3a282afe4d3188 upstream.

In ext4_mb_init(), ext4_mb_avg_fragment_size_destroy() may be called when sbi->s_mb_avg_fragment_size remains uninitialized (e.g., if groupinfo slab cache allocation fails). Since ext4_mb_avg_fragment_size_destroy() lacks null pointer checking, this leads to a null pointer dereference.

==================================================================
EXT4-fs: no memory for groupinfo slab cache

BUG: kernel NULL pointer dereference, address: 0000000000000000
PGD 0 P4D 0
Oops: Oops: 0002 [#1] SMP PTI
CPU:2 UID: 0 PID: 87 Comm:mount Not tainted 6.17.0-rc2 #1134 PREEMPT(none)
RIP: 0010:_raw_spin_lock_irqsave+0x1b/0x40
Call Trace:
 <TASK>
 xa_destroy+0x61/0x130
 ext4_mb_init+0x483/0x540
 __ext4_fill_super+0x116d/0x17b0
 ext4_fill_super+0xd3/0x280
 get_tree_bdev_flags+0x132/0x1d0
 vfs_get_tree+0x29/0xd0
 do_new_mount+0x197/0x300
 __x64_sys_mount+0x116/0x150
 do_syscall_64+0x50/0x1c0
 entry_SYSCALL_64_after_hwframe+0x76/0x7e
==================================================================

Therefore, add necessary null check to ext4_mb_avg_fragment_size_destroy() to prevent this issue. The same fix is also applied to ext4_mb_largest_free_orders_destroy().

---
 fs/ext4/mballoc.c |   10 ++++++++++
 1 file changed, 10 insertions(+)
fs/ext4/mballoc.c +10 -0
@@ -3678,16 +3678,26 @@ static void ext4_discard_work(struct wor
 
 static inline void ext4_mb_avg_fragment_size_destroy(struct ext4_sb_info *sbi)
 {
+	if (!sbi->s_mb_avg_fragment_size)
+		return;
+
 	for (int i = 0; i < MB_NUM_ORDERS(sbi->s_sb); i++)
 		xa_destroy(&sbi->s_mb_avg_fragment_size[i]);
+
 	kfree(sbi->s_mb_avg_fragment_size);
+	sbi->s_mb_avg_fragment_size = NULL;
 }
 
 static inline void ext4_mb_largest_free_orders_destroy(struct ext4_sb_info *sbi)
 {
+	if (!sbi->s_mb_largest_free_orders)
+		return;
+
 	for (int i = 0; i < MB_NUM_ORDERS(sbi->s_sb); i++)
 		xa_destroy(&sbi->s_mb_largest_free_orders[i]);
+
 	kfree(sbi->s_mb_largest_free_orders);
+	sbi->s_mb_largest_free_orders = NULL;
 }
 
 int ext4_mb_init(struct super_block *sb)
author maintainer
#277 lore raw

PATCH 262/265 ata: libata-core: fix cancellation of a port deferred qc work

In reply to Greg Kroah-Hartman

6.12-stable review patch. If anyone has any objections, please let me know.

------------------

From: Damien Le Moal <[email protected]>

commit 55db009926634b20955bd8abbee921adbc8d2cb4 upstream.

cancel_work_sync() is a sleeping function so it cannot be called with the spin lock of a port being held. Move the call to this function in ata_port_detach() after EH completes, with the port lock released, together with other work cancellation calls.

Fixes 0ea84089dbf6 ("ata: libata-scsi: avoid Non-NCQ command starvation")
---
 drivers/ata/libata-core.c |    8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)
drivers/ata/libata-core.c +3 -5
@@ -6132,10 +6132,6 @@ static void ata_port_detach(struct ata_p
 		}
 	}
 
-	/* Make sure the deferred qc work finished. */
-	cancel_work_sync(&ap->deferred_qc_work);
-	WARN_ON(ap->deferred_qc);
-
 	/* Tell EH to disable all devices */
 	ap->pflags |= ATA_PFLAG_UNLOADING;
 	ata_port_schedule_eh(ap);
@@ -6146,9 +6142,11 @@ static void ata_port_detach(struct ata_p
 	/* wait till EH commits suicide */
 	ata_port_wait_eh(ap);
 
-	/* it better be dead now */
+	/* It better be dead now and not have any remaining deferred qc. */
 	WARN_ON(!(ap->pflags & ATA_PFLAG_UNLOADED));
+	WARN_ON(ap->deferred_qc);
 
+	cancel_work_sync(&ap->deferred_qc_work);
 	cancel_delayed_work_sync(&ap->hotplug_task);
 	cancel_delayed_work_sync(&ap->scsi_rescan_task);
 
author maintainer
#278 lore raw

PATCH 263/265 ata: libata-eh: correctly handle deferred qc timeouts

In reply to Greg Kroah-Hartman

6.12-stable review patch. If anyone has any objections, please let me know.

------------------

From: Damien Le Moal <[email protected]>

commit eddb98ad9364b4e778768785d46cfab04ce52100 upstream.

A deferred qc may timeout while waiting for the device queue to drain to be submitted. In such case, since the qc is not active, ata_scsi_cmd_error_handler() ends up calling scsi_eh_finish_cmd(), which frees the qc. But as the port deferred_qc field still references this finished/freed qc, the deferred qc work may eventually attempt to call ata_qc_issue() against this invalid qc, leading to errors such as reported by UBSAN (syzbot run):

UBSAN: shift-out-of-bounds in drivers/ata/libata-core.c:5166:24
shift exponent 4210818301 is too large for 64-bit type 'long long unsigned int'
...
Call Trace:
 <TASK>
 __dump_stack lib/dump_stack.c:94 [inline]
 dump_stack_lvl+0x100/0x190 lib/dump_stack.c:120
 ubsan_epilogue+0xa/0x30 lib/ubsan.c:233
 __ubsan_handle_shift_out_of_bounds+0x279/0x2a0 lib/ubsan.c:494
 ata_qc_issue.cold+0x38/0x9f drivers/ata/libata-core.c:5166
 ata_scsi_deferred_qc_work+0x154/0x1f0 drivers/ata/libata-scsi.c:1679
 process_one_work+0x9d7/0x1920 kernel/workqueue.c:3275
 process_scheduled_works kernel/workqueue.c:3358 [inline]
 worker_thread+0x5da/0xe40 kernel/workqueue.c:3439
 kthread+0x370/0x450 kernel/kthread.c:467
 ret_from_fork+0x754/0xd80 arch/x86/kernel/process.c:158
 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245
 </TASK>

Fix this by checking if the qc of a timed out SCSI command is a deferred one, and in such case, clear the port deferred_qc field and finish the SCSI command with DID_TIME_OUT.

Reported-by [email protected]
Fixes 0ea84089dbf6 ("ata: libata-scsi: avoid Non-NCQ command starvation")
---
 drivers/ata/libata-eh.c |   22 +++++++++++++++++++---
 1 file changed, 19 insertions(+), 3 deletions(-)
drivers/ata/libata-eh.c +19 -3
@@ -642,12 +642,28 @@ void ata_scsi_cmd_error_handler(struct S
 		set_host_byte(scmd, DID_OK);
 
 		ata_qc_for_each_raw(ap, qc, i) {
-			if (qc->flags & ATA_QCFLAG_ACTIVE &&
-			    qc->scsicmd == scmd)
+			if (qc->scsicmd != scmd)
+				continue;
+			if ((qc->flags & ATA_QCFLAG_ACTIVE) ||
+			    qc == ap->deferred_qc)
 				break;
 		}
 
-		if (i < ATA_MAX_QUEUE) {
+		if (qc == ap->deferred_qc) {
+			/*
+			 * This is a deferred command that timed out while
+			 * waiting for the command queue to drain. Since the qc
+			 * is not active yet (deferred_qc is still set, so the
+			 * deferred qc work has not issued the command yet),
+			 * simply signal the timeout by finishing the SCSI
+			 * command and clear the deferred qc to prevent the
+			 * deferred qc work from issuing this qc.
+			 */
+			WARN_ON_ONCE(qc->flags & ATA_QCFLAG_ACTIVE);
+			ap->deferred_qc = NULL;
+			set_host_byte(scmd, DID_TIME_OUT);
+			scsi_eh_finish_cmd(scmd, &ap->eh_done_q);
+		} else if (i < ATA_MAX_QUEUE) {
 			/* the scmd has an associated qc */
 			if (!(qc->flags & ATA_QCFLAG_EH)) {
 				/* which hasn't failed yet, timeout */
author maintainer
#279 lore raw

PATCH 264/265 ata: libata: cancel pending work after clearing deferred_qc

In reply to Greg Kroah-Hartman

6.12-stable review patch. If anyone has any objections, please let me know.

------------------

From: Niklas Cassel <[email protected]>

commit aac9b27f7c1f2b2cf7f50a9ca633ecbbcaf22af9 upstream.

Syzbot reported a WARN_ON() in ata_scsi_deferred_qc_work(), caused by ap->ops->qc_defer() returning non-zero before issuing the deferred qc.

ata_scsi_schedule_deferred_qc() is called during each command completion. This function will check if there is a deferred QC, and if ap->ops->qc_defer() returns zero, meaning that it is possible to queue the deferred qc at this time (without being deferred), then it will queue the work which will issue the deferred qc.

Once the work get to run, which can potentially be a very long time after the work was scheduled, there is a WARN_ON() if ap->ops->qc_defer() returns non-zero.

While we hold the ap->lock both when assigning and clearing deferred_qc, and the work itself holds the ap->lock, the code currently does not cancel the work after clearing the deferred qc.

This means that the following scenario can happen:
1) One or several NCQ commands are queued.
2) A non-NCQ command is queued, gets stored in ap->deferred_qc.
3) Last NCQ command gets completed, work is queued to issue the deferred qc.
4) Timeout or error happens, ap->deferred_qc is cleared. The queued work is currently NOT canceled.
5) Port is reset.
6) One or several NCQ commands are queued.
7) A non-NCQ command is queued, gets stored in ap->deferred_qc.
8) Work is finally run. Yet at this time, there is still NCQ commands in flight.

The work in 8) really belongs to the non-NCQ command in 2), not to the non-NCQ command in 7). The reason why the work is executed when it is not supposed to, is because it was never canceled when ap->deferred_qc was cleared in 4). Thus, ensure that we always cancel the work after clearing ap->deferred_qc.

Another potential fix would have been to let ata_scsi_deferred_qc_work() do nothing if ap->ops->qc_defer() returns non-zero. However, canceling the work when clearing ap->deferred_qc seems slightly more logical, as we hold the ap->lock when clearing ap->deferred_qc, so we know that the work cannot be holding the lock. (The function could be waiting for the lock, but that is okay since it will do nothing if ap->deferred_qc is not set.)

Reported-by [email protected]
Fixes 0ea84089dbf6 ("ata: libata-scsi: avoid Non-NCQ command starvation")
Fixes eddb98ad9364 ("ata: libata-eh: correctly handle deferred qc timeouts")
---
 drivers/ata/libata-eh.c   |    1 +
 drivers/ata/libata-scsi.c |    1 +
 2 files changed, 2 insertions(+)
drivers/ata/libata-eh.c +1 -0
@@ -661,6 +661,7 @@ void ata_scsi_cmd_error_handler(struct S
 			 */
 			WARN_ON_ONCE(qc->flags & ATA_QCFLAG_ACTIVE);
 			ap->deferred_qc = NULL;
+			cancel_work(&ap->deferred_qc_work);
 			set_host_byte(scmd, DID_TIME_OUT);
 			scsi_eh_finish_cmd(scmd, &ap->eh_done_q);
 		} else if (i < ATA_MAX_QUEUE) {
drivers/ata/libata-scsi.c +1 -0
@@ -1712,6 +1712,7 @@ void ata_scsi_requeue_deferred_qc(struct
 
 	scmd = qc->scsicmd;
 	ap->deferred_qc = NULL;
+	cancel_work(&ap->deferred_qc_work);
 	ata_qc_free(qc);
 	scmd->result = (DID_SOFT_ERROR << 16);
 	scsi_done(scmd);
author maintainer
#280 lore raw

PATCH 265/265 ata: libata-eh: Fix detection of deferred qc timeouts

In reply to Greg Kroah-Hartman

6.12-stable review patch. If anyone has any objections, please let me know.

------------------

From: Guenter Roeck <[email protected]>

commit ee0e6e69a772d601e152e5368a1da25d656122a8 upstream.

If the ata_qc_for_each_raw() loop finishes without finding a matching SCSI command for any QC, the variable qc will hold a pointer to the last element examined, which has the tag i == ATA_MAX_QUEUE - 1. This qc can match the port deferred QC (ap->deferred_qc).

If that happens, the condition qc == ap->deferred_qc evaluates to true despite the loop not breaking with a match on the SCSI command for this QC. In that case, the error handler mistakenly intercepts a command that has not been issued yet and that has not timed out, and thus erroneously returning a timeout error.

Fix the problem by checking for i < ATA_MAX_QUEUE in addition to qc == ap->deferred_qc.

The problem was found by an experimental code review agent based on gemini-3.1-pro while reviewing backports into v6.18.y.

Assisted-by Gemini:gemini-3.1-pro
Fixes eddb98ad9364 ("ata: libata-eh: correctly handle deferred qc timeouts")
[cassel: modified commit log as suggested by Damien]
---
 drivers/ata/libata-eh.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/ata/libata-eh.c +1 -1
@@ -649,7 +649,7 @@ void ata_scsi_cmd_error_handler(struct S
 				break;
 		}
 
-		if (qc == ap->deferred_qc) {
+		if (i < ATA_MAX_QUEUE && qc == ap->deferred_qc) {
 			/*
 			 * This is a deferred command that timed out while
 			 * waiting for the command queue to drain. Since the qc
Tested-by on the v1 series
#282 lore raw
In reply to Greg Kroah-Hartman
Quoted 9 lines · Greg Kroah-Hartman

This is the start of the stable review cycle for the 6.12.77 release. There are 265 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.

Responses should be made by Fri, 13 Mar 2026 20:09:29 +0000. Anything received after that time might be too late.

The whole patch series can be found in one patch at:

Quoted 9 lines
	https://www.kernel.org/pub/linux/kernel/v6.x/stable-review/patch-6.12.77-rc1.gz

or in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-6.12.y
and the diffstat can be found below.

thanks,

greg k-h

Compiled and booted on my test system. No dmesg regressions.

thanks,
-- Shuah

#283 lore raw

freeze during boot regression Re: [PATCH 6.12 000/265] 6.12.77-rc1 review

In reply to Greg Kroah-Hartman
Quoted 9 lines · Greg Kroah-Hartman

This is the start of the stable review cycle for the 6.12.77 release. There are 265 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.

Responses should be made by Fri, 13 Mar 2026 20:09:29 +0000. Anything received after that time might be too late.

The whole patch series can be found in one patch at:

Quoted 8 lines
	https://www.kernel.org/pub/linux/kernel/v6.x/stable-review/patch-6.12.77-rc1.gz

or in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-6.12.y
and the diffstat can be found below.

thanks,

greg k-h

Intermittently, but significantly greater than 50% of the time, 6.12.77-rc1 fails to boot on my Lenovo ThinkPad T14 Gen 1 running Debian 12 bookworm. When boot fails, the last couple lines of console output (retyped from a photo) are:

Loading, please wait...
Starting systemd-udevd version 252.39-1~deb12u1

I will begin bisection shortly. I happen to have also previously compiled 6.12.76 + stable-queue as of
commit 4b2b2b5cf3cd78f4de4646687a4efecbd21643af, and that shows the same boot failures. That means the following patches are *not* to blame for the problem:

net-sched-only-allow-act_ct-to-bind-to-clsact-ingress-qdiscs-and-shared-blocks.patch apparmor-validate-dfa-start-states-are-in-bounds-in-unpack_pdb.patch apparmor-fix-memory-leak-in-verify_header.patch apparmor-replace-recursive-profile-removal-with-iterative-approach.patch apparmor-fix-limit-the-number-of-levels-of-policy-namespaces.patch apparmor-fix-side-effect-bug-in-match_char-macro-usage.patch apparmor-fix-missing-bounds-check-on-default-table-in-verify_dfa.patch apparmor-fix-double-free-of-ns_name-in-aa_replace_profiles.patch apparmor-fix-unprivileged-local-user-can-do-privileged-policy-management.patch apparmor-fix-differential-encoding-verification.patch apparmor-fix-race-on-rawdata-dereference.patch apparmor-fix-race-between-freeing-data-and-fs-accessing-it.patch ext4-fix-potential-null-deref-in-ext4_mb_init.patch ata-libata-core-fix-cancellation-of-a-port-deferred-qc-work.patch ata-libata-eh-correctly-handle-deferred-qc-timeouts.patch ata-libata-cancel-pending-work-after-clearing-deferred_qc.patch ata-libata-eh-fix-detection-of-deferred-qc-timeouts.patch

Signature · 1 line
-Barry K. Nathan  <[email protected]>
#284 lore raw

Re: freeze during boot regression Re: [PATCH 6.12 000/265] 6.12.77-rc1 review

Quoted 24 lines · Barry K. Nathan
Quoted 14 lines · Greg Kroah-Hartman

This is the start of the stable review cycle for the 6.12.77 release. There are 265 patches in this series, all will be posted as a response to this one.  If anyone has any issues with these being applied, please let me know.

Responses should be made by Fri, 13 Mar 2026 20:09:29 +0000. Anything received after that time might be too late.

The whole patch series can be found in one patch at:
    https://www.kernel.org/pub/linux/kernel/v6.x/stable-review/patch-6.12.77-rc1.gz
or in the git tree and branch at:
    git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-6.12.y and the diffstat can be found below.

Quoted 3 lines

thanks,

greg k-h

Intermittently, but significantly greater than 50% of the time, 6.12.77-rc1 fails to boot on my Lenovo ThinkPad T14 Gen 1 running Debian 12 bookworm. When boot fails, the last couple lines of console output (retyped from a photo) are:

Quoted 8 lines

Loading, please wait...
Starting systemd-udevd version 252.39-1~deb12u1

I will begin bisection shortly. I happen to have also previously compiled 6.12.76 + stable-queue as of
commit 4b2b2b5cf3cd78f4de4646687a4efecbd21643af, and that shows the same boot failures. That means the following patches are *not* to blame for the problem:

[snip]

I also happen to have previously compiled 6.12.76 + stable-queue as of commit 8d45879cc803965facf8d8257f13d130508b5986, and that also shows the same boot failures, so that narrows the cause down to the following 40 patches:

drm-vmwgfx-fix-invalid-kref_put-callback-in-vmw_bo_d.patch drm-vmwgfx-return-the-correct-value-in-vmw_translate.patch drm-logicvc-fix-device-node-reference-leak-in-logicv.patch kvm-arm64-advertise-support-for-feat_sctlr2.patch kvm-arm64-hide-s1poe-from-guests-when-not-supported-.patch irqchip-sifive-plic-fix-frozen-interrupt-due-to-affi.patch scsi-lpfc-properly-set-wc-for-dpp-mapping.patch scsi-pm8001-fix-use-after-free-in-pm8001_queue_comma.patch alsa-scarlett2-fix-redeclaration-of-loop-variable.patch alsa-scarlett2-fix-dsp-filter-control-array-handling.patch alsa-usb-audio-remove-validate_rates-quirk-for-focus.patch x86-fred-correct-speculative-safety-in-fred_extint.patch sched-fair-fix-eevdf-entity-placement-bug-causing-sc.patch sched-fair-fix-lag-clamp.patch rseq-clarify-rseq-registration-rseq_size-bound-check.patch cgroup-cpuset-fix-incorrect-use-of-cpuset_update_tas.patch scsi-ufs-core-move-link-recovery-for-hibern8-exit-fa.patch alsa-usb-audio-cap-the-packet-size-pre-calculations.patch alsa-usb-audio-use-inclusive-terms.patch perf-fix-__perf_event_overflow-vs-perf_remove_from_c.patch s390-idle-fix-cpu-idle-exit-cpu-time-accounting.patch s390-vtime-fix-virtual-timer-forwarding.patch pci-endpoint-introduce-pci_epc_function_is_valid.patch pci-endpoint-introduce-pci_epc_mem_map-unmap.patch pci-dwc-endpoint-implement-the-pci_epc_ops-align_add.patch pci-dwc-ep-use-align-addr-function-for-dw_pcie_ep_ra.patch pci-dwc-ep-flush-msi-x-write-before-unmapping-its-at.patch drm-amdgpu-unlock-a-mutex-before-destroying-it.patch drm-amdgpu-replace-kzalloc-copy_from_user-with-memdu.patch drm-amdgpu-fix-locking-bugs-in-error-paths.patch alsa-pci-hda-use-snd_kcontrol_chip.patch alsa-hda-cs35l56-fix-signedness-error-in-cs35l56_hda.patch btrfs-fix-incorrect-key-offset-in-error-message-in-c.patch btrfs-fix-objectid-value-in-error-message-in-check_e.patch btrfs-fix-warning-in-scrub_verify_one_metadata.patch btrfs-print-correct-subvol-num-if-active-swapfile-pr.patch btrfs-fix-compat-mask-in-error-messages-in-btrfs_che.patch bpf-arm64-force-8-byte-alignment-for-jit-buffer-to-p.patch bpf-fix-stack-out-of-bounds-write-in-devmap.patch pci-correct-pci_cap_exp_endpoint_sizeof_v2-value.patch

I expect my next followup to be once I finish bisection.

Signature · 1 line
-Barry K. Nathan  <[email protected]>
#285 lore raw

Re: freeze during boot regression Re: [PATCH 6.12 000/265] 6.12.77-rc1 review

Quoted 81 lines · Barry K. Nathan
Quoted 24 lines · Barry K. Nathan
Quoted 14 lines · Greg Kroah-Hartman

This is the start of the stable review cycle for the 6.12.77 release. There are 265 patches in this series, all will be posted as a response to this one.  If anyone has any issues with these being applied, please let me know.

Responses should be made by Fri, 13 Mar 2026 20:09:29 +0000. Anything received after that time might be too late.

The whole patch series can be found in one patch at:
    https://www.kernel.org/pub/linux/kernel/v6.x/stable-review/patch-6.12.77-rc1.gz
or in the git tree and branch at:
    git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-6.12.y and the diffstat can be found below.

Quoted 3 lines

thanks,

greg k-h

Intermittently, but significantly greater than 50% of the time, 6.12.77-rc1 fails to boot on my Lenovo ThinkPad T14 Gen 1 running Debian 12 bookworm. When boot fails, the last couple lines of console output (retyped from a photo) are:

Quoted 8 lines

Loading, please wait...
Starting systemd-udevd version 252.39-1~deb12u1

I will begin bisection shortly. I happen to have also previously compiled 6.12.76 + stable-queue as of
commit 4b2b2b5cf3cd78f4de4646687a4efecbd21643af, and that shows the same boot failures. That means the following patches are *not* to blame for the problem:

[snip]

I also happen to have previously compiled 6.12.76 + stable-queue as of commit 8d45879cc803965facf8d8257f13d130508b5986, and that also shows the same boot failures, so that narrows the cause down to the following 40 patches:

drm-vmwgfx-fix-invalid-kref_put-callback-in-vmw_bo_d.patch drm-vmwgfx-return-the-correct-value-in-vmw_translate.patch drm-logicvc-fix-device-node-reference-leak-in-logicv.patch kvm-arm64-advertise-support-for-feat_sctlr2.patch kvm-arm64-hide-s1poe-from-guests-when-not-supported-.patch irqchip-sifive-plic-fix-frozen-interrupt-due-to-affi.patch scsi-lpfc-properly-set-wc-for-dpp-mapping.patch scsi-pm8001-fix-use-after-free-in-pm8001_queue_comma.patch alsa-scarlett2-fix-redeclaration-of-loop-variable.patch alsa-scarlett2-fix-dsp-filter-control-array-handling.patch alsa-usb-audio-remove-validate_rates-quirk-for-focus.patch x86-fred-correct-speculative-safety-in-fred_extint.patch sched-fair-fix-eevdf-entity-placement-bug-causing-sc.patch sched-fair-fix-lag-clamp.patch rseq-clarify-rseq-registration-rseq_size-bound-check.patch cgroup-cpuset-fix-incorrect-use-of-cpuset_update_tas.patch scsi-ufs-core-move-link-recovery-for-hibern8-exit-fa.patch alsa-usb-audio-cap-the-packet-size-pre-calculations.patch alsa-usb-audio-use-inclusive-terms.patch perf-fix-__perf_event_overflow-vs-perf_remove_from_c.patch s390-idle-fix-cpu-idle-exit-cpu-time-accounting.patch s390-vtime-fix-virtual-timer-forwarding.patch pci-endpoint-introduce-pci_epc_function_is_valid.patch pci-endpoint-introduce-pci_epc_mem_map-unmap.patch pci-dwc-endpoint-implement-the-pci_epc_ops-align_add.patch pci-dwc-ep-use-align-addr-function-for-dw_pcie_ep_ra.patch pci-dwc-ep-flush-msi-x-write-before-unmapping-its-at.patch drm-amdgpu-unlock-a-mutex-before-destroying-it.patch drm-amdgpu-replace-kzalloc-copy_from_user-with-memdu.patch drm-amdgpu-fix-locking-bugs-in-error-paths.patch alsa-pci-hda-use-snd_kcontrol_chip.patch alsa-hda-cs35l56-fix-signedness-error-in-cs35l56_hda.patch btrfs-fix-incorrect-key-offset-in-error-message-in-c.patch btrfs-fix-objectid-value-in-error-message-in-check_e.patch btrfs-fix-warning-in-scrub_verify_one_metadata.patch btrfs-print-correct-subvol-num-if-active-swapfile-pr.patch btrfs-fix-compat-mask-in-error-messages-in-btrfs_che.patch bpf-arm64-force-8-byte-alignment-for-jit-buffer-to-p.patch bpf-fix-stack-out-of-bounds-write-in-devmap.patch pci-correct-pci_cap_exp_endpoint_sizeof_v2-value.patch

Quoted 1 line

I expect my next followup to be once I finish bisection.

I'm seeing this WARN on RISC-V in the same place.

Starting systemd-udevd version 255.4-1ubuntu8.12
[    5.417957] usb 1-2: new high-speed USB device number 2 using xhci_hcd
[    5.765956] ------------[ cut here ]------------
[    5.765976] WARNING: CPU: 0 PID: 17 at kernel/sched/fair.c:5266 place_entity+0x130/0x138 [    5.766013] Modules linked in:
[    5.766028] CPU: 0 UID: 0 PID: 17 Comm: rcu_preempt Not tainted 6.12.77-rc1 #2 [    5.766038] Hardware name: SiFive HiFive Unmatched A00 (DT)
[    5.766043] epc : place_entity+0x130/0x138
[    5.766052]  ra : place_entity+0x9c/0x138
[    5.766061] epc : ffffffff800721c8 ra : ffffffff80072134 sp : ffffffc6000a3af0 [    5.766067]  gp : ffffffff823a8a70 tp : ffffffd6808c1d80 t0 : 0000000000000000 [    5.766072]  t1 : 0000000000000000 t2 : 0000000000000000 s0 : ffffffc6000a3b30 [    5.766078]  s1 : ffffffd9fed138c0 a0 : 0000000000577fff a1 : ffffffd681175400 [    5.766084]  a2 : 0000000000000000 a3 : 0000000000000177 a4 : 0000000000000000 [    5.766089]  a5 : 0000000026fdb4a5 a6 : 0000000000000000 a7 : 0000000000000002 [    5.766095]  s2 : 0000000000000000 s3 : ffffffd9fed137c0 s4 : ffffffd682b1d880 [    5.766100]  s5 : 0000000000000200 s6 : 0000000000000003 s7 : 0000000000000001 [    5.766106]  s8 : ffffffd9fed138c0 s9 : 0000000000200b20 s10: ffffffd681175400 [    5.766112]  s11: 0000000000000000 t3 : 0000000000000000 t4 : 0000000000000000 [    5.766117]  t5 : 0000000000000000 t6 : 0000000000000000
[    5.766121] status: 0000000200000100 badaddr: 0000000000000177 cause: 0000000000000003 [    5.766130] [<ffffffff800721c8>] place_entity+0x130/0x138
[    5.766141] [<ffffffff80072780>] reweight_entity+0x178/0x1a0
[    5.766151] [<ffffffff8007285e>] update_cfs_group+0x76/0xa8
[    5.766161] [<ffffffff80073340>] dequeue_entities+0x120/0x550
[    5.766171] [<ffffffff800738c4>] pick_task_fair+0x84/0x108
[    5.766179] [<ffffffff8007b954>] pick_next_task_fair+0x1c/0x1b0
[    5.766192] [<ffffffff80e2fe72>] __schedule+0x172/0xc10
[    5.766204] [<ffffffff80e30932>] schedule+0x22/0x140
[    5.766212] [<ffffffff80e36df0>] schedule_timeout+0x80/0x180
[    5.766226] [<ffffffff800d3586>] rcu_gp_fqs_loop+0xfe/0x4d0
[    5.766243] [<ffffffff800d6a12>] rcu_gp_kthread+0x122/0x158
[    5.766255] [<ffffffff80050280>] kthread+0xc8/0xe8
[    5.766268] [<ffffffff80e39cce>] ret_from_fork+0xe/0x18
[    5.766282] ---[ end trace 0000000000000000 ]---
[    5.992429] usb 1-2: New USB device found, idVendor=174c, idProduct=2074, bcdDevice= 0.01 [    5.999916] usb 1-2: New USB device strings: Mfr=2, Product=3, SerialNumber=1 [    6.007028] usb 1-2: Product: AS2107

Probably those sched/fair patches.

#286 lore raw

Re: freeze during boot regression Re: [PATCH 6.12 000/265] 6.12.77-rc1 review

Quoted 32 lines · Ron Economos

I'm seeing this WARN on RISC-V in the same place.

Starting systemd-udevd version 255.4-1ubuntu8.12
[    5.417957] usb 1-2: new high-speed USB device number 2 using xhci_hcd
[    5.765956] ------------[ cut here ]------------
[    5.765976] WARNING: CPU: 0 PID: 17 at kernel/sched/fair.c:5266 place_entity+0x130/0x138 [    5.766013] Modules linked in:
[    5.766028] CPU: 0 UID: 0 PID: 17 Comm: rcu_preempt Not tainted 6.12.77-rc1 #2 [    5.766038] Hardware name: SiFive HiFive Unmatched A00 (DT)
[    5.766043] epc : place_entity+0x130/0x138
[    5.766052]  ra : place_entity+0x9c/0x138
[    5.766061] epc : ffffffff800721c8 ra : ffffffff80072134 sp : ffffffc6000a3af0 [    5.766067]  gp : ffffffff823a8a70 tp : ffffffd6808c1d80 t0 : 0000000000000000 [    5.766072]  t1 : 0000000000000000 t2 : 0000000000000000 s0 : ffffffc6000a3b30 [    5.766078]  s1 : ffffffd9fed138c0 a0 : 0000000000577fff a1 : ffffffd681175400 [    5.766084]  a2 : 0000000000000000 a3 : 0000000000000177 a4 : 0000000000000000 [    5.766089]  a5 : 0000000026fdb4a5 a6 : 0000000000000000 a7 : 0000000000000002 [    5.766095]  s2 : 0000000000000000 s3 : ffffffd9fed137c0 s4 : ffffffd682b1d880 [    5.766100]  s5 : 0000000000000200 s6 : 0000000000000003 s7 : 0000000000000001 [    5.766106]  s8 : ffffffd9fed138c0 s9 : 0000000000200b20 s10: ffffffd681175400 [    5.766112]  s11: 0000000000000000 t3 : 0000000000000000 t4 : 0000000000000000 [    5.766117]  t5 : 0000000000000000 t6 : 0000000000000000
[    5.766121] status: 0000000200000100 badaddr: 0000000000000177 cause: 0000000000000003 [    5.766130] [<ffffffff800721c8>] place_entity+0x130/0x138
[    5.766141] [<ffffffff80072780>] reweight_entity+0x178/0x1a0
[    5.766151] [<ffffffff8007285e>] update_cfs_group+0x76/0xa8
[    5.766161] [<ffffffff80073340>] dequeue_entities+0x120/0x550
[    5.766171] [<ffffffff800738c4>] pick_task_fair+0x84/0x108
[    5.766179] [<ffffffff8007b954>] pick_next_task_fair+0x1c/0x1b0
[    5.766192] [<ffffffff80e2fe72>] __schedule+0x172/0xc10
[    5.766204] [<ffffffff80e30932>] schedule+0x22/0x140
[    5.766212] [<ffffffff80e36df0>] schedule_timeout+0x80/0x180

Quoted 8 lines

[    5.766226] [<ffffffff800d3586>] rcu_gp_fqs_loop+0xfe/0x4d0
[    5.766243] [<ffffffff800d6a12>] rcu_gp_kthread+0x122/0x158
[    5.766255] [<ffffffff80050280>] kthread+0xc8/0xe8
[    5.766268] [<ffffffff80e39cce>] ret_from_fork+0xe/0x18
[    5.766282] ---[ end trace 0000000000000000 ]---
[    5.992429] usb 1-2: New USB device found, idVendor=174c, idProduct=2074, bcdDevice= 0.01 [    5.999916] usb 1-2: New USB device strings: Mfr=2, Product=3, SerialNumber=1 [    6.007028] usb 1-2: Product: AS2107

Similar warning on i.MX8MP

[    6.426039] ------------[ cut here ]------------
[    6.426058] WARNING: CPU: 0 PID: 1 at /kernel/sched/fair.c:5266 place_entity+0x114/0x120
[    6.426082] Modules linked in: rfcomm uas ahci libahci libata nls_iso8859_1 bnep onboard_usb_dev nls_cp437 dwc3 snd_soc_hdmi_codec dw_hdmi_cec dw_hdmi_gp_audio imx8mp_interconnect spidev caam_jr caamhash_desc caamalg_desc crypto_engine rng_core authenc libdes crypto_null evdev aes_ce_blk aes_ce_cipher ghash_ce gf128mul imx8mp_hdmi_tx snd_soc_imx_hdmi sha2_ce sha256_arm64 sha1_ce hantro_vpu sha1_generic snd_soc_simple_card fsl_imx8_ddr_perf dw_hdmi snd_soc_simple_card_utils cec v4l2_vp9 mwifiex_sdio v4l2_h264 drm_display_helper hci_uart phy_fsl_imx8mq_usb mwifiex phy_fsl_samsung_hdmi phy_fsl_imx8m_pcie imx8mp_hdmi_pvi snd_soc_fsl_sai snd_soc_fsl_utils bluetooth etnaviv governor_userspace imx_pcm_dma ecdh_generic gpu_sched dwc3_imx8mp cfg80211 samsung_dsim snd_soc_fsl_aud2htx imx_bus ecc rfkill ti_ads1015 libaes industrialio_triggered_buffer kfifo_buf snd_soc_wm8904 ina2xx lm75 lontium_lt8912b imx_sdma spi_nxp_fspi caam error snvs_pwrkey nvmem_snvs_lpgpr flexcan usb_conn_gpio can_dev imx8mm_thermal spi_imx pwm_imx27
[    6.426327]  roles display_connector gpio_keys fuse ipv6 autofs4
[    6.426353] CPU: 0 UID: 0 PID: 1 Comm: systemd Not tainted 6.12.77-rc1-7.6.0-devel #1
[    6.426363] Hardware name: Toradex Verdin iMX8M Plus WB on Dahlia Board (DT)
[    6.426368] pstate: 200000c5 (nzCv daIF -PAN -UAO -TCO -DIT -SSBS BTYPE=--)
[    6.426376] pc : place_entity+0x114/0x120
[    6.426387] lr : place_entity+0xf4/0x120
[    6.426395] sp : ffff80008003b9c0
[    6.426399] x29: ffff80008003b9c0 x28: 0000000000000001 x27: 0000000000000000
[    6.426412] x26: ffff67c13fb80180 x25: ffff67c0ce69e600 x24: 0000000000000001
[    6.426424] x23: 0000000000000000 x22: 0000000000000000 x21: 00000000000003ce
[    6.426436] x20: ffff67c13fb80180 x19: ffff67c0ce69e600 x18: 0000000000000001
[    6.426448] x17: 0000000000000000 x16: 0000000000000000 x15: 036d98d79167f52c
[    6.426460] x14: 000000000000000c x13: 0000000000000001 x12: 0000000000200b20
[    6.426472] x11: 0000000000200b20 x10: fffffffffff0251c x9 : 0000000000000000
[    6.426484] x8 : 00000000000003ce x7 : ffff67c13fb80180 x6 : ffff67c0ce69e600
[    6.426496] x5 : 00000000672c7516 x4 : 00000000ffffffe0 x3 : 0000000000000000
[    6.426508] x2 : 00000000000003ce x1 : 0000000000000000 x0 : 000000000021b03a
[    6.426520] Call trace:
[    6.426525]  place_entity+0x114/0x120
[    6.426533]  reweight_entity+0x1d0/0x1f8
[    6.426542]  update_cfs_group+0x8c/0xac
[    6.426550]  enqueue_task_fair+0x27c/0x5d0
[    6.426559]  sched_move_task+0x130/0x1ec
[    6.426567]  cpu_cgroup_attach+0x40/0x80
[    6.426574]  cgroup_migrate_execute+0x368/0x428
[    6.426584]  cgroup_update_dfl_csses+0x230/0x26c
[    6.426594]  cgroup_subtree_control_write+0x3f4/0x454
[    6.426603]  cgroup_file_write+0xa4/0x1b0
[    6.426610]  kernfs_fop_write_iter+0x130/0x1dc
[    6.426621]  vfs_write+0x208/0x374
[    6.426629]  ksys_write+0x74/0x10c
[    6.426636]  __arm64_sys_write+0x1c/0x28
[    6.426643]  invoke_syscall.constprop.0+0x50/0xe4
[    6.426653]  do_el0_svc+0x40/0xc4
[    6.426661]  el0_svc+0x38/0x158
[    6.426669]  el0t_64_sync_handler+0x120/0x12c
[    6.426676]  el0t_64_sync+0x190/0x194
[    6.426684] ---[ end trace 0000000000000000 ]---
#287 lore raw

Re: freeze during boot regression Re: [PATCH 6.12 000/265] 6.12.77-rc1 review

In reply to Ron Economos
Quoted 1 line · Ron Economos

Probably those sched/fair patches.

Yes, after bisecting it turned out to be sched-fair-fix-eevdf-entity-placement-bug-causing-sc.patch

Taking 6.12.77-rc1 and reverting both of the sched-fair patches results in a working kernel that boots consistently (which I am using now to send this email).

Signature · 1 line
-Barry K. Nathan  <[email protected]>
#288 lore raw

Re: freeze during boot regression Re: [PATCH 6.12 000/265] 6.12.77-rc1 review

Quoted 9 lines · Barry K. Nathan
Quoted 1 line · Ron Economos

Probably those sched/fair patches.

Yes, after bisecting it turned out to be sched-fair-fix-eevdf-entity-placement-bug-causing-sc.patch

Taking 6.12.77-rc1 and reverting both of the sched-fair patches results in a working kernel that boots consistently (which I am using now to send this email).

Confirmed on RISC-V. Reverting "sched/fair: Fix lag clamp" commit b547745a2c78fd1cc1fdc6a0d1b05c884c05cec2 and "sched/fair: Fix EEVDF entity placement bug causing scheduling lag" commit f9891a33ba67ce40e5a17023d2f3a5e2b7d72ffd resolves the issue.

#289 lore raw

Re: freeze during boot regression Re: [PATCH 6.12 000/265] 6.12.77-rc1 review

(I forgot to add Francesco Dolcini as a recipient on my previous email, so I'm doing that now.)

Quoted 4 lines · Ron Economos
Quoted 3 lines · Barry K. Nathan
Quoted 1 line · Ron Economos

Probably those sched/fair patches.

Quoted 8 lines
Quoted 6 lines

Yes, after bisecting it turned out to be sched-fair-fix-eevdf-entity-placement-bug-causing-sc.patch

Taking 6.12.77-rc1 and reverting both of the sched-fair patches results in a working kernel that boots consistently (which I am using now to send this email).

Confirmed on RISC-V. Reverting "sched/fair: Fix lag clamp" commit b547745a2c78fd1cc1fdc6a0d1b05c884c05cec2 and "sched/fair: Fix EEVDF entity placement bug causing scheduling lag" commit f9891a33ba67ce40e5a17023d2f3a5e2b7d72ffd resolves the issue.

After looking into it a bit more, I found two upstream commits that should fix this issue without reverting the two sched/fair patches (either of the two commits alone should fix it if I understand the bug and the code correctly):

commit 4423af84b29794a9bd2bd07188d8e71083e54c61 sched/fair: optimize the PLACE_LAG when se->vlag is zero

commit c70fc32f44431bb30f9025ce753ba8be25acbba3
sched/fair: Adhere to place_entity() constraints

I think c70fc32f4443 is theoretically the proper fix, while 4423af84b297 is a performance optimization that just happens to also fix the bug.

4423af84b297 turned out to be the easier backport; the upstream patch applies to 6.12.77-rc1 with an offset but no fuzz or conflicts. So I tried 6.12.77-rc1 + 4423af84b297, and just as with reverting the two sched/fair patches, it eliminates the boot freeze in my testing. It's what I'm running now as I write and send this email.

Next, I think I'll try doing a backport of c70fc32f4443 (I think it should be easy enough), and I'll try testing 6.12.77-rc1 + c70fc32f4443 (probably both with and without 4423af84b297). Maybe 4423af84b297 on its own is enough though.

Signature · 1 line
-Barry K. Nathan  <[email protected]>
#290 lore raw

Re: freeze during boot regression Re: [PATCH 6.12 000/265] 6.12.77-rc1 review

On 3/13/26 03:53, Barry K. Nathan wrote:
[snip]

Quoted 37 lines · Ron Economos
Quoted 12 lines · Barry K. Nathan
Quoted 9 lines · Ron Economos
Quoted 1 line

Probably those sched/fair patches.

Yes, after bisecting it turned out to be sched-fair-fix-eevdf-entity-placement-bug-causing-sc.patch

Taking 6.12.77-rc1 and reverting both of the sched-fair patches results in a working kernel that boots consistently (which I am using now to send this email).

Confirmed on RISC-V. Reverting "sched/fair: Fix lag clamp" commit b547745a2c78fd1cc1fdc6a0d1b05c884c05cec2 and "sched/fair: Fix EEVDF entity placement bug causing scheduling lag" commit f9891a33ba67ce40e5a17023d2f3a5e2b7d72ffd resolves the issue.

After looking into it a bit more, I found two upstream commits that should fix this issue without reverting the two sched/fair patches (either of the two commits alone should fix it if I understand the bug and the code correctly):

commit 4423af84b29794a9bd2bd07188d8e71083e54c61 sched/fair: optimize the PLACE_LAG when se->vlag is zero

commit c70fc32f44431bb30f9025ce753ba8be25acbba3
sched/fair: Adhere to place_entity() constraints

I think c70fc32f4443 is theoretically the proper fix, while 4423af84b297 is a performance optimization that just happens to also fix the bug.

4423af84b297 turned out to be the easier backport; the upstream patch applies to 6.12.77-rc1 with an offset but no fuzz or conflicts. So I tried 6.12.77-rc1 + 4423af84b297, and just as with reverting the two sched/fair patches, it eliminates the boot freeze in my testing. It's what I'm running now as I write and send this email.

Quoted 4 lines

Next, I think I'll try doing a backport of c70fc32f4443 (I think it should be easy enough), and I'll try testing 6.12.77-rc1 + c70fc32f4443 (probably both with and without 4423af84b297). Maybe 4423af84b297 on its own is enough though.

I originally wrote a much longer email, but I'll try to keep this concise.

I was able to backport c70fc32f4443 successfully, and the backport does fix the reboot freezes (with or without 4423af84b297). However, backporting that commit convinced me that it's too risky; I'm particularly worried it could make future sched/fair backports more difficult. And once 4423af84b297 is applied, I think c70fc32f4443 ends up being a fix for a theoretical bug.

So, even though c70fc32f4443 is the commit that was cc'd to stable@, I believe 4423af84b297 is a better (safer, less risky) way to go.

In summary, I believe the two best ways to fix this regression are:
1. Backport 4423af84b297, or
2. Revert the two sched/fair patches.

Signature · 1 line
-Barry K. Nathan  <[email protected]>
author maintainer
#291 lore raw

Re: freeze during boot regression Re: [PATCH 6.12 000/265] 6.12.77-rc1 review

Quoted 53 lines · Barry K. Nathan

On 3/13/26 03:53, Barry K. Nathan wrote:
[snip]

Quoted 37 lines · Ron Economos
Quoted 12 lines · Barry K. Nathan
Quoted 9 lines · Ron Economos
Quoted 1 line

Probably those sched/fair patches.

Yes, after bisecting it turned out to be sched-fair-fix-eevdf-entity-placement-bug-causing-sc.patch

Taking 6.12.77-rc1 and reverting both of the sched-fair patches results in a working kernel that boots consistently (which I am using now to send this email).

Confirmed on RISC-V. Reverting "sched/fair: Fix lag clamp" commit b547745a2c78fd1cc1fdc6a0d1b05c884c05cec2 and "sched/fair: Fix EEVDF entity placement bug causing scheduling lag" commit f9891a33ba67ce40e5a17023d2f3a5e2b7d72ffd resolves the issue.

After looking into it a bit more, I found two upstream commits that should fix this issue without reverting the two sched/fair patches (either of the two commits alone should fix it if I understand the bug and the code correctly):

commit 4423af84b29794a9bd2bd07188d8e71083e54c61 sched/fair: optimize the PLACE_LAG when se->vlag is zero

commit c70fc32f44431bb30f9025ce753ba8be25acbba3
sched/fair: Adhere to place_entity() constraints

I think c70fc32f4443 is theoretically the proper fix, while 4423af84b297 is a performance optimization that just happens to also fix the bug.

4423af84b297 turned out to be the easier backport; the upstream patch applies to 6.12.77-rc1 with an offset but no fuzz or conflicts. So I tried 6.12.77-rc1 + 4423af84b297, and just as with reverting the two sched/fair patches, it eliminates the boot freeze in my testing. It's what I'm running now as I write and send this email.

Quoted 4 lines

Next, I think I'll try doing a backport of c70fc32f4443 (I think it should be easy enough), and I'll try testing 6.12.77-rc1 + c70fc32f4443 (probably both with and without 4423af84b297). Maybe 4423af84b297 on its own is enough though.

I originally wrote a much longer email, but I'll try to keep this concise.

I was able to backport c70fc32f4443 successfully, and the backport does fix the reboot freezes (with or without 4423af84b297). However, backporting that commit convinced me that it's too risky; I'm particularly worried it could make future sched/fair backports more difficult. And once 4423af84b297 is applied, I think c70fc32f4443 ends up being a fix for a theoretical bug.

Quoted 7 lines

So, even though c70fc32f4443 is the commit that was cc'd to stable@, I believe 4423af84b297 is a better (safer, less risky) way to go.

In summary, I believe the two best ways to fix this regression are:
1. Backport 4423af84b297, or
2. Revert the two sched/fair patches.

I'll go drop these for now, and if they should come back in the future, someone can send all of the needed ones at once.

thanks so much for the testing and figuring it all out!

greg k-h

maintainer
#293 lore raw
In reply to Greg Kroah-Hartman
Quoted 9 lines · Greg Kroah-Hartman

This is the start of the stable review cycle for the 6.12.77 release. There are 265 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.

Responses should be made by Fri, 13 Mar 2026 20:09:29 +0000. Anything received after that time might be too late.

The whole patch series can be found in one patch at:

Quoted 8 lines
	https://www.kernel.org/pub/linux/kernel/v6.x/stable-review/patch-6.12.77-rc1.gz

or in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-6.12.y
and the diffstat can be found below.

thanks,

greg k-h

Failures detected for Tegra ...

Test results for stable-v6.12:

    11 builds:	11 pass, 0 fail
    28 boots:	28 pass, 0 fail
    133 tests:	132 pass, 1 fail

Linux version: 6.12.77-rc1-g92f326b98fe0
Boards tested: tegra124-jetson-tk1, tegra186-p2771-0000,

                tegra186-p3509-0000+p3636-0001, tegra194-p2972-0000,
                tegra194-p3509-0000+p3668-0000, tegra20-ventana,
                tegra210-p2371-2180, tegra210-p3450-0000,
                tegra234-p3737-0000+p3701-0000, tegra30-cardhu-a04

Test failures: tegra194-p2972-0000: boot.py

Jon

maintainer
#294 lore raw
Quoted 26 lines · Jon Hunter
Quoted 9 lines · Greg Kroah-Hartman

This is the start of the stable review cycle for the 6.12.77 release. There are 265 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.

Responses should be made by Fri, 13 Mar 2026 20:09:29 +0000. Anything received after that time might be too late.

The whole patch series can be found in one patch at:

Quoted 8 lines
	https://www.kernel.org/pub/linux/kernel/v6.x/stable-review/patch-6.12.77-rc1.gz

or in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-6.12.y
and the diffstat can be found below.

thanks,

greg k-h

Failures detected for Tegra ...

Test results for stable-v6.12:

     11 builds:	11 pass, 0 fail
     28 boots:	28 pass, 0 fail
     133 tests:	132 pass, 1 fail
Quoted 8 lines

Linux version: 6.12.77-rc1-g92f326b98fe0
Boards tested: tegra124-jetson-tk1, tegra186-p2771-0000,

                 tegra186-p3509-0000+p3636-0001, tegra194-p2972-0000,
                 tegra194-p3509-0000+p3668-0000, tegra20-ventana,
                 tegra210-p2371-2180, tegra210-p3450-0000,
                 tegra234-p3737-0000+p3701-0000, tegra30-cardhu-a04

Test failures: tegra194-p2972-0000: boot.py

This is the same issue that has already been reported [0].

Jon

[0] https://lore.kernel.org/lkml/[email protected]/

Signature · 1 line
nvpublic
Tested-by on the v1 series
#295 lore raw
In reply to Greg Kroah-Hartman
Quoted 9 lines · Greg Kroah-Hartman

This is the start of the stable review cycle for the 6.12.77 release. There are 265 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.

Responses should be made by Fri, 13 Mar 2026 20:09:29 +0000. Anything received after that time might be too late.

The whole patch series can be found in one patch at:

Quoted 8 lines
	https://www.kernel.org/pub/linux/kernel/v6.x/stable-review/patch-6.12.77-rc1.gz

or in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-6.12.y
and the diffstat can be found below.

thanks,

greg k-h

On ARCH_BRCMSTB using 32-bit and 64-bit ARM kernels, build tested on BMIPS_GENERIC:

Signature · 1 line
Florian
Tested-by on the v1 series
#296 lore raw
In reply to Greg Kroah-Hartman
Quoted 8 lines · On Thu, 12 Mar 2026 21:06:27 +0100 Greg Kroah-Hartman…

This is the start of the stable review cycle for the 6.12.77 release. There are 265 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.

Responses should be made by Fri, 13 Mar 2026 20:09:29 +0000. Anything received after that time might be too late.

Boot-tested under QEMU for Rust x86_64, arm64 and riscv64; built-tested for loongarch64:

Thanks!

Cheers,
Miguel