mirror of
				https://github.com/torvalds/linux.git
				synced 2025-11-04 02:30:34 +02:00 
			
		
		
		
	net: sched: ife: check on metadata length
This patch checks if sk buffer is available to dererence ife header. If not then NULL will returned to signal an malformed ife packet. This avoids to crashing the kernel from outside. Signed-off-by: Alexander Aring <aring@mojatatu.com> Reviewed-by: Yotam Gigi <yotam.gi@gmail.com> Acked-by: Jamal Hadi Salim <jhs@mojatatu.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
		
							parent
							
								
									cc74eddd0f
								
							
						
					
					
						commit
						d57493d6d1
					
				
					 1 changed files with 3 additions and 0 deletions
				
			
		| 
						 | 
				
			
			@ -69,6 +69,9 @@ void *ife_decode(struct sk_buff *skb, u16 *metalen)
 | 
			
		|||
	int total_pull;
 | 
			
		||||
	u16 ifehdrln;
 | 
			
		||||
 | 
			
		||||
	if (!pskb_may_pull(skb, skb->dev->hard_header_len + IFE_METAHDRLEN))
 | 
			
		||||
		return NULL;
 | 
			
		||||
 | 
			
		||||
	ifehdr = (struct ifeheadr *) (skb->data + skb->dev->hard_header_len);
 | 
			
		||||
	ifehdrln = ntohs(ifehdr->metalen);
 | 
			
		||||
	total_pull = skb->dev->hard_header_len + ifehdrln;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in a new issue