mirror of
https://github.com/AsahiLinux/u-boot
synced 2024-11-28 07:31:15 +00:00
net: ipv6: router advertisement message length should be within limits
The argument len passed to function process_ra is the length of the IPv6 router advertisement message and needs to be between 0 and MTU because it is assigned to remaining_option_len and used as a loop variable. Addresses-Coverity-ID: 450971 ("TAINTED_SCALAR") Signed-off-by: Ehsan Mohandesi <emohandesi@linux.microsoft.com> Reviewed-by: Viacheslav Mitrofanov <v.v.mitrofanov@yadro.com> Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
This commit is contained in:
parent
c98c401dfb
commit
a29df56eab
1 changed files with 2 additions and 0 deletions
|
@ -382,6 +382,8 @@ int process_ra(struct ip6_hdr *ip6, int len)
|
|||
unsigned char type = 0;
|
||||
struct icmp6_ra_prefix_info *prefix = NULL;
|
||||
|
||||
if (len > ETH_MAX_MTU)
|
||||
return -EMSGSIZE;
|
||||
/* Ignore the packet if router lifetime is 0. */
|
||||
if (!icmp->icmp6_rt_lifetime)
|
||||
return -EOPNOTSUPP;
|
||||
|
|
Loading…
Reference in a new issue