summaryrefslogtreecommitdiffstats
path: root/include/net/ife.h
diff options
context:
space:
mode:
authorAlexander Aring <aring@mojatatu.com>2018-04-20 21:15:04 +0200
committerDavid S. Miller <davem@davemloft.net>2018-04-23 03:12:00 +0200
commitcc74eddd0ff325d57373cea99f642b787d7f76f5 (patch)
treefc8048a8254e5d249763543e20355a0bba0324f1 /include/net/ife.h
parentnet: sched: ife: signal not finding metaid (diff)
downloadlinux-cc74eddd0ff325d57373cea99f642b787d7f76f5.tar.xz
linux-cc74eddd0ff325d57373cea99f642b787d7f76f5.zip
net: sched: ife: handle malformed tlv length
There is currently no handling to check on a invalid tlv length. This patch adds such handling to avoid killing the kernel with a malformed ife packet. 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>
Diffstat (limited to 'include/net/ife.h')
-rw-r--r--include/net/ife.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/include/net/ife.h b/include/net/ife.h
index 44b9c00f7223..e117617e3c34 100644
--- a/include/net/ife.h
+++ b/include/net/ife.h
@@ -12,7 +12,8 @@
void *ife_encode(struct sk_buff *skb, u16 metalen);
void *ife_decode(struct sk_buff *skb, u16 *metalen);
-void *ife_tlv_meta_decode(void *skbdata, u16 *attrtype, u16 *dlen, u16 *totlen);
+void *ife_tlv_meta_decode(void *skbdata, const void *ifehdr_end, u16 *attrtype,
+ u16 *dlen, u16 *totlen);
int ife_tlv_meta_encode(void *skbdata, u16 attrtype, u16 dlen,
const void *dval);