mirror of
				https://github.com/torvalds/linux.git
				synced 2025-10-31 16:48:26 +02:00 
			
		
		
		
	s390/bpf: Fix indirect trampoline generation
The func_addr used to be NULL for indirect trampolines used by struct_ops.
Now func_addr is a valid function pointer.
Hence use BPF_TRAMP_F_INDIRECT flag to detect such condition.
Fixes: 2cd3e3772e ("x86/cfi,bpf: Fix bpf_struct_ops CFI")
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Reviewed-by: Ilya Leoshkevich <iii@linux.ibm.com>
Link: https://lore.kernel.org/bpf/20231216004549.78355-1-alexei.starovoitov@gmail.com
			
			
This commit is contained in:
		
							parent
							
								
									42d45c4562
								
							
						
					
					
						commit
						0c970ed2f8
					
				
					 2 changed files with 2 additions and 3 deletions
				
			
		|  | @ -2362,7 +2362,8 @@ static int __arch_prepare_bpf_trampoline(struct bpf_tramp_image *im, | |||
| 		return -ENOTSUPP; | ||||
| 
 | ||||
| 	/* Return to %r14, since func_addr and %r0 are not available. */ | ||||
| 	if (!func_addr && !(flags & BPF_TRAMP_F_ORIG_STACK)) | ||||
| 	if ((!func_addr && !(flags & BPF_TRAMP_F_ORIG_STACK)) || | ||||
| 	    (flags & BPF_TRAMP_F_INDIRECT)) | ||||
| 		flags |= BPF_TRAMP_F_SKIP_FRAME; | ||||
| 
 | ||||
| 	/*
 | ||||
|  |  | |||
|  | @ -1,7 +1,5 @@ | |||
| # TEMPORARY | ||||
| # Alphabetical order | ||||
| dummy_st_ops/dummy_init_ret_value | ||||
| dummy_st_ops/dummy_init_ptr_arg | ||||
| exceptions				 # JIT does not support calling kfunc bpf_throw				       (exceptions) | ||||
| get_stack_raw_tp                         # user_stack corrupted user stack                                             (no backchain userspace) | ||||
| stacktrace_build_id                      # compare_map_keys stackid_hmap vs. stackmap err -2 errno 2                   (?) | ||||
|  |  | |||
		Loading…
	
		Reference in a new issue
	
	 Alexei Starovoitov
						Alexei Starovoitov