Re: [PATCH v5] pidfd: add ioctl to retrieve pid info

From: Oleg Nesterov
Date: Sun Oct 06 2024 - 13:38:45 EST


On 10/06, luca.boccassi@xxxxxxxxx wrote:
>
> +#ifdef CONFIG_CGROUPS
> + if (request_mask & PIDFD_INFO_CGROUPID) {

Should we nack other bits in request_mask?

> + struct cgroup *cgrp = task_css_check(task, pids_cgrp_id, 1)->cgroup;

Well, the last "1" argument just fools CONFIG_PROVE_RCU, right?

It seems you need rcu_read_lock() + task_cgroup(pids_cgrp_id)...

Oleg.