2018-04-11 18:42:03 +00:00
|
|
|
From 571a6cce3b0d4c8abf11efc320e2de6ff9188d60 Mon Sep 17 00:00:00 2001
|
2014-07-02 15:49:28 +00:00
|
|
|
From: Paulo Flabiano Smorigo <pfsmorigo@br.ibm.com>
|
|
|
|
Date: Wed, 5 Feb 2014 09:42:42 -0200
|
2018-07-02 12:42:57 +00:00
|
|
|
Subject: [PATCH 077/250] trim arp packets with abnormal size
|
2014-07-02 15:49:28 +00:00
|
|
|
|
|
|
|
GRUB uses arp request to create the arp response. If the incoming packet
|
|
|
|
is foobared, GRUB needs to trim the arp response packet before sending it.
|
|
|
|
---
|
|
|
|
grub-core/net/arp.c | 6 ++++++
|
|
|
|
1 file changed, 6 insertions(+)
|
|
|
|
|
|
|
|
diff --git a/grub-core/net/arp.c b/grub-core/net/arp.c
|
2018-03-15 19:05:59 +00:00
|
|
|
index 54306e3b16d..d1c69ed2b55 100644
|
2014-07-02 15:49:28 +00:00
|
|
|
--- a/grub-core/net/arp.c
|
|
|
|
+++ b/grub-core/net/arp.c
|
2017-06-16 19:31:32 +00:00
|
|
|
@@ -150,6 +150,12 @@ grub_net_arp_receive (struct grub_net_buff *nb, struct grub_net_card *card,
|
2014-07-02 15:49:28 +00:00
|
|
|
if (grub_net_addr_cmp (&inf->address, &target_addr) == 0
|
2015-07-22 13:44:51 +00:00
|
|
|
&& arp_packet->op == grub_cpu_to_be16_compile_time (ARP_REQUEST))
|
2014-07-02 15:49:28 +00:00
|
|
|
{
|
|
|
|
+ if ((nb->tail - nb->data) > 50)
|
|
|
|
+ {
|
2018-03-15 19:05:59 +00:00
|
|
|
+ grub_dprintf ("net", "arp packet with abnormal size (%ld bytes).\n",
|
2014-07-02 15:49:28 +00:00
|
|
|
+ nb->tail - nb->data);
|
|
|
|
+ nb->tail = nb->data + 50;
|
|
|
|
+ }
|
|
|
|
grub_net_link_level_address_t target;
|
2015-07-22 13:44:51 +00:00
|
|
|
struct grub_net_buff nb_reply;
|
|
|
|
struct arppkt *arp_reply;
|
2014-07-02 15:49:28 +00:00
|
|
|
--
|
2018-06-04 16:28:07 +00:00
|
|
|
2.17.1
|
2014-07-02 15:49:28 +00:00
|
|
|
|