[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <65df1f7e-9512-4527-bbe4-0cf10877f4ba@gmail.com>
Date: Mon, 14 Jul 2025 16:58:29 -0700
From: JP Kobryn <inwardvessel@...il.com>
To: syzbot <syzbot+8d052e8b99e40bc625ed@...kaller.appspotmail.com>,
cgroups@...r.kernel.org, hannes@...xchg.org, linux-kernel@...r.kernel.org,
mkoutny@...e.com, syzkaller-bugs@...glegroups.com, tj@...nel.org,
Shakeel Butt <shakeel.butt@...ux.dev>
Subject: Re: [syzbot] [cgroups?] WARNING in css_rstat_exit
On 7/14/25 12:29 AM, syzbot wrote:
> syzbot has found a reproducer for the following issue on:
>
> HEAD commit: 5d5d62298b8b Merge tag 'x86_urgent_for_v6.16_rc6' of git:/..
> git tree: upstream
> console output: https://syzkaller.appspot.com/x/log.txt?x=11dabd82580000
> kernel config: https://syzkaller.appspot.com/x/.config?x=84eae426cbd8669c
> dashboard link: https://syzkaller.appspot.com/bug?extid=8d052e8b99e40bc625ed
> compiler: gcc (Debian 12.2.0-14) 12.2.0, GNU ld (GNU Binutils for Debian) 2.40
> syz repro: https://syzkaller.appspot.com/x/repro.syz?x=162c47d4580000
#syz test
diff --git a/kernel/cgroup/cgroup.c b/kernel/cgroup/cgroup.c
index a723b7dc6e4e..e6c5c998ead6 100644
--- a/kernel/cgroup/cgroup.c
+++ b/kernel/cgroup/cgroup.c
@@ -5669,6 +5669,12 @@ static struct cgroup_subsys_state
*css_create(struct cgroup *cgrp,
init_and_link_css(css, ss, cgrp);
+ err = css_rstat_init(css);
+ if (err) {
+ ss->css_free(css);
+ goto err_out;
+ }
+
err = percpu_ref_init(&css->refcnt, css_release, 0, GFP_KERNEL);
if (err)
goto err_free_css;
@@ -5678,10 +5684,6 @@ static struct cgroup_subsys_state
*css_create(struct cgroup *cgrp,
goto err_free_css;
css->id = err;
- err = css_rstat_init(css);
- if (err)
- goto err_free_css;
-
/* @css is ready to be brought online now, make it visible */
list_add_tail_rcu(&css->sibling, &parent_css->children);
cgroup_idr_replace(&ss->css_idr, css, css->id);
@@ -5697,6 +5699,7 @@ static struct cgroup_subsys_state
*css_create(struct cgroup *cgrp,
err_free_css:
INIT_RCU_WORK(&css->destroy_rwork, css_free_rwork_fn);
queue_rcu_work(cgroup_destroy_wq, &css->destroy_rwork);
+err_out:
return ERR_PTR(err);
}
--
Powered by blists - more mailing lists