Skip to content

Commit 9b88bdc

Browse files
listoutKernel Patches Daemon
authored andcommitted
selftests/bpf: Fix redefinition of 'off' as different kind of symbol
This fixes the following build error CLNG-BPF [test_progs] verifier_global_ptr_args.bpf.o progs/verifier_global_ptr_args.c:228:5: error: redefinition of 'off' as different kind of symbol 228 | u32 off; | ^ Suggested-by: Yonghong Song <[email protected]> Signed-off-by: Brahmajit Das <[email protected]>
1 parent cf0c057 commit 9b88bdc

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

tools/testing/selftests/bpf/progs/verifier_global_ptr_args.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ int trusted_to_untrusted(void *ctx)
225225
}
226226

227227
char mem[16];
228-
u32 off;
228+
u32 offset;
229229

230230
SEC("tp_btf/sys_enter")
231231
__success
@@ -240,9 +240,9 @@ int anything_to_untrusted(void *ctx)
240240
/* scalar to untrusted */
241241
subprog_untrusted(0);
242242
/* variable offset to untrusted (map) */
243-
subprog_untrusted((void *)mem + off);
243+
subprog_untrusted((void *)mem + offset);
244244
/* variable offset to untrusted (trusted) */
245-
subprog_untrusted((void *)bpf_get_current_task_btf() + off);
245+
subprog_untrusted((void *)bpf_get_current_task_btf() + offset);
246246
return 0;
247247
}
248248

@@ -298,12 +298,12 @@ int anything_to_untrusted_mem(void *ctx)
298298
/* scalar to untrusted mem */
299299
subprog_void_untrusted(0);
300300
/* variable offset to untrusted mem (map) */
301-
subprog_void_untrusted((void *)mem + off);
301+
subprog_void_untrusted((void *)mem + offset);
302302
/* variable offset to untrusted mem (trusted) */
303-
subprog_void_untrusted(bpf_get_current_task_btf() + off);
303+
subprog_void_untrusted(bpf_get_current_task_btf() + offset);
304304
/* variable offset to untrusted char/enum (map) */
305-
subprog_char_untrusted(mem + off);
306-
subprog_enum_untrusted((void *)mem + off);
305+
subprog_char_untrusted(mem + offset);
306+
subprog_enum_untrusted((void *)mem + offset);
307307
return 0;
308308
}
309309

0 commit comments

Comments
 (0)