Bug 23474 - bpf kernel_string(), user_string() tapset
Summary: bpf kernel_string(), user_string() tapset
Status: RESOLVED FIXED
Alias: None
Product: systemtap
Classification: Unclassified
Component: bpf (show other bugs)
Version: unspecified
: P2 normal
Target Milestone: ---
Assignee: Serhei Makarov
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-08-01 18:47 UTC by Serhei Makarov
Modified: 2018-10-24 21:12 UTC (History)
0 users

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Serhei Makarov 2018-08-01 18:47:35 UTC
From the 'language features' brainstorm:

# Loading kernel_string(addr) or user_string(addr) onto the stack

offset = 80
unrolled loop {
   *(u64 *)(r10-offset) = *(u64 *)addr
   addr += 8; offset -= 8
} until '\0' encountered or BPF_MAXSTRINGLEN bytes copied

/* loading kernel_string(addr) or user_string(addr) into an eBPF map is similar */
Comment 1 Serhei Makarov 2018-10-24 21:12:13 UTC
kernel_string() has been implemented using the newly merged experimental eBPF embedded-code assembler. The assembler is a bit raw for a user-facing feature, but should work well for implementing further eBPF tapsets.

There is no bpf_probe_read_user or bpf_probe_read_str user helper for implementing user_string() at the moment. Hence closing the PR as further work would require upstream kernel cooperation in adding the helper.

(Interestingly, there is a bpf_probe_write_user() helper.)