Re: [PATCH] bpf: Fix backport of "bpf: restrict unknown scalars of mixed signed bounds for unprivileged"

2021-04-19 Thread Yonghong Song
uot;) Signed-off-by: Samuel Mendoza-Jonas Reviewed-by: Frank van der Linden Reviewed-by: Ethan Chen Just to be clear, the patch is for 4.14 stable branch. Acked-by: Yonghong Song

Re: [PATCH v2] tools: do not include scripts/Kbuild.include

2021-04-16 Thread Yonghong Song
M although I see some tools Makefile directly added ".DELETE_ON_ERROR:" in their Makefile. Acked-by: Yonghong Song

Re: [PATCHv2 RFC bpf-next 0/7] bpf: Add support for ftrace probe

2021-04-15 Thread Yonghong Song
On 4/15/21 11:18 AM, Steven Rostedt wrote: On Thu, 15 Apr 2021 19:39:45 +0200 Jiri Olsa wrote: I don't know how the BPF code does it, but if you are tracing the exit of a function, I'm assuming that you hijack the return pointer and replace it with a call to a trampoline that has access to

Re: 5.?? regression: strace testsuite OOpses kernel on ia64

2021-04-10 Thread Yonghong Song
On 4/9/21 2:20 PM, Sergei Trofimovich wrote: On Tue, 23 Feb 2021 18:53:21 + Sergei Trofimovich wrote: The crash seems to be related to sock_filter-v test from strace: https://github.com/strace/strace/blob/master/tests/seccomp-filter-v.c Here is an OOps: [ 818.089904] BUG: Bad pa

Re: [syzbot] WARNING in bpf_test_run

2021-04-01 Thread Yonghong Song
On 4/1/21 3:05 PM, Yonghong Song wrote: On 4/1/21 4:29 AM, syzbot wrote: Hello, syzbot found the following issue on: HEAD commit:    36e79851 libbpf: Preserve empty DATASEC BTFs during static.. git tree:   bpf-next console output: https://syzkaller.appspot.com/x/log.txt?x

Re: [syzbot] WARNING in bpf_test_run

2021-04-01 Thread Yonghong Song
On 4/1/21 4:29 AM, syzbot wrote: Hello, syzbot found the following issue on: HEAD commit:36e79851 libbpf: Preserve empty DATASEC BTFs during static.. git tree: bpf-next console output: https://syzkaller.appspot.com/x/log.txt?x=1569bb06d0 kernel config: https://syzkaller.appspo

Re: [PATCH bpf-next] libbpf: preserve empty DATASEC BTFs during static linking

2021-03-25 Thread Yonghong Song
support") Signed-off-by: Andrii Nakryiko Ack with a nit below. Acked-by: Yonghong Song --- tools/lib/bpf/linker.c | 12 +++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/tools/lib/bpf/linker.c b/tools/lib/bpf/linker.c index 5e0aa2f2c0ca..2c43943da30c 100644 --- a

Re: linux-next: manual merge of the net-next tree with the net tree

2021-03-19 Thread Yonghong Song
On 3/19/21 12:21 AM, Daniel Borkmann wrote: On 3/19/21 3:11 AM, Piotr Krysiuk wrote: Hi Daniel, On Fri, Mar 19, 2021 at 12:16 AM Stephen Rothwell wrote: diff --cc kernel/bpf/verifier.c index 44e4ec1640f1,f9096b049cd6.. --- a/kernel/bpf/verifier.c +++ b/kernel/bpf/verifier.c @@

Re: [PATCH] bpf: selftests: remove unused 'nospace_err' in tests for batched ops in array maps

2021-03-15 Thread Yonghong Song
On 3/15/21 6:29 AM, Pedro Tammela wrote: This seems to be a reminiscent from the hashmap tests. Signed-off-by: Pedro Tammela Acked-by: Yonghong Song

Re: [BUG] hitting bug when running spinlock test

2021-03-09 Thread Yonghong Song
On 3/9/21 10:21 AM, Roman Gushchin wrote: On Mon, Mar 08, 2021 at 09:44:08PM -0800, Yonghong Song wrote: On 3/5/21 1:10 PM, Yonghong Song wrote: On 3/5/21 12:38 PM, Roman Gushchin wrote: On Thu, Mar 04, 2021 at 08:03:33PM +0100, Jiri Olsa wrote: hi, I'm getting attached BUG/crash

Re: [BUG] hitting bug when running spinlock test

2021-03-08 Thread Yonghong Song
On 3/5/21 1:10 PM, Yonghong Song wrote: On 3/5/21 12:38 PM, Roman Gushchin wrote: On Thu, Mar 04, 2021 at 08:03:33PM +0100, Jiri Olsa wrote: hi, I'm getting attached BUG/crash when running in parralel selftests, like:    while :; do ./test_progs -t spinlock; done    while

Re: [PATCH bpf-next] selftests/bpf: fix compiler warning in BPF_KPROBE definition in loop6.c

2021-03-08 Thread Yonghong Song
ed, struct scatterlist **sgs, ^ 1 warning generated. Fixes: 86a35af628e5 ("selftests/bpf: Add a verifier scale test with unknown bounded loop") Signed-off-by: Andrii Nakryiko Oh, my bad. Thanks for fixing it! Acked-by: Yonghong Song

Re: [BUG] hitting bug when running spinlock test

2021-03-05 Thread Yonghong Song
On 3/5/21 12:38 PM, Roman Gushchin wrote: On Thu, Mar 04, 2021 at 08:03:33PM +0100, Jiri Olsa wrote: hi, I'm getting attached BUG/crash when running in parralel selftests, like: while :; do ./test_progs -t spinlock; done while :; do ./test_progs ; done it's the latest bpf-next/master,

Re: [BUG] hitting bug when running spinlock test

2021-03-04 Thread Yonghong Song
On 3/4/21 11:03 AM, Jiri Olsa wrote: hi, I'm getting attached BUG/crash when running in parralel selftests, like: while :; do ./test_progs -t spinlock; done while :; do ./test_progs ; done it's the latest bpf-next/master, I can send the .config if needed, but I don't think there's anyt

Re: [Patch bpf-next v2 8/9] sock_map: update sock type checks for UDP

2021-03-03 Thread Yonghong Song
On 3/3/21 10:02 AM, Cong Wang wrote: On Tue, Mar 2, 2021 at 10:37 PM Yonghong Song wrote: On 3/1/21 6:37 PM, Cong Wang wrote: From: Cong Wang Now UDP supports sockmap and redirection, we can safely update the sock type checks for it accordingly. Cc: John Fastabend Cc: Daniel

Re: [PATCH] selftests/bpf: Simplify the calculation of variables

2021-03-03 Thread Yonghong Song
On 3/2/21 11:52 PM, Jiapeng Chong wrote: Fix the following coccicheck warnings: ./tools/testing/selftests/bpf/test_sockmap.c:735:35-37: WARNING !A || A && B is equivalent to !A || B. Reported-by: Abaci Robot Signed-off-by: Jiapeng Chong Acked-by: Yonghong Song

Re: [PATCH] bpf: Simplify the calculation of variables

2021-03-03 Thread Yonghong Song
On 3/2/21 11:20 PM, Jiapeng Chong wrote: Fix the following coccicheck warnings: ./tools/bpf/bpf_dbg.c:1201:55-57: WARNING !A || A && B is equivalent to !A || B. Reported-by: Abaci Robot Signed-off-by: Jiapeng Chong Acked-by: Yonghong Song

Re: [Patch bpf-next v2 8/9] sock_map: update sock type checks for UDP

2021-03-03 Thread Yonghong Song
On 3/1/21 6:37 PM, Cong Wang wrote: From: Cong Wang Now UDP supports sockmap and redirection, we can safely update the sock type checks for it accordingly. Cc: John Fastabend Cc: Daniel Borkmann Cc: Jakub Sitnicki Cc: Lorenz Bauer Signed-off-by: Cong Wang --- net/core/sock_map.c | 5

Re: [Patch bpf-next v2 4/9] udp: implement ->read_sock() for sockmap

2021-03-03 Thread Yonghong Song
On 3/1/21 6:37 PM, Cong Wang wrote: From: Cong Wang Some even simple commit message here will be preferred compared to empty commit message. Cc: John Fastabend Cc: Daniel Borkmann Cc: Jakub Sitnicki Cc: Lorenz Bauer Signed-off-by: Cong Wang --- include/net/udp.h | 2 ++ net/ipv

Re: [PATCH bpf-next] tools/runqslower: allow substituting custom vmlinux.h for the build

2021-03-02 Thread Yonghong Song
allow to provide pre-generated vmlinux.h for runqslower build. Cc: Martin Lau Signed-off-by: Andrii Nakryiko Acked-by: Yonghong Song

Re: [PATCH bpf-next] selftests/bpf: Fix test_attach_probe for powerpc uprobes

2021-03-02 Thread Yonghong Song
On 3/2/21 3:14 AM, Jiri Olsa wrote: On Mon, Mar 01, 2021 at 04:34:24PM -0800, Andrii Nakryiko wrote: On Mon, Mar 1, 2021 at 11:11 AM Jiri Olsa wrote: When testing uprobes we the test gets GEP (Global Entry Point) address from kallsyms, but then the function is called locally so the uprobe

Re: [PATCH bpf-next] selftests/bpf: Fix test_attach_probe for powerpc uprobes

2021-03-02 Thread Yonghong Song
On 3/1/21 11:04 AM, Jiri Olsa wrote: When testing uprobes we the test gets GEP (Global Entry Point) address from kallsyms, but then the function is called locally so the uprobe is not triggered. Fixing this by adjusting the address to LEP (Local Entry Point) for powerpc arch. Signed-off-by:

Re: [PATCH v5 bpf-next 1/6] bpf: enable task local storage for tracing programs

2021-02-23 Thread Yonghong Song
On 2/23/21 2:28 PM, Song Liu wrote: To access per-task data, BPF programs usually creates a hash table with pid as the key. This is not ideal because: 1. The user need to estimate the proper size of the hash table, which may be inaccurate; 2. Big hash tables are slow; 3. To clean up

Re: [PATCH v5 bpf-next 1/4] bpf: introduce task_vma bpf_iter

2021-02-10 Thread Yonghong Song
On 2/9/21 7:00 PM, Alexei Starovoitov wrote: On 2/9/21 2:08 PM, Song Liu wrote: On Feb 9, 2021, at 1:30 PM, Alexei Starovoitov wrote: On Mon, Feb 08, 2021 at 02:52:52PM -0800, Song Liu wrote: Introduce task_vma bpf_iter to print memory information of a process. It can be used to print

Re: KMSAN: uninit-value in bpf_iter_prog_supported

2021-02-09 Thread Yonghong Song
On 2/8/21 11:35 PM, Dmitry Vyukov wrote: On Sun, Feb 7, 2021 at 1:20 PM syzbot wrote: Hello, syzbot found the following issue on: HEAD commit:73d62e81 kmsan: random: prevent boot-time reports in _mix_.. git tree: https://github.com/google/kmsan.git master console output: https:/

Re: [PATCH v5 bpf-next 4/4] selftests/bpf: add test for bpf_iter_task_vma

2021-02-08 Thread Yonghong Song
On 2/8/21 2:52 PM, Song Liu wrote: The test dumps information similar to /proc/pid/maps. The first line of the output is compared against the /proc file to make sure they match. Signed-off-by: Song Liu Acked-by: Yonghong Song

Re: [PATCH v5 bpf-next 1/4] bpf: introduce task_vma bpf_iter

2021-02-08 Thread Yonghong Song
ilar to the one used in show_smaps_rollup(). Signed-off-by: Song Liu Acked-by: Yonghong Song

Re: [PATCH v4 bpf-next 4/4] selftests/bpf: add test for bpf_iter_task_vma

2021-02-07 Thread Yonghong Song
On 2/4/21 12:50 PM, Song Liu wrote: The test dumps information similar to /proc/pid/maps. The first line of the output is compared against the /proc file to make sure they match. Signed-off-by: Song Liu --- .../selftests/bpf/prog_tests/bpf_iter.c | 114 -- tools/test

Re: [PATCH v4 bpf-next 1/4] bpf: introduce task_vma bpf_iter

2021-02-07 Thread Yonghong Song
On 2/4/21 12:49 PM, Song Liu wrote: Introduce task_vma bpf_iter to print memory information of a process. It can be used to print customized information similar to /proc//maps. Current /proc//maps and /proc//smaps provide information of vma's of a process. However, these information are not f

Re: [Patch bpf-next v5 1/3] bpf: introduce timeout hash map

2021-01-28 Thread Yonghong Song
On 1/28/21 9:57 PM, Cong Wang wrote: On Thu, Jan 28, 2021 at 6:54 PM Alexei Starovoitov wrote: I meant it would look like: noinline per_elem_callback(map, key, value, ...) { if (value->foo > ...) bpf_delete_map_elem(map, key); } noinline timer_callback(timer, ctx) { map = ctx->

Re: [PATCH bpf-next v2] samples/bpf: Set flag __SANE_USERSPACE_TYPES__ for MIPS to fix build warnings

2021-01-25 Thread Yonghong Song
:293: bpfdep] Error 1 make[2]: *** [Makefile:156: all] Error 2 With #ifndef __SANE_USERSPACE_TYPES__ in tools/include/linux/types.h, the above error has gone and this ifndef change does not hurt other compilations. Signed-off-by: Tiezhu Yang Acked-by: Yonghong Song

Re: KASAN: vmalloc-out-of-bounds Read in bpf_trace_run7

2021-01-23 Thread Yonghong Song
issue to: commit 8b401f9ed2441ad9e219953927a842d24ed051fc Author: Yonghong Song Date: Thu May 23 21:47:45 2019 + bpf: implement bpf_send_signal() helper bisection log: https://syzkaller.appspot.com/x/bisect.txt?x=123408e750 start commit: 7d68e382 bpf: Permit size-0 datasec git

Re: [PATCH bpf-next v3] samples/bpf: Update build procedure for manually compiling LLVM and Clang

2021-01-21 Thread Yonghong Song
itionally, as Fangrui said, the dir llvm-project/llvm/build/install is not used, BUILD_SHARED_LIBS=OFF is the default option [2], so also change Documentation/bpf/bpf_devel_QA.rst together. [1] https://clang.llvm.org/get_started.html [2] https://www.llvm.org/docs/CMake.html Signed-off-by: Tiezhu Y

Re: [PATCH bpf-next v2] samples/bpf: Update README.rst and Makefile for manually compiling LLVM and clang

2021-01-19 Thread Yonghong Song
ep consistent. I verified the procedure and it is proved to be feasible, so we should update README.rst to reflect the reality. At the same time, update the related comment in Makefile. [1] https://clang.llvm.org/get_started.html Signed-off-by: Tiezhu Yang Acked-by: Yonghong Song --- v2

Re: [PATCH v3 bpf-next 2/2] selftests: bpf: Add a new test for bare tracepoints

2021-01-19 Thread Yonghong Song
On 1/19/21 4:22 AM, Qais Yousef wrote: Reuse module_attach infrastructure to add a new bare tracepoint to check we can attach to it as a raw tracepoint. Signed-off-by: Qais Yousef Acked-by: Yonghong Song

Re: [PATCH bpf] samples/bpf: Update README.rst and Makefile for manually compiling LLVM and clang

2021-01-18 Thread Yonghong Song
ate the related comment in Makefile. [1] https://clang.llvm.org/get_started.html Signed-off-by: Tiezhu Yang Ack with minor nits in the above. Also, this is a documentation update. I think it is okay to target the patch to bpf-next instead of bpf. Acked-by: Yonghong Song

Re: [PATCH bpf 1/2] samples/bpf: Set flag __SANE_USERSPACE_TYPES__ for MIPS to fix build warnings

2021-01-18 Thread Yonghong Song
On 1/17/21 7:22 PM, Tiezhu Yang wrote: On 01/14/2021 01:12 AM, Yonghong Song wrote: On 1/13/21 2:57 AM, Tiezhu Yang wrote: MIPS needs __SANE_USERSPACE_TYPES__ before to select 'int-ll64.h' in arch/mips/include/uapi/asm/types.h and avoid compile warnings when printing __u64

Re: [PATCH bpf] samples/bpf: Update README.rst for manually compiling LLVM and clang

