Skip to content

Commit d57493d

Browse files
Alexander Aringdavem330
authored andcommitted
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 <[email protected]> Reviewed-by: Yotam Gigi <[email protected]> Acked-by: Jamal Hadi Salim <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent cc74edd commit d57493d

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

net/ife/ife.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,9 @@ void *ife_decode(struct sk_buff *skb, u16 *metalen)
6969
int total_pull;
7070
u16 ifehdrln;
7171

72+
if (!pskb_may_pull(skb, skb->dev->hard_header_len + IFE_METAHDRLEN))
73+
return NULL;
74+
7275
ifehdr = (struct ifeheadr *) (skb->data + skb->dev->hard_header_len);
7376
ifehdrln = ntohs(ifehdr->metalen);
7477
total_pull = skb->dev->hard_header_len + ifehdrln;

0 commit comments

Comments
 (0)