mirror of
https://github.com/torvalds/linux.git
synced 2026-06-07 22:14:04 +02:00
netlabel: out of bound access in cipso_v4_validate()
[ Upstream commitd71b789688] syzkaller found another out of bound access in ip_options_compile(), or more exactly in cipso_v4_validate() Fixes:20e2a86485("cipso: handle CIPSO options correctly when NetLabel is disabled") Fixes:446fda4f26("[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: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
2d9c2e011f
commit
13c3646dac
|
|
@ -309,6 +309,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) || (tag_len > (opt_len - opt_iter))) {
|
||||
err_offset = opt_iter + 1;
|
||||
|
|
|
|||
|
|
@ -1657,6 +1657,10 @@ int cipso_v4_validate(const struct sk_buff *skb, unsigned char **option)
|
|||
goto validate_return_locked;
|
||||
}
|
||||
|
||||
if (opt_iter + 1 == opt_len) {
|
||||
err_offset = opt_iter;
|
||||
goto validate_return_locked;
|
||||
}
|
||||
tag_len = tag[1];
|
||||
if (tag_len > (opt_len - opt_iter)) {
|
||||
err_offset = opt_iter + 1;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user