[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <e1e51582-7ecb-40af-aae1-498993d0f935@web.de>
Date: Sat, 22 Jun 2024 15:45:15 +0200
From: Markus Elfring <Markus.Elfring@....de>
To: Chen Ridong <chenridong@...wei.com>, cgroups@...r.kernel.org,
bpf@...r.kernel.org, Johannes Weiner <hannes@...xchg.org>,
Tejun Heo <tj@...nel.org>, Waiman Long <longman@...hat.com>,
Zefan Li <lizefan.x@...edance.com>
Cc: LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH -next] cgroup: fix uaf when proc_cpuset_show
> We found a refcount UAF bug as follows:
>
> BUG: KASAN: use-after-free in cgroup_path_ns+0x112/0x150
…
How do you think about to use a summary phrase like “Avoid use-after-free
in proc_cpuset_show()”?
> This is also reported by: https://syzkaller.appspot.com/bug?extid=9b1ff7be974a403aa4cd
Would you like to add any tags (like “Fixes”) accordingly?
…
> +++ b/kernel/cgroup/cpuset.c
…
> @@ -5052,9 +5053,28 @@ int proc_cpuset_show(struct seq_file *m, struct pid_namespace *ns,
> goto out;
>
> css = task_get_css(tsk, cpuset_cgrp_id);
> + rcu_read_lock();
…
> + rcu_read_unlock();
> retval = cgroup_path_ns(css->cgroup, buf, PATH_MAX,
> current->nsproxy->cgroup_ns);
…
Would you become interested to apply a statement like “guard(rcu_read_lock)();”?
https://elixir.bootlin.com/linux/v6.10-rc4/source/include/linux/cleanup.h#L133
Regards,
Markus
Powered by blists - more mailing lists