File tree 3 files changed +10
-8
lines changed
3 files changed +10
-8
lines changed Original file line number Diff line number Diff line change @@ -790,7 +790,7 @@ const char *btf_str_by_offset(const struct btf *btf, u32 offset)
790
790
return NULL ;
791
791
}
792
792
793
- static bool __btf_name_valid (const struct btf * btf , u32 offset )
793
+ static bool btf_name_valid_identifier (const struct btf * btf , u32 offset )
794
794
{
795
795
/* offset must be valid */
796
796
const char * src = btf_str_by_offset (btf , offset );
@@ -811,11 +811,6 @@ static bool __btf_name_valid(const struct btf *btf, u32 offset)
811
811
return !* src ;
812
812
}
813
813
814
- static bool btf_name_valid_identifier (const struct btf * btf , u32 offset )
815
- {
816
- return __btf_name_valid (btf , offset );
817
- }
818
-
819
814
/* Allow any printable character in DATASEC names */
820
815
static bool btf_name_valid_section (const struct btf * btf , u32 offset )
821
816
{
@@ -4629,7 +4624,7 @@ static s32 btf_var_check_meta(struct btf_verifier_env *env,
4629
4624
}
4630
4625
4631
4626
if (!t -> name_off ||
4632
- !__btf_name_valid (env -> btf , t -> name_off )) {
4627
+ !btf_name_valid_identifier (env -> btf , t -> name_off )) {
4633
4628
btf_verifier_log_type (env , t , "Invalid name" );
4634
4629
return - EINVAL ;
4635
4630
}
Original file line number Diff line number Diff line change @@ -169,6 +169,10 @@ BPF_EXTRA_CFLAGS += -I$(srctree)/arch/mips/include/asm/mach-generic
169
169
endif
170
170
endif
171
171
172
+ ifeq ($(ARCH ) , x86)
173
+ BPF_EXTRA_CFLAGS += -fcf-protection
174
+ endif
175
+
172
176
TPROGS_CFLAGS += -Wall -O2
173
177
TPROGS_CFLAGS += -Wmissing-prototypes
174
178
TPROGS_CFLAGS += -Wstrict-prototypes
@@ -405,7 +409,7 @@ $(obj)/%.o: $(src)/%.c
405
409
-Wno-gnu-variable-sized-type-not-at-end \
406
410
-Wno-address-of-packed-member -Wno-tautological-compare \
407
411
-Wno-unknown-warning-option $(CLANG_ARCH_ARGS ) \
408
- -fno-asynchronous-unwind-tables -fcf-protection \
412
+ -fno-asynchronous-unwind-tables \
409
413
-I$(srctree ) /samples/bpf/ -include asm_goto_workaround.h \
410
414
-O2 -emit-llvm -Xclang -disable-llvm-passes -c $< -o - | \
411
415
$(OPT ) -O2 -mtriple=bpf-pc-linux | $(LLVM_DIS ) | \
Original file line number Diff line number Diff line change @@ -28,6 +28,9 @@ int elf_open(const char *binary_path, struct elf_fd *elf_fd)
28
28
int fd , ret ;
29
29
Elf * elf ;
30
30
31
+ elf_fd -> elf = NULL ;
32
+ elf_fd -> fd = -1 ;
33
+
31
34
if (elf_version (EV_CURRENT ) == EV_NONE ) {
32
35
pr_warn ("elf: failed to init libelf for %s\n" , binary_path );
33
36
return - LIBBPF_ERRNO__LIBELF ;
You can’t perform that action at this time.
0 commit comments