forked from mirrors/linux
		
	libbpf: fix BPF_LOG_BUF_SIZE off-by-one error
The BPF_PROG_LOAD condition for kernel version <= 5.1 is log->len_total > UINT_MAX >> 8 /* (16 * 1024 * 1024) - 1 */ Signed-off-by: McCabe, Robert J <robert.mccabe@rockwellcollins.com> Signed-off-by: Alexei Starovoitov <ast@kernel.org>
This commit is contained in:
		
							parent
							
								
									8069594673
								
							
						
					
					
						commit
						4519efa6f8
					
				
					 1 changed files with 1 additions and 1 deletions
				
			
		|  | @ -92,7 +92,7 @@ struct bpf_load_program_attr { | ||||||
| #define MAPS_RELAX_COMPAT	0x01 | #define MAPS_RELAX_COMPAT	0x01 | ||||||
| 
 | 
 | ||||||
| /* Recommend log buffer size */ | /* Recommend log buffer size */ | ||||||
| #define BPF_LOG_BUF_SIZE (16 * 1024 * 1024) /* verifier maximum in kernels <= 5.1 */ | #define BPF_LOG_BUF_SIZE (UINT32_MAX >> 8) /* verifier maximum in kernels <= 5.1 */ | ||||||
| LIBBPF_API int | LIBBPF_API int | ||||||
| bpf_load_program_xattr(const struct bpf_load_program_attr *load_attr, | bpf_load_program_xattr(const struct bpf_load_program_attr *load_attr, | ||||||
| 		       char *log_buf, size_t log_buf_sz); | 		       char *log_buf, size_t log_buf_sz); | ||||||
|  |  | ||||||
		Loading…
	
		Reference in a new issue
	
	 McCabe, Robert J
						McCabe, Robert J