2021-01-18 Thread Yonghong Song
On 1/18/21 12:53 AM, Tiezhu Yang wrote: In the current samples/bpf/README.rst, the url of llvm and clang git may be out of date, they are unable to access: $ git clone http://llvm.org/git/llvm.git Cloning into 'llvm'... fatal: unable to access 'http://llvm.org/git/llvm.git/ ': Maximum (20) r

Re: [PATCH v2 bpf-next 2/2] selftests: bpf: Add a new test for bare tracepoints

2021-01-18 Thread Yonghong Song
On 1/18/21 4:18 AM, Qais Yousef wrote: On 01/16/21 18:11, Yonghong Song wrote: On 1/16/21 10:21 AM, Qais Yousef wrote: Reuse module_attach infrastructure to add a new bare tracepoint to check we can attach to it as a raw tracepoint. Signed-off-by: Qais Yousef --- .../bpf/bpf_testmod

Re: [PATCH v2 bpf-next 2/2] selftests: bpf: Add a new test for bare tracepoints

2021-01-16 Thread Yonghong Song
On 1/16/21 10:21 AM, Qais Yousef wrote: Reuse module_attach infrastructure to add a new bare tracepoint to check we can attach to it as a raw tracepoint. Signed-off-by: Qais Yousef --- .../bpf/bpf_testmod/bpf_testmod-events.h | 6 + .../selftests/bpf/bpf_testmod/bpf_testmod.c

Re: [PATCH v2 bpf-next 1/2] trace: bpf: Allow bpf to attach to bare tracepoints

2021-01-16 Thread Yonghong Song
ithout worrying about any ABI. Update Documentation/bpf/bpf_design_QA.rst to document this contract. Signed-off-by: Qais Yousef Acked-by: Yonghong Song

Re: [PATCH bpf-next 1/4] bpf: enable task local storage for tracing programs

2021-01-15 Thread Yonghong Song
On 1/15/21 5:12 PM, Song Liu wrote: On Jan 15, 2021, at 4:55 PM, Yonghong Song wrote: On 1/15/21 3:34 PM, Song Liu wrote: On Jan 12, 2021, at 8:53 AM, KP Singh wrote: On Tue, Jan 12, 2021 at 5:32 PM Yonghong Song wrote: On 1/11/21 3:45 PM, Song Liu wrote: On Jan 11, 2021

Re: [PATCH bpf-next 1/4] bpf: enable task local storage for tracing programs

2021-01-15 Thread Yonghong Song
On 1/15/21 3:34 PM, Song Liu wrote: On Jan 12, 2021, at 8:53 AM, KP Singh wrote: On Tue, Jan 12, 2021 at 5:32 PM Yonghong Song wrote: On 1/11/21 3:45 PM, Song Liu wrote: On Jan 11, 2021, at 1:58 PM, Martin Lau wrote: On Mon, Jan 11, 2021 at 10:35:43PM +0100, KP Singh wrote

Re: [RPC PATCH bpf-next] bpf: implement new BPF_CGROUP_INET_SOCK_POST_CONNECT

