diff --git a/ci/diffs/0001-selftests-bpf-set-test-path-for-token-obj_priv_impli.patch b/ci/diffs/0001-selftests-bpf-set-test-path-for-token-obj_priv_impli.patch deleted file mode 100644 index 4fbe0b2..0000000 --- a/ci/diffs/0001-selftests-bpf-set-test-path-for-token-obj_priv_impli.patch +++ /dev/null @@ -1,85 +0,0 @@ -From e3a4f5092e847ec00e2b66c060f2cef52b8d0177 Mon Sep 17 00:00:00 2001 -From: Ihor Solodrai -Date: Thu, 14 Nov 2024 12:49:34 -0800 -Subject: [PATCH bpf-next] selftests/bpf: set test path for - token/obj_priv_implicit_token_envvar - -token/obj_priv_implicit_token_envvar test may fail in an environment -where the process executing tests can not write to the root path. - -Example: -https://github.com/libbpf/libbpf/actions/runs/11844507007/job/33007897936 - -Change default path used by the test to /tmp/bpf-token-fs, and make it -runtime configurable via an environment variable. - -Signed-off-by: Ihor Solodrai ---- - tools/testing/selftests/bpf/prog_tests/token.c | 18 +++++++++++------- - 1 file changed, 11 insertions(+), 7 deletions(-) - -diff --git a/tools/testing/selftests/bpf/prog_tests/token.c b/tools/testing/selftests/bpf/prog_tests/token.c -index fe86e4fdb89c..39f5414b674b 100644 ---- a/tools/testing/selftests/bpf/prog_tests/token.c -+++ b/tools/testing/selftests/bpf/prog_tests/token.c -@@ -828,8 +828,11 @@ static int userns_obj_priv_btf_success(int mnt_fd, struct token_lsm *lsm_skel) - return validate_struct_ops_load(mnt_fd, true /* should succeed */); - } - -+static const char* token_bpffs_custom_dir() { -+ return getenv("BPF_SELFTESTS_BPF_TOKEN_DIR") ? : "/tmp/bpf-token-fs"; -+} -+ - #define TOKEN_ENVVAR "LIBBPF_BPF_TOKEN_PATH" --#define TOKEN_BPFFS_CUSTOM "/bpf-token-fs" - - static int userns_obj_priv_implicit_token(int mnt_fd, struct token_lsm *lsm_skel) - { -@@ -892,6 +895,7 @@ static int userns_obj_priv_implicit_token(int mnt_fd, struct token_lsm *lsm_skel - - static int userns_obj_priv_implicit_token_envvar(int mnt_fd, struct token_lsm *lsm_skel) - { -+ const char *custom_dir = token_bpffs_custom_dir(); - LIBBPF_OPTS(bpf_object_open_opts, opts); - struct dummy_st_ops_success *skel; - int err; -@@ -909,10 +913,10 @@ static int userns_obj_priv_implicit_token_envvar(int mnt_fd, struct token_lsm *l - * BPF token implicitly, unless pointed to it through - * LIBBPF_BPF_TOKEN_PATH envvar - */ -- rmdir(TOKEN_BPFFS_CUSTOM); -- if (!ASSERT_OK(mkdir(TOKEN_BPFFS_CUSTOM, 0777), "mkdir_bpffs_custom")) -+ rmdir(custom_dir); -+ if (!ASSERT_OK(mkdir(custom_dir, 0777), "mkdir_bpffs_custom")) - goto err_out; -- err = sys_move_mount(mnt_fd, "", AT_FDCWD, TOKEN_BPFFS_CUSTOM, MOVE_MOUNT_F_EMPTY_PATH); -+ err = sys_move_mount(mnt_fd, "", AT_FDCWD, custom_dir, MOVE_MOUNT_F_EMPTY_PATH); - if (!ASSERT_OK(err, "move_mount_bpffs")) - goto err_out; - -@@ -925,7 +929,7 @@ static int userns_obj_priv_implicit_token_envvar(int mnt_fd, struct token_lsm *l - goto err_out; - } - -- err = setenv(TOKEN_ENVVAR, TOKEN_BPFFS_CUSTOM, 1 /*overwrite*/); -+ err = setenv(TOKEN_ENVVAR, custom_dir, 1 /*overwrite*/); - if (!ASSERT_OK(err, "setenv_token_path")) - goto err_out; - -@@ -951,11 +955,11 @@ static int userns_obj_priv_implicit_token_envvar(int mnt_fd, struct token_lsm *l - if (!ASSERT_ERR(err, "obj_empty_token_path_load")) - goto err_out; - -- rmdir(TOKEN_BPFFS_CUSTOM); -+ rmdir(custom_dir); - unsetenv(TOKEN_ENVVAR); - return 0; - err_out: -- rmdir(TOKEN_BPFFS_CUSTOM); -+ rmdir(custom_dir); - unsetenv(TOKEN_ENVVAR); - return -EINVAL; - } --- -2.47.0 - diff --git a/ci/diffs/4000-selftests-bpf-Fix-tests-after-fields-reorder-in-stru.patch b/ci/diffs/4000-selftests-bpf-Fix-tests-after-fields-reorder-in-stru.patch deleted file mode 100644 index 3ee8a86..0000000 --- a/ci/diffs/4000-selftests-bpf-Fix-tests-after-fields-reorder-in-stru.patch +++ /dev/null @@ -1,69 +0,0 @@ -From bd06a13f44e15e2e83561ea165061c445a15bd9e Mon Sep 17 00:00:00 2001 -From: Song Liu -Date: Thu, 27 Mar 2025 11:55:28 -0700 -Subject: [PATCH 4000/4002] selftests/bpf: Fix tests after fields reorder in - struct file - -The change in struct file [1] moved f_ref to the 3rd cache line. -It made *(u64 *)file dereference invalid from the verifier point of view, -because btf_struct_walk() walks into f_lock field, which is 4-byte long. - -Fix the selftests to deference the file pointer as a 4-byte access. - -[1] commit e249056c91a2 ("fs: place f_ref to 3rd cache line in struct file to resolve false sharing") -Reported-by: Jakub Kicinski -Signed-off-by: Song Liu -Link: https://lore.kernel.org/r/20250327185528.1740787-1-song@kernel.org -Signed-off-by: Alexei Starovoitov ---- - tools/testing/selftests/bpf/progs/test_module_attach.c | 2 +- - tools/testing/selftests/bpf/progs/test_subprogs_extable.c | 6 +++--- - 2 files changed, 4 insertions(+), 4 deletions(-) - -diff --git a/tools/testing/selftests/bpf/progs/test_module_attach.c b/tools/testing/selftests/bpf/progs/test_module_attach.c -index fb07f5773888..7f3c233943b3 100644 ---- a/tools/testing/selftests/bpf/progs/test_module_attach.c -+++ b/tools/testing/selftests/bpf/progs/test_module_attach.c -@@ -117,7 +117,7 @@ int BPF_PROG(handle_fexit_ret, int arg, struct file *ret) - - bpf_probe_read_kernel(&buf, 8, ret); - bpf_probe_read_kernel(&buf, 8, (char *)ret + 256); -- *(volatile long long *)ret; -+ *(volatile int *)ret; - *(volatile int *)&ret->f_mode; - return 0; - } -diff --git a/tools/testing/selftests/bpf/progs/test_subprogs_extable.c b/tools/testing/selftests/bpf/progs/test_subprogs_extable.c -index e2a21fbd4e44..dcac69f5928a 100644 ---- a/tools/testing/selftests/bpf/progs/test_subprogs_extable.c -+++ b/tools/testing/selftests/bpf/progs/test_subprogs_extable.c -@@ -21,7 +21,7 @@ static __u64 test_cb(struct bpf_map *map, __u32 *key, __u64 *val, void *data) - SEC("fexit/bpf_testmod_return_ptr") - int BPF_PROG(handle_fexit_ret_subprogs, int arg, struct file *ret) - { -- *(volatile long *)ret; -+ *(volatile int *)ret; - *(volatile int *)&ret->f_mode; - bpf_for_each_map_elem(&test_array, test_cb, NULL, 0); - triggered++; -@@ -31,7 +31,7 @@ int BPF_PROG(handle_fexit_ret_subprogs, int arg, struct file *ret) - SEC("fexit/bpf_testmod_return_ptr") - int BPF_PROG(handle_fexit_ret_subprogs2, int arg, struct file *ret) - { -- *(volatile long *)ret; -+ *(volatile int *)ret; - *(volatile int *)&ret->f_mode; - bpf_for_each_map_elem(&test_array, test_cb, NULL, 0); - triggered++; -@@ -41,7 +41,7 @@ int BPF_PROG(handle_fexit_ret_subprogs2, int arg, struct file *ret) - SEC("fexit/bpf_testmod_return_ptr") - int BPF_PROG(handle_fexit_ret_subprogs3, int arg, struct file *ret) - { -- *(volatile long *)ret; -+ *(volatile int *)ret; - *(volatile int *)&ret->f_mode; - bpf_for_each_map_elem(&test_array, test_cb, NULL, 0); - triggered++; --- -2.49.0 - diff --git a/ci/diffs/4001-selftests-bpf-Fix-verifier_bpf_fastcall-test.patch b/ci/diffs/4001-selftests-bpf-Fix-verifier_bpf_fastcall-test.patch deleted file mode 100644 index 117d6dd..0000000 --- a/ci/diffs/4001-selftests-bpf-Fix-verifier_bpf_fastcall-test.patch +++ /dev/null @@ -1,71 +0,0 @@ -From 8be3a12f9f266aaf3f06f0cfe0e90cfe4d956f3d Mon Sep 17 00:00:00 2001 -From: Song Liu -Date: Fri, 28 Mar 2025 12:31:24 -0700 -Subject: [PATCH 4001/4002] selftests/bpf: Fix verifier_bpf_fastcall test - -Commit [1] moves percpu data on x86 from address 0x000... to address -0xfff... - -Before [1]: - -159020: 0000000000030700 0 OBJECT GLOBAL DEFAULT 23 pcpu_hot - -After [1]: - -152602: ffffffff83a3e034 4 OBJECT GLOBAL DEFAULT 35 pcpu_hot - -As a result, verifier_bpf_fastcall tests should now expect a negative -value for pcpu_hot, IOW, the disassemble should show "r=" instead of -"w=". - -Fix this in the test. - -Note that, a later change created a new variable "cpu_number" for -bpf_get_smp_processor_id() [2]. The inlining logic is updated properly -as part of this change, so there is no need to fix anything on the -kernel side. - -[1] commit 9d7de2aa8b41 ("x86/percpu/64: Use relative percpu offsets") -[2] commit 01c7bc5198e9 ("x86/smp: Move cpu number to percpu hot section") -Reported-by: Jakub Kicinski -Signed-off-by: Song Liu -Link: https://lore.kernel.org/r/20250328193124.808784-1-song@kernel.org -Signed-off-by: Alexei Starovoitov ---- - tools/testing/selftests/bpf/progs/verifier_bpf_fastcall.c | 6 +++--- - 1 file changed, 3 insertions(+), 3 deletions(-) - -diff --git a/tools/testing/selftests/bpf/progs/verifier_bpf_fastcall.c b/tools/testing/selftests/bpf/progs/verifier_bpf_fastcall.c -index a9be6ae49454..c258b0722e04 100644 ---- a/tools/testing/selftests/bpf/progs/verifier_bpf_fastcall.c -+++ b/tools/testing/selftests/bpf/progs/verifier_bpf_fastcall.c -@@ -12,7 +12,7 @@ SEC("raw_tp") - __arch_x86_64 - __log_level(4) __msg("stack depth 8") - __xlated("4: r5 = 5") --__xlated("5: w0 = ") -+__xlated("5: r0 = ") - __xlated("6: r0 = &(void __percpu *)(r0)") - __xlated("7: r0 = *(u32 *)(r0 +0)") - __xlated("8: exit") -@@ -704,7 +704,7 @@ SEC("raw_tp") - __arch_x86_64 - __log_level(4) __msg("stack depth 32+0") - __xlated("2: r1 = 1") --__xlated("3: w0 =") -+__xlated("3: r0 =") - __xlated("4: r0 = &(void __percpu *)(r0)") - __xlated("5: r0 = *(u32 *)(r0 +0)") - /* bpf_loop params setup */ -@@ -753,7 +753,7 @@ __arch_x86_64 - __log_level(4) __msg("stack depth 40+0") - /* call bpf_get_smp_processor_id */ - __xlated("2: r1 = 42") --__xlated("3: w0 =") -+__xlated("3: r0 =") - __xlated("4: r0 = &(void __percpu *)(r0)") - __xlated("5: r0 = *(u32 *)(r0 +0)") - /* call bpf_get_prandom_u32 */ --- -2.49.0 - diff --git a/ci/diffs/4002-selftests-bpf-Fix-verifier_private_stack-test-failur.patch b/ci/diffs/4002-selftests-bpf-Fix-verifier_private_stack-test-failur.patch deleted file mode 100644 index accd99b..0000000 --- a/ci/diffs/4002-selftests-bpf-Fix-verifier_private_stack-test-failur.patch +++ /dev/null @@ -1,71 +0,0 @@ -From 07be1f644ff9eeb842fd0490ddd824df0828cb0e Mon Sep 17 00:00:00 2001 -From: Yonghong Song -Date: Sun, 30 Mar 2025 20:38:28 -0700 -Subject: [PATCH 4002/4002] selftests/bpf: Fix verifier_private_stack test - failure - -Several verifier_private_stack tests failed with latest bpf-next. -For example, for 'Private stack, single prog' subtest, the -jitted code: - func #0: - 0: f3 0f 1e fa endbr64 - 4: 0f 1f 44 00 00 nopl (%rax,%rax) - 9: 0f 1f 00 nopl (%rax) - c: 55 pushq %rbp - d: 48 89 e5 movq %rsp, %rbp - 10: f3 0f 1e fa endbr64 - 14: 49 b9 58 74 8a 8f 7d 60 00 00 movabsq $0x607d8f8a7458, %r9 - 1e: 65 4c 03 0c 25 28 c0 48 87 addq %gs:-0x78b73fd8, %r9 - 27: bf 2a 00 00 00 movl $0x2a, %edi - 2c: 49 89 b9 00 ff ff ff movq %rdi, -0x100(%r9) - 33: 31 c0 xorl %eax, %eax - 35: c9 leave - 36: e9 20 5d 0f e1 jmp 0xffffffffe10f5d5b - -The insn 'addq %gs:-0x78b73fd8, %r9' does not match the expected -regex 'addq %gs:0x{{.*}}, %r9' and this caused test failure. - -Fix it by changing '%gs:0x{{.*}}' to '%gs:{{.*}}' to accommodate the -possible negative offset. A few other subtests are fixed in a similar way. - -Signed-off-by: Yonghong Song -Link: https://lore.kernel.org/r/20250331033828.365077-1-yonghong.song@linux.dev -Signed-off-by: Alexei Starovoitov ---- - tools/testing/selftests/bpf/progs/verifier_private_stack.c | 6 +++--- - 1 file changed, 3 insertions(+), 3 deletions(-) - -diff --git a/tools/testing/selftests/bpf/progs/verifier_private_stack.c b/tools/testing/selftests/bpf/progs/verifier_private_stack.c -index b1fbdf119553..fc91b414364e 100644 ---- a/tools/testing/selftests/bpf/progs/verifier_private_stack.c -+++ b/tools/testing/selftests/bpf/progs/verifier_private_stack.c -@@ -27,7 +27,7 @@ __description("Private stack, single prog") - __success - __arch_x86_64 - __jited(" movabsq $0x{{.*}}, %r9") --__jited(" addq %gs:0x{{.*}}, %r9") -+__jited(" addq %gs:{{.*}}, %r9") - __jited(" movl $0x2a, %edi") - __jited(" movq %rdi, -0x100(%r9)") - __naked void private_stack_single_prog(void) -@@ -74,7 +74,7 @@ __success - __arch_x86_64 - /* private stack fp for the main prog */ - __jited(" movabsq $0x{{.*}}, %r9") --__jited(" addq %gs:0x{{.*}}, %r9") -+__jited(" addq %gs:{{.*}}, %r9") - __jited(" movl $0x2a, %edi") - __jited(" movq %rdi, -0x200(%r9)") - __jited(" pushq %r9") -@@ -122,7 +122,7 @@ __jited(" pushq %rbp") - __jited(" movq %rsp, %rbp") - __jited(" endbr64") - __jited(" movabsq $0x{{.*}}, %r9") --__jited(" addq %gs:0x{{.*}}, %r9") -+__jited(" addq %gs:{{.*}}, %r9") - __jited(" pushq %r9") - __jited(" callq") - __jited(" popq %r9") --- -2.49.0 -