bpf: verifier: add checks for BPF_ABS | BPF_IND instructions
introduce program type BPF_PROG_TYPE_SOCKET_FILTER that is used
for attaching programs to sockets where ctx == skb.
add verifier checks for ABS/IND instructions which can only be seen
in socket filters, therefore the check:
  if (env->prog->aux->prog_type != BPF_PROG_TYPE_SOCKET_FILTER)
    verbose("BPF_LD_ABS|IND instructions are only allowed in socket filters\n");
Signed-off-by: Alexei Starovoitov <ast@plumgrid.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
	
	
This commit is contained in:
		
					parent
					
						
							
								f51a5e82ea
							
						
					
				
			
			
				commit
				
					
						ddd872bc30
					
				
			
		
					 2 changed files with 69 additions and 2 deletions
				
			
		|  | @ -117,6 +117,7 @@ enum bpf_map_type { | |||
| 
 | ||||
| enum bpf_prog_type { | ||||
| 	BPF_PROG_TYPE_UNSPEC, | ||||
| 	BPF_PROG_TYPE_SOCKET_FILTER, | ||||
| }; | ||||
| 
 | ||||
| /* flags for BPF_MAP_UPDATE_ELEM command */ | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Alexei Starovoitov
				Alexei Starovoitov