summaryrefslogtreecommitdiffstats
path: root/net/ipv6
diff options
context:
space:
mode:
authorJakub Kicinski <kuba@kernel.org>2021-11-18 13:13:16 -0800
committerJakub Kicinski <kuba@kernel.org>2021-11-18 13:13:16 -0800
commit50fc24944a2a0ef5aab571dcac17f6c5f2613f56 (patch)
tree32477b48cc10073e948eb7b85877dc5a0746749d /net/ipv6
parentbb8cecf8ba127abca8ccd102207a59c55fdae515 (diff)
parent8d0112ac6fd001f95aabb084ec2ccaa3637bc344 (diff)
downloadlinux-stable-50fc24944a2a0ef5aab571dcac17f6c5f2613f56.tar.gz
linux-stable-50fc24944a2a0ef5aab571dcac17f6c5f2613f56.tar.bz2
linux-stable-50fc24944a2a0ef5aab571dcac17f6c5f2613f56.zip
Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'net/ipv6')
-rw-r--r--net/ipv6/esp6.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/net/ipv6/esp6.c b/net/ipv6/esp6.c
index ed2f061b8768..f0bac6f7ab6b 100644
--- a/net/ipv6/esp6.c
+++ b/net/ipv6/esp6.c
@@ -808,6 +808,12 @@ int esp6_input_done2(struct sk_buff *skb, int err)
struct tcphdr *th;
offset = ipv6_skip_exthdr(skb, offset, &nexthdr, &frag_off);
+
+ if (offset < 0) {
+ err = -EINVAL;
+ goto out;
+ }
+
uh = (void *)(skb->data + offset);
th = (void *)(skb->data + offset);
hdr_len += offset;