Re: [PATCH bpf-next v3 1/9] bpf: Implement task local storage

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> > +     WARN_ON_ONCE(!rcu_read_lock_held());
> > +     task = pid_task(pid, PIDTYPE_PID);
> > +     if (!task) {
> > +             err = -ENOENT;
> > +             goto out;
> > +     }
> > +
> > +     sdata = bpf_local_storage_update(
> > +             task, (struct bpf_local_storage_map *)map, value, map_flags);
> It seems the task is protected by rcu here and the task may be going away.
> Is it ok?
>
> or the following comment in the later "BPF_CALL_4(bpf_task_storage_get, ...)"
> is no longer valid?
>         /* This helper must only called from where the task is guaranteed
>          * to have a refcount and cannot be freed.
>          */

I reworded this (and the other similar comment) as:

/* This helper must only be called from places where the lifetime of the task
* is guaranteed. Either by being refcounted or by being protected
* by an RCU read-side critical section.
*/



[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux