Re: [PATCH net-next] bpf: add bpf_probe_read_str helper

2017-01-20 Thread David Miller
From: Gianluca Borello Date: Wed, 18 Jan 2017 17:55:49 + > Provide a simple helper with the same semantics of strncpy_from_unsafe(): > > int bpf_probe_read_str(void *dst, int size, const void *unsafe_addr) > > This gives more flexibility to a bpf program. ... > Signed-off-by: Gianluca Bore

[PATCH net-next] bpf: add bpf_probe_read_str helper

2017-01-18 Thread Gianluca Borello
Provide a simple helper with the same semantics of strncpy_from_unsafe(): int bpf_probe_read_str(void *dst, int size, const void *unsafe_addr) This gives more flexibility to a bpf program. A typical use case is intercepting a file name during sys_open(). The current approach is: SEC("kprobe/sys_