diff options
| author | Eric Dumazet <edumazet@google.com> | 2017-02-03 00:03:26 -0800 |
|---|---|---|
| committer | Moyster <oysterized@gmail.com> | 2017-06-17 15:51:12 +0200 |
| commit | 04b7b0292c6bccb52bf806b23de9400372909ff6 (patch) | |
| tree | c830df2d54fe75a2371d1473b8a2bd86f0244b37 /include | |
| parent | ab35fcbfc63f09e8709e2000ae84683ac05f226a (diff) | |
netlabel: out of bound access in cipso_v4_validate()
commit d71b7896886345c53ef1d84bda2bc758554f5d61 upstream.
syzkaller found another out of bound access in ip_options_compile(),
or more exactly in cipso_v4_validate()
Fixes: 20e2a8648596 ("cipso: handle CIPSO options correctly when NetLabel is disabled")
Fixes: 446fda4f2682 ("[NetLabel]: CIPSOv4 engine")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Reported-by: Dmitry Vyukov <dvyukov@google.com>
Cc: Paul Moore <paul@paul-moore.com>
Acked-by: Paul Moore <paul@paul-moore.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Willy Tarreau <w@1wt.eu>
Diffstat (limited to 'include')
| -rw-r--r-- | include/net/cipso_ipv4.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/include/net/cipso_ipv4.h b/include/net/cipso_ipv4.h index a8c2ef6d3..9078b31d3 100644 --- a/include/net/cipso_ipv4.h +++ b/include/net/cipso_ipv4.h @@ -303,6 +303,10 @@ static inline int cipso_v4_validate(const struct sk_buff *skb, } for (opt_iter = 6; opt_iter < opt_len;) { + if (opt_iter + 1 == opt_len) { + err_offset = opt_iter; + goto out; + } tag_len = opt[opt_iter + 1]; if ((tag_len == 0) || (opt[opt_iter + 1] > (opt_len - opt_iter))) { err_offset = opt_iter + 1; |
