File tree Expand file tree Collapse file tree 3 files changed +10
-8
lines changed Expand file tree Collapse file tree 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)
790790	return  NULL ;
791791}
792792
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 )
794794{
795795	/* offset must be valid */ 
796796	const  char  * src  =  btf_str_by_offset (btf , offset );
@@ -811,11 +811,6 @@ static bool __btf_name_valid(const struct btf *btf, u32 offset)
811811	return  !* src ;
812812}
813813
814- static  bool  btf_name_valid_identifier (const  struct  btf  * btf , u32  offset )
815- {
816- 	return  __btf_name_valid (btf , offset );
817- }
818- 
819814/* Allow any printable character in DATASEC names */ 
820815static  bool  btf_name_valid_section (const  struct  btf  * btf , u32  offset )
821816{
@@ -4629,7 +4624,7 @@ static s32 btf_var_check_meta(struct btf_verifier_env *env,
46294624	}
46304625
46314626	if  (!t -> name_off  || 
4632- 	    !__btf_name_valid (env -> btf , t -> name_off )) {
4627+ 	    !btf_name_valid_identifier (env -> btf , t -> name_off )) {
46334628		btf_verifier_log_type (env , t , "Invalid name" );
46344629		return  - EINVAL ;
46354630	}
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
169169endif 
170170endif 
171171
172+ ifeq  ($(ARCH ) , x86)
173+ BPF_EXTRA_CFLAGS  += -fcf-protection
174+ endif 
175+ 
172176TPROGS_CFLAGS  += -Wall -O2
173177TPROGS_CFLAGS  += -Wmissing-prototypes
174178TPROGS_CFLAGS  += -Wstrict-prototypes
@@ -405,7 +409,7 @@ $(obj)/%.o: $(src)/%.c
405409		-Wno-gnu-variable-sized-type-not-at-end \ 
406410		-Wno-address-of-packed-member -Wno-tautological-compare \ 
407411		-Wno-unknown-warning-option $(CLANG_ARCH_ARGS )  \ 
408- 		-fno-asynchronous-unwind-tables -fcf-protection  \ 
412+ 		-fno-asynchronous-unwind-tables \ 
409413		-I$(srctree ) /samples/bpf/ -include asm_goto_workaround.h \ 
410414		-O2 -emit-llvm -Xclang -disable-llvm-passes -c $<  -o - |  \ 
411415		$(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)
2828	int  fd , ret ;
2929	Elf  * elf ;
3030
31+ 	elf_fd -> elf  =  NULL ;
32+ 	elf_fd -> fd  =  -1 ;
33+ 
3134	if  (elf_version (EV_CURRENT ) ==  EV_NONE ) {
3235		pr_warn ("elf: failed to init libelf for %s\n" , binary_path );
3336		return  - LIBBPF_ERRNO__LIBELF ;
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments