Re: WARNING: suspicious RCU usage in task_cls_state

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

 



On Tue, May 27, 2025 at 1:38 AM Feng Yang <yangfeng59949@xxxxxxx> wrote:
>
> syzbot found the following issue on https://lore.kernel.org/all/683428c7.a70a0220.29d4a0.0800.GAE@xxxxxxxxxx/
>
> Related source code:
> BPF_CALL_0(bpf_get_cgroup_classid_curr)
> {
>         return __task_get_classid(current);
> }
>
> const struct bpf_func_proto bpf_get_cgroup_classid_curr_proto = {
>         .func           = bpf_get_cgroup_classid_curr,
>         .gpl_only       = false,
>         .ret_type       = RET_INTEGER,
> };
>
> static inline u32 __task_get_classid(struct task_struct *task)
> {
>         return task_cls_state(task)->classid;
> }
>
> struct cgroup_cls_state *task_cls_state(struct task_struct *p)
> {
>         return css_cls_state(task_css_check(p, net_cls_cgrp_id,
>                                             rcu_read_lock_bh_held()));
> }
>
>
> So, do I need to move bpf_get_cgroup_classid_curr_proto back from bpf_base_func_proto, or is there a better solution?

I'd try to fix that rcu_read_lock_bh_held() check. Can we use
rcu_read_lock_any_held() instead?

>





[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