2021-01-15 Thread Yonghong Song
On 1/15/21 8:39 AM, Stanislav Fomichev wrote: On Thu, Jan 14, 2021 at 8:27 PM Yonghong Song wrote: On 1/14/21 7:59 PM, Alexei Starovoitov wrote: On Thu, Jan 14, 2021 at 7:51 PM Stanislav Fomichev wrote: lock_sock(sock->sk); err = __inet_stream_connect(sock, ua

Re: [PATCHv7 bpf-next] samples/bpf: add xdp program on egress for xdp_redirect_map

2021-01-15 Thread Yonghong Song
Acked-by: Yonghong Song

Re: [RPC PATCH bpf-next] bpf: implement new BPF_CGROUP_INET_SOCK_POST_CONNECT

2021-01-14 Thread Yonghong Song
On 1/14/21 7:59 PM, Alexei Starovoitov wrote: On Thu, Jan 14, 2021 at 7:51 PM Stanislav Fomichev wrote: lock_sock(sock->sk); err = __inet_stream_connect(sock, uaddr, addr_len, flags, 0); Similarly here, attaching fexit to __inet_stream_connect would execute your BPF prog

Re: [PATCHv6 bpf-next] samples/bpf: add xdp program on egress for xdp_redirect_map

2021-01-14 Thread Yonghong Song
On 1/14/21 6:27 AM, Hangbin Liu wrote: This patch add a xdp program on egress to show that we can modify the packet on egress. In this sample we will set the pkt's src mac to egress's mac address. The xdp_prog will be attached when -X option supplied. Signed-off-by: Hangbin Liu --- v6: no c

Re: [PATCH bpf-next V11 4/7] bpf: add BPF-helper for MTU checking

2021-01-14 Thread Yonghong Song
On 1/14/21 6:52 AM, Jesper Dangaard Brouer wrote: On Tue, 12 Jan 2021 11:23:33 -0800 Andrii Nakryiko wrote: On Tue, Jan 12, 2021 at 9:49 AM Jesper Dangaard Brouer wrote: This BPF-helper bpf_check_mtu() works for both XDP and TC-BPF programs. The SKB object is complex and the skb->len va

Re: [PATCH 2/2] tools/bpftool: Add -Wall when building BPF programs

2021-01-13 Thread Yonghong Song
On 1/13/21 2:36 PM, Ian Rogers wrote: No additional warnings are generated by enabling this, but having it enabled will help avoid regressions. Signed-off-by: Ian Rogers Acked-by: Yonghong Song

Re: [PATCH 1/2] bpf, libbpf: Avoid unused function warning on bpf_tail_call_static

2021-01-13 Thread Yonghong Song
On 1/13/21 2:36 PM, Ian Rogers wrote: Add inline to __always_inline making it match the linux/compiler.h. Adding this avoids an unused function warning on bpf_tail_call_static when compining with -Wall. Signed-off-by: Ian Rogers Acked-by: Yonghong Song

Re: [PATCH bpf-next] bpf: reject too big ctx_size_in for raw_tp test run

2021-01-13 Thread Yonghong Song
On 1/13/21 1:48 PM, Song Liu wrote: On Jan 12, 2021, at 9:17 PM, Yonghong Song wrote: On 1/12/21 3:42 PM, Song Liu wrote: syzbot reported a WARNING for allocating too big memory: WARNING: CPU: 1 PID: 8484 at mm/page_alloc.c:4976 __alloc_pages_nodemask+0x5f8/0x730 mm/page_alloc.c:5011

Re: [PATCH 0/2] Fix build errors and warnings when make M=samples/bpf

2021-01-13 Thread Yonghong Song
On 1/13/21 2:57 AM, Tiezhu Yang wrote: There exists many build errors and warnings when make M=samples/bpf, both fixes in this patch related to mips, please do mention in the commit message that this is mips related. x86 (and arm64 I assume) compiles just fine. this patch series fix some

Re: [PATCH 2/2] compiler.h: Include asm/rwonce.h under ARM64 and ALPHA to fix build errors

2021-01-13 Thread Yonghong Song
On 1/13/21 2:57 AM, Tiezhu Yang wrote: When make M=samples/bpf on the Loongson 3A3000 platform which belongs to MIPS arch, there exists many similar build errors about 'asm/rwonce.h' file not found, so include it only under CONFIG_ARM64 and CONFIG_ALPHA due to it exists only in arm64 and alpha

Re: [PATCH bpf 1/2] samples/bpf: Set flag __SANE_USERSPACE_TYPES__ for MIPS to fix build warnings

2021-01-13 Thread Yonghong Song
On 1/13/21 2:57 AM, Tiezhu Yang wrote: MIPS needs __SANE_USERSPACE_TYPES__ before to select 'int-ll64.h' in arch/mips/include/uapi/asm/types.h and avoid compile warnings when printing __u64 with %llu, %llx or %lld. could you mention which command produces the following warning? prin

Re: [PATCH bpf-next 1/2] trace: bpf: Allow bpf to attach to bare tracepoints

2021-01-13 Thread Yonghong Song
On 1/13/21 2:16 AM, Qais Yousef wrote: On 01/12/21 12:19, Yonghong Song wrote: I applied the patch to my local bpf-next repo, and got the following compilation error: [...] I dumped preprecessor result but after macro expansion, the code becomes really complex and I have not figured out

Re: [PATCH bpf v2 2/2] selftests/bpf: add verifier test for PTR_TO_MEM spill

2021-01-13 Thread Yonghong Song
area pointed by it. The patch was partially contributed by CyberArk Software, Inc. Signed-off-by: Gilad Reti I didn't verify result_unpriv = ACCEPT part. I think it is correct by checking code. Acked-by: Yonghong Song

Re: [PATCH bpf-next] bpf: reject too big ctx_size_in for raw_tp test run

2021-01-12 Thread Yonghong Song
ported-by: syzbot+4f98876664c7337a4...@syzkaller.appspotmail.com Fixes: 1b4d60ec162f ("bpf: Enable BPF_PROG_TEST_RUN for raw_tracepoint") Cc: sta...@vger.kernel.org # v5.10+ Signed-off-by: Song Liu Maybe this should target to bpf tree? Acked-by: Yonghong Song

Re: [PATCH bpf-next 1/2] trace: bpf: Allow bpf to attach to bare tracepoints

2021-01-12 Thread Yonghong Song
On 1/11/21 10:20 AM, Qais Yousef wrote: Some subsystems only have bare tracepoints (a tracepoint with no associated trace event) to avoid the problem of trace events being an ABI that can't be changed. From bpf presepective, bare tracepoints are what it calls RAW_TRACEPOINT(). Since bpf ass

Re: [PATCH v3 bpf-next 1/4] bpf: introduce task_vma bpf_iter

2021-01-12 Thread Yonghong Song
On 1/6/21 8:17 PM, Song Liu wrote: Introduce task_vma bpf_iter to print memory information of a process. It can be used to print customized information similar to /proc//maps. Current /proc//maps and /proc//smaps provide information of vma's of a process. However, these information are not fl

Re: [PATCH 2/2] selftests/bpf: add verifier test for PTR_TO_MEM spill

2021-01-12 Thread Yonghong Song
On 1/12/21 7:43 AM, Daniel Borkmann wrote: On 1/12/21 4:35 PM, Gilad Reti wrote: On Tue, Jan 12, 2021 at 4:56 PM KP Singh wrote: On Tue, Jan 12, 2021 at 10:16 AM Gilad Reti wrote: Add test to check that the verifier is able to recognize spilling of PTR_TO_MEM registers. It would be nic

Re: [PATCH bpf-next 1/4] bpf: enable task local storage for tracing programs

2021-01-12 Thread Yonghong Song
On 1/11/21 3:45 PM, Song Liu wrote: On Jan 11, 2021, at 1:58 PM, Martin Lau wrote: On Mon, Jan 11, 2021 at 10:35:43PM +0100, KP Singh wrote: On Mon, Jan 11, 2021 at 7:57 PM Martin KaFai Lau wrote: On Fri, Jan 08, 2021 at 03:19:47PM -0800, Song Liu wrote: [ ... ] diff --git a/kernel

Re: [PATCH bpf-next 4/4] bpf: runqslower: use task local storage

2021-01-11 Thread Yonghong Song
On 1/11/21 11:14 PM, Andrii Nakryiko wrote: On Mon, Jan 11, 2021 at 7:24 PM Yonghong Song wrote: On 1/11/21 2:54 PM, Song Liu wrote: On Jan 11, 2021, at 9:49 AM, Yonghong Song wrote: On 1/8/21 3:19 PM, Song Liu wrote: Replace hashtab with task local storage in runqslower. This

Re: [PATCH bpf-next 4/4] bpf: runqslower: use task local storage

2021-01-11 Thread Yonghong Song
On 1/11/21 2:54 PM, Song Liu wrote: On Jan 11, 2021, at 9:49 AM, Yonghong Song wrote: On 1/8/21 3:19 PM, Song Liu wrote: Replace hashtab with task local storage in runqslower. This improves the performance of these BPF programs. The following table summarizes average runtime of these

Re: [PATCH v2 bpf-next 6/7] libbpf: support kernel module ksym externs

2021-01-11 Thread Yonghong Song
On 1/11/21 1:37 PM, Andrii Nakryiko wrote: On Sun, Jan 10, 2021 at 8:15 PM Yonghong Song wrote: On 1/8/21 2:09 PM, Andrii Nakryiko wrote: Add support for searching for ksym externs not just in vmlinux BTF, but across all module BTFs, similarly to how it's done for CO-RE reloca

Re: [PATCH v2 bpf-next 5/7] bpf: support BPF ksym variables in kernel modules

2021-01-11 Thread Yonghong Song
On 1/11/21 1:29 PM, Andrii Nakryiko wrote: On Sun, Jan 10, 2021 at 8:13 PM Yonghong Song wrote: On 1/8/21 2:09 PM, Andrii Nakryiko wrote: Add support for directly accessing kernel module variables from BPF programs using special ldimm64 instructions. This functionality builds upon

Re: [PATCH bpf 2/2] libbpf: allow loading empty BTFs

2021-01-11 Thread Yonghong Song
On 1/11/21 12:51 PM, Andrii Nakryiko wrote: On Mon, Jan 11, 2021 at 10:13 AM Yonghong Song wrote: On 1/9/21 11:03 PM, Andrii Nakryiko wrote: Empty BTFs do come up (e.g., simple kernel modules with no new types and strings, compared to the vmlinux BTF) and there is nothing technically

Re: [PATCH bpf-next 2/2] bpf: extend bind v4/v6 selftests for mark/prio/bindtoifindex

2021-01-11 Thread Yonghong Song
On 1/11/21 8:17 AM, Daniel Borkmann wrote: Extend existing cgroup bind4/bind6 tests to add coverage for setting and retrieving SO_MARK, SO_PRIORITY and SO_BINDTOIFINDEX at the bind hook. Signed-off-by: Daniel Borkmann Ack with a minor comments below. Acked-by: Yonghong Song

Re: [PATCH bpf-next 1/2] bpf: allow to retrieve sol_socket opts from sock_addr progs

2021-01-11 Thread Yonghong Song
: Yonghong Song

Re: [PATCH bpf 2/2] libbpf: allow loading empty BTFs

2021-01-11 Thread Yonghong Song
On 1/9/21 11:03 PM, Andrii Nakryiko wrote: Empty BTFs do come up (e.g., simple kernel modules with no new types and strings, compared to the vmlinux BTF) and there is nothing technically wrong with them. So remove unnecessary check preventing loading empty BTFs. Reported-by: Christopher Willi

Re: [PATCH bpf 1/2] bpf: allow empty module BTFs

2021-01-11 Thread Yonghong Song
owing module BTFs with no types or strings. Reported-by: Christopher William Snowhill Fixes: 36e68442d1af ("bpf: Load and verify kernel module BTFs") Signed-off-by: Andrii Nakryiko Acked-by: Yonghong Song

Re: [PATCH bpf-next 4/4] bpf: runqslower: use task local storage

2021-01-11 Thread Yonghong Song
On 1/8/21 3:19 PM, Song Liu wrote: Replace hashtab with task local storage in runqslower. This improves the performance of these BPF programs. The following table summarizes average runtime of these programs, in nanoseconds: task-local hash-prealloc hash-no-prea

Re: [PATCH bpf-next 3/4] bpf: runqslower: prefer use local vmlinux

2021-01-11 Thread Yonghong Song
On 1/8/21 3:19 PM, Song Liu wrote: Update the Makefile to prefer using ../../../vmlinux, which has latest definitions for vmlinux.h Signed-off-by: Song Liu --- tools/bpf/runqslower/Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/bpf/runqslower/Makefile

Re: [PATCH bpf-next 2/4] selftests/bpf: add non-BPF_LSM test for task local storage

2021-01-11 Thread Yonghong Song
On 1/8/21 3:19 PM, Song Liu wrote: Task local storage is enabled for tracing programs. Add a test for it without CONFIG_BPF_LSM. Signed-off-by: Song Liu --- .../bpf/prog_tests/test_task_local_storage.c | 34 + .../selftests/bpf/progs/task_local_storage.c | 37 +++

Re: [PATCH bpf-next 1/4] bpf: enable task local storage for tracing programs

2021-01-11 Thread Yonghong Song
On 1/8/21 3:19 PM, Song Liu wrote: To access per-task data, BPF program typically creates a hash table with pid as the key. This is not ideal because: 1. The use need to estimate requires size of the hash table, with may be inaccurate; 2. Big hash tables are slow; 3. To clean up the

Re: [PATCH bpf-next 1/4] bpf: enable task local storage for tracing programs

2021-01-11 Thread Yonghong Song
On 1/11/21 2:17 AM, KP Singh wrote: On Mon, Jan 11, 2021 at 7:27 AM Yonghong Song wrote: On 1/8/21 3:19 PM, Song Liu wrote: To access per-task data, BPF program typically creates a hash table with pid as the key. This is not ideal because: 1. The use need to estimate requires size of

Re: [QUESTION] build errors and warnings when make M=samples/bpf

2021-01-11 Thread Yonghong Song
On 1/11/21 12:17 AM, Tiezhu Yang wrote: Hi all, I found the following build errors and warnings when make M=samples/bpf on the Loongson 3A3000 platform which belongs to MIPS arch. Are theseknown issues? Should I submit patches to fix them? (1) fatal error: 'asm/rwonce.h' file not found Th

Re: [PATCH bpf-next 1/4] bpf: enable task local storage for tracing programs

2021-01-10 Thread Yonghong Song
On 1/8/21 3:19 PM, Song Liu wrote: To access per-task data, BPF program typically creates a hash table with pid as the key. This is not ideal because: 1. The use need to estimate requires size of the hash table, with may be inaccurate; 2. Big hash tables are slow; 3. To clean up the

Re: [PATCH v2 bpf-next 7/7] selftests/bpf: test kernel module ksym externs

2021-01-10 Thread Yonghong Song
On 1/8/21 2:09 PM, Andrii Nakryiko wrote: Add per-CPU variable to bpf_testmod.ko and use those from new selftest to validate it works end-to-end. Signed-off-by: Andrii Nakryiko Ack with a nit below. Acked-by: Yonghong Song --- .../selftests/bpf/bpf_testmod/bpf_testmod.c | 3

Re: [PATCH v2 bpf-next 6/7] libbpf: support kernel module ksym externs

2021-01-10 Thread Yonghong Song
On 1/8/21 2:09 PM, Andrii Nakryiko wrote: Add support for searching for ksym externs not just in vmlinux BTF, but across all module BTFs, similarly to how it's done for CO-RE relocations. Kernels that expose module BTFs through sysfs are assumed to support new ldimm64 instruction extension wit

Re: [PATCH v2 bpf-next 5/7] bpf: support BPF ksym variables in kernel modules

2021-01-10 Thread Yonghong Song
rch for DATASEC record needs to look at only module's added BTF types. This is implemented with custom search function. Signed-off-by: Andrii Nakryiko Ack with a minor nit below. Acked-by: Yonghong Song --- include/linux/bpf.h | 10 +++ include/linux/bpf_verifier.h | 3 +

Re: [PATCH v2 bpf-next 4/7] selftests/bpf: sync RCU before unloading bpf_testmod

2021-01-10 Thread Yonghong Song
nload bpf_testmod. Fixes: 9f7fa225894c ("selftests/bpf: Add bpf_testmod kernel module for testing") Suggested-by: Alexei Starovoitov Signed-off-by: Andrii Nakryiko Acked-by: Yonghong Song

Re: [PATCH v2 bpf-next 3/7] bpf: declare __bpf_free_used_maps() unconditionally

2021-01-10 Thread Yonghong Song
t;bpf: Fix missing prog untrack in release_maps") Signed-off-by: Andrii Nakryiko Acked-by: Yonghong Song

Re: [PATCH v2 bpf-next 1/7] bpf: add bpf_patch_call_args prototype to include/linux/bpf.h

2021-01-10 Thread Yonghong Song
Fixes: 1ea47e01ad6e ("bpf: add support for bpf_call to interpreter") Signed-off-by: Andrii Nakryiko Acked-by: Yonghong Song

Re: [PATCH v2 bpf-next 2/7] bpf: avoid warning when re-casting __bpf_call_base into __bpf_call_base_args

2021-01-10 Thread Yonghong Song
: add support for bpf_call to interpreter") Signed-off-by: Andrii Nakryiko Acked-by: Yonghong Song

Re: [PATCH bpf-next] libbpf: clarify kernel type use with USER variants of CORE reading macros

2021-01-10 Thread Yonghong Song
x27;t work with CO-RE). Signed-off-by: Andrii Nakryiko Acked-by: Yonghong Song

