Re: [PATCH 1/2] bpf: Disable preemption in bpf_perf_event_output

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

 



On Wed, Jul 19, 2023 at 7:08 AM Jiri Olsa <olsajiri@xxxxxxxxx> wrote:
>
> now task-1 and task-2 share same bpf_trace_nest_level value and same
> 'struct perf_sample_data' buffer on top of &sds->sds[1]
>
> I did not figure out yet the actual exact scenario/cause of the crash yet,
> I suspect one of the tasks copies data over some boundary, but all the
> ideas I had so far did not match the instructions from the crash
>
> anyway I thought that having 2 tasks sharing the same perf_sample_data
> is bad enough to send the patch

It makes sense now. We forgot to update this part during
transition from preempt_disable to migrate_disable.

But do you have PREEMPT_RCU in your kernel?
If not then the above race shouldn't be possible.
Worth fixing anyway, of course.
Can you repro with a crafted test?
Multiple uprobes doing bpf_perf_event_output should be enough, right?
For kprobes we're "lucky" due to bpf_prog_active.





[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