grub2/0015-trim-arp-packets-with-abnormal-size.patch
Peter Jones 35f33eadc0 Two bug fixes...
- Revert TPM patches, they break some x86 platforms and ppc64
  Resolves: rhbz#1334075
  Resolves: rhbz#1334672
- Chainloading on EFI doesn't work with some bootloaders
  Resolves: rhbz#1320273

Signed-off-by: Peter Jones <pjones@redhat.com>
2016-06-09 15:56:36 -04:00

31 lines
1.1 KiB
Diff

From a6f4624278357f853e3e8888e538eb0ef3654556 Mon Sep 17 00:00:00 2001
From: Paulo Flabiano Smorigo <pfsmorigo@br.ibm.com>
Date: Wed, 5 Feb 2014 09:42:42 -0200
Subject: [PATCH 15/80] trim arp packets with abnormal size
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
index 4b68c41..f7c59d3 100644
--- a/grub-core/net/arp.c
+++ b/grub-core/net/arp.c
@@ -142,6 +142,12 @@ grub_net_arp_receive (struct grub_net_buff *nb,
if (grub_net_addr_cmp (&inf->address, &target_addr) == 0
&& arp_packet->op == grub_cpu_to_be16_compile_time (ARP_REQUEST))
{
+ if ((nb->tail - nb->data) > 50)
+ {
+ grub_dprintf ("net", "arp packet with abnormal size (%ld bytes).\n",
+ nb->tail - nb->data);
+ nb->tail = nb->data + 50;
+ }
grub_net_link_level_address_t target;
struct grub_net_buff nb_reply;
struct arppkt *arp_reply;
--
2.7.4