Re: [PATCH v2] btf: support ints larger than 128 bits

2020-12-30 Thread Yonghong Song
_ExtInt extension enabled in clang, which is under review. Link: https://clang.llvm.org/docs/LanguageExtensions.html#extended-integer-types Link: https://reviews.llvm.org/D93103 Signed-off-by: Sean Young --- changes since v2: - added tests as suggested by Yonghong Song - added kernel pretty-printer

Re: [PATCH] bpf: fix: address of local auto-variable assigned to a function parameter.

2020-12-23 Thread Yonghong Song
On 12/23/20 11:01 PM, YANG LI wrote: Assigning local variable txq to the outputting parameter xdp->txq is not safe, txq will be released after the end of the function call. Then the result of using xdp is unpredictable. Fix this error by defining the struct xdp_txq_info in function dev_map_ru

Re: [PATCH 1/1 v3 bpf-next] bpf: increment and use correct thread iterator

2020-12-18 Thread Yonghong Song
On 12/18/20 10:06 AM, Jonathan Lemon wrote: On Fri, Dec 18, 2020 at 08:53:22AM -0800, Yonghong Song wrote: On 12/11/20 9:11 AM, Jonathan Lemon wrote: From: Jonathan Lemon On some systems, some variant of the following splat is repeatedly seen. The common factor in all traces seems to

