All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrey Borzenkov <arvidjaar@gmail.com>
To: The development of GNU GRUB <grub-devel@gnu.org>
Cc: pfsmorigo@linux.vnet.ibm.com
Subject: Re: [PATCH] grub-core/net/arp.c: trim arp packets with abnormal size.
Date: Fri, 31 Jan 2014 20:02:07 +0400	[thread overview]
Message-ID: <20140131200207.29a96bbc@opensuse.site> (raw)
In-Reply-To: <20140131153509.GA26154@beren.br.ibm.com>

В Fri, 31 Jan 2014 13:35:11 -0200
Paulo Flabiano Smorigo <pfsmorigo@linux.vnet.ibm.com> пишет:

> * grub-core/net/arp.c (grub_net_arp_receive): 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.
> 
> This is just a fix in time for 2.02. I'm planning to rewrite the arp response code
> after the release.
> 
> diff --git a/ChangeLog b/ChangeLog
> index cfa9c83..10e9c3d 100644
> --- a/ChangeLog
> +++ b/ChangeLog
> @@ -1,3 +1,11 @@
> +2014-01-31  Paulo Flabiano Smorigo  <pfsmorigo@br.ibm.com>
> +
> +	* grub-core/net/arp.c (grub_net_arp_receive): 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.
> +
>  2014-01-29  Vladimir Serbinenko  <phcoder@gmail.com>
>  
>  	* grub-core/disk/ahci.c: Increase timeout. Some SSDs take up to
> diff --git a/grub-core/net/arp.c b/grub-core/net/arp.c
> index d62d0cc..77581f4 100644
> --- a/grub-core/net/arp.c
> +++ b/grub-core/net/arp.c
> @@ -162,6 +162,12 @@ grub_net_arp_receive (struct grub_net_buff *nb,
>      if (grub_net_addr_cmp (&inf->address, &target_addr) == 0
>  	&& grub_be_to_cpu16 (arp_header->op) == ARP_REQUEST)
>        {
> +        if ((nb->tail - nb->data) > 50)

Using large ping size is quite common during network troubleshooting.
This looks like rather arbitrary restriction. I'd say - if we were able
to receive packet we should be able to also send packet of the same
size; what problem does it fix?

> +          {
> +            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;
>  	/* We've already checked that pln is either 4 or 16.  */
>  	char tmp[16];
> 



  reply	other threads:[~2014-01-31 16:02 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-31 15:35 [PATCH] grub-core/net/arp.c: trim arp packets with abnormal size Paulo Flabiano Smorigo
2014-01-31 16:02 ` Andrey Borzenkov [this message]
2014-01-31 18:07   ` Paulo Flabiano Smorigo
2014-01-31 18:09   ` Vladimir 'φ-coder/phcoder' Serbinenko
2014-01-31 18:08 ` Vladimir 'φ-coder/phcoder' Serbinenko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140131200207.29a96bbc@opensuse.site \
    --to=arvidjaar@gmail.com \
    --cc=grub-devel@gnu.org \
    --cc=pfsmorigo@linux.vnet.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.