ndisc: Check NS message length before access.
Check message length before accessing "target" field, as we do for other types. Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Родитель
12fd84f438
Коммит
115b0aa6b4
|
@ -671,6 +671,11 @@ static void ndisc_recv_ns(struct sk_buff *skb)
|
||||||
bool inc;
|
bool inc;
|
||||||
int is_router = -1;
|
int is_router = -1;
|
||||||
|
|
||||||
|
if (skb->len < sizeof(struct nd_msg)) {
|
||||||
|
ND_PRINTK(2, warn, "NS: packet too short\n");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (ipv6_addr_is_multicast(&msg->target)) {
|
if (ipv6_addr_is_multicast(&msg->target)) {
|
||||||
ND_PRINTK(2, warn, "NS: multicast target address\n");
|
ND_PRINTK(2, warn, "NS: multicast target address\n");
|
||||||
return;
|
return;
|
||||||
|
|
Загрузка…
Ссылка в новой задаче