Re: [PATCH v6 bpf-next 08/10] bpf: decouple stack_map_get_build_id_offset() from perf_callchain_entry

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

 



On Wed, 2024-08-14 at 11:54 -0700, Andrii Nakryiko wrote:
> Change stack_map_get_build_id_offset() which is used to convert stack
> trace IP addresses into build ID+offset pairs. Right now this function
> accepts an array of u64s as an input, and uses array of
> struct bpf_stack_build_id as an output.
> 
> This is problematic because u64 array is coming from
> perf_callchain_entry, which is (non-sleepable) RCU protected, so once we
> allows sleepable build ID fetching, this all breaks down.
> 
> But its actually pretty easy to make stack_map_get_build_id_offset()
> works with array of struct bpf_stack_build_id as both input and output.
> Which is what this patch is doing, eliminating the dependency on
> perf_callchain_entry. We require caller to fill out
> bpf_stack_build_id.ip fields (all other can be left uninitialized), and
> update in place as we do build ID resolution.
> 
> We make sure to READ_ONCE() and cache locally current IP value as we
> used it in a few places to find matching VMA and so on. Given this data
> is directly accessible and modifiable by user's BPF code, we should make
> sure to have a consistent view of it.
> 
> Signed-off-by: Andrii Nakryiko <andrii@xxxxxxxxxx>
> ---

Acked-by: Eduard Zingerman <eddyz87@xxxxxxxxx>

[...]






[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [NTFS 3]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [NTFS 3]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux