projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
c1f8d0f
)
ipv6: sr: fix out-of-bounds access in SRH validation
author
David Lebrun
<
[email protected]
>
Tue, 18 Apr 2017 15:59:49 +0000
(17:59 +0200)
committer
David S. Miller
<
[email protected]
>
Thu, 20 Apr 2017 19:40:33 +0000
(15:40 -0400)
This patch fixes an out-of-bounds access in seg6_validate_srh() when the
trailing data is less than sizeof(struct sr6_tlv).
Reported-by: Andrey Konovalov <
[email protected]
>
Cc: Andrey Konovalov <
[email protected]
>
Signed-off-by: David Lebrun <
[email protected]
>
Signed-off-by: David S. Miller <
[email protected]
>
net/ipv6/seg6.c
patch
|
blob
|
history
diff --git
a/net/ipv6/seg6.c
b/net/ipv6/seg6.c
index a855eb325b030a666fe92c56a2d432c77d9dfe7a..5f44ffed25768d83c31b31295474c5ecf623e986 100644
(file)
--- a/
net/ipv6/seg6.c
+++ b/
net/ipv6/seg6.c
@@
-53,6
+53,9
@@
bool seg6_validate_srh(struct ipv6_sr_hdr *srh, int len)
struct sr6_tlv *tlv;
unsigned int tlv_len;
+ if (trailing < sizeof(*tlv))
+ return false;
+
tlv = (struct sr6_tlv *)((unsigned char *)srh + tlv_offset);
tlv_len = sizeof(*tlv) + tlv->len;