Re: [PATCH 1/1 v3 bpf-next] bpf: increment and use correct thread iterator

2020-12-18 Thread Yonghong Song
On 12/11/20 9:11 AM, Jonathan Lemon wrote: From: Jonathan Lemon On some systems, some variant of the following splat is repeatedly seen. The common factor in all traces seems to be the entry point to task_file_seq_next(). With the patch, all warnings go away. rcu: INFO: rcu_sched sel

Re: [PATCH v2 bpf-next 1/4] bpf: introduce task_vma bpf_iter

2020-12-18 Thread Yonghong Song
On 12/17/20 9:23 PM, Alexei Starovoitov wrote: On Thu, Dec 17, 2020 at 8:33 PM Song Liu wrote: ahh. I missed that. Makes sense. vm_file needs to be accurate, but vm_area_struct should be accessed as ptr_to_btf_id. Passing pointer of vm_area_struct into BPF will be tricky. For example, sh

Re: [PATCH v2 bpf-next 1/4] bpf: introduce task_vma bpf_iter

2020-12-17 Thread Yonghong Song
On 12/17/20 6:34 PM, Alexei Starovoitov wrote: On Thu, Dec 17, 2020 at 10:08:31PM +, Song Liu wrote: On Dec 17, 2020, at 11:03 AM, Alexei Starovoitov wrote: On Tue, Dec 15, 2020 at 03:36:59PM -0800, Song Liu wrote: +/* + * Key information from vm_area_struct. We need this because w

Re: [PATCH] btf: support ints larger than 128 bits

2020-12-17 Thread Yonghong Song
On 12/17/20 7:01 AM, Sean Young wrote: clang supports arbitrary length ints using the _ExtInt extension. This can be useful to hold very large values, e.g. 256 bit or 512 bit types. Larger types (e.g. 1024 bits) are possible but I am unaware of a use case for these. This requires the _ExtInt

Re: [PATCH v2 bpf-next 0/4] introduce bpf_iter for task_vma

2020-12-16 Thread Yonghong Song
On 12/16/20 9:35 AM, Song Liu wrote: On Dec 16, 2020, at 9:00 AM, Yonghong Song wrote: On 12/15/20 3:36 PM, Song Liu wrote: This set introduces bpf_iter for task_vma, which can be used to generate information similar to /proc/pid/maps or /proc/pid/smaps. Patch 4/4 adds I did not see

Re: [PATCH v2 bpf-next 4/4] selftests/bpf: add test for bpf_iter_task_vma

2020-12-16 Thread Yonghong Song
On 12/15/20 3:37 PM, Song Liu wrote: The test dumps information similar to /proc/pid/maps. The first line of the output is compared against the /proc file to make sure they match. Signed-off-by: Song Liu --- .../selftests/bpf/prog_tests/bpf_iter.c | 106 -- tools/tes

Re: [PATCH v2 bpf-next 3/4] libbpf: introduce section "iter.s/" for sleepable bpf_iter program

2020-12-16 Thread Yonghong Song
On 12/15/20 3:37 PM, Song Liu wrote: Sleepable iterator program have access to helper functions like bpf_d_path. Signed-off-by: Song Liu Acked-by: Yonghong Song

Re: [PATCH v2 bpf-next 2/4] bpf: allow bpf_d_path in sleepable bpf_iter program

2020-12-16 Thread Yonghong Song
ble bpf_iter programs: sleepable programs have access to bpf_d_path; non-sleepable programs have access to bpf_spin_lock. Signed-off-by: Song Liu Agreed. So far bpf_iter programs all called from process context. Acked-by: Yonghong Song

Re: [PATCH v2 bpf-next 1/4] bpf: introduce task_vma bpf_iter

2020-12-16 Thread Yonghong Song
On 12/15/20 3:36 PM, Song Liu wrote: Introduce task_vma bpf_iter to print memory information of a process. It can be used to print customized information similar to /proc//maps. task_vma iterator releases mmap_lock before calling the BPF program. Therefore, we cannot pass vm_area_struct direc

Re: [PATCH v2 bpf-next 0/4] introduce bpf_iter for task_vma

2020-12-16 Thread Yonghong Song
used by a lot of people. an example that mimics /proc/pid/maps. Changes v1 => v2: 1. Small fixes in task_iter.c and the selftests. (Yonghong) Song Liu (4): bpf: introduce task_vma bpf_iter bpf: allow bpf_d_path in sleepable bpf_iter program libbpf: introduce section "iter

Re: [PATCH bpf-next 4/4] selftests/bpf: add test for bpf_iter_task_vma

2020-12-15 Thread Yonghong Song
On 12/11/20 6:48 PM, Song Liu wrote: The test dumps information similar to /proc/pid/maps. The first line of the output is compared against the /proc file to make sure they match. Signed-off-by: Song Liu --- .../selftests/bpf/prog_tests/bpf_iter.c | 106 -- tools/tes

Re: [PATCH bpf-next 1/4] bpf: introduce task_vma bpf_iter

2020-12-15 Thread Yonghong Song
On 12/11/20 6:48 PM, Song Liu wrote: Introduce task_vma bpf_iter to print memory information of a process. It can be used to print customized information similar to /proc//maps. task_vma iterator releases mmap_lock before calling the BPF program. Therefore, we cannot pass vm_area_struct direc

  1   2   3   4   5   6   7   8   9   10   >