From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1W9IWj-0002Gi-K1 for mharc-grub-devel@gnu.org; Fri, 31 Jan 2014 13:09:17 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40351) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W9IWZ-00029x-5X for grub-devel@gnu.org; Fri, 31 Jan 2014 13:09:15 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1W9IWQ-0005XP-Ih for grub-devel@gnu.org; Fri, 31 Jan 2014 13:09:07 -0500 Received: from mail-ea0-x22f.google.com ([2a00:1450:4013:c01::22f]:43270) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W9IWQ-0005XI-BZ for grub-devel@gnu.org; Fri, 31 Jan 2014 13:08:58 -0500 Received: by mail-ea0-f175.google.com with SMTP id z10so2488985ead.6 for ; Fri, 31 Jan 2014 10:08:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type; bh=Z74+KgKXWJ7zD4TvmMIRT3fUGGZwHYtNiJ6HipjG5mg=; b=kvhFRS1elOIpKnl5Csk0ODDcBIAzNZquus8ssERdWWCzojYY6eoK3+T44dDcBQyEdx cDF6eP+EU/hvGeA46YakdwwaL4Pbj4xWongWdQvOzRzZO881J43XaG6cZ8HXcfgEQ6Di BFHmUUNb/GDrtyOm2rJxT30Sku+RiAkd+eUnAmZkGhnBOJ0NFwxyuficz1Ak8B8Ikqnl xslSirJVxoP2n3Ah3Ajb9gwoMbIr+Tdbct6gFXZeWtLDFTX/S9oNJr+w2g02DLfuHE42 DXhtbLYMJbBvlm5m2Orh++BZcwuzJRdrcX4dmYaiiQlm00qeV5JKz4QzQEv9Y32ToEFh UneA== X-Received: by 10.14.175.131 with SMTP id z3mr6550827eel.65.1391191737245; Fri, 31 Jan 2014 10:08:57 -0800 (PST) Received: from [10.59.59.49] (cable-85.28.108.35.coditel.net. [85.28.108.35]) by mx.google.com with ESMTPSA id w4sm39953688eef.20.2014.01.31.10.08.55 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 31 Jan 2014 10:08:56 -0800 (PST) Message-ID: <52EBE6B6.7030609@gmail.com> Date: Fri, 31 Jan 2014 19:08:54 +0100 From: =?UTF-8?B?VmxhZGltaXIgJ8+GLWNvZGVyL3BoY29kZXInIFNlcmJpbmVua28=?= User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Icedove/24.2.0 MIME-Version: 1.0 To: The development of GNU GRUB Subject: Re: [PATCH] grub-core/net/arp.c: trim arp packets with abnormal size. References: <20140131153509.GA26154@beren.br.ibm.com> In-Reply-To: <20140131153509.GA26154@beren.br.ibm.com> X-Enigmail-Version: 1.6 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="w3id6qnR0Jep150wO6XJVnBR11gKRT2qh" X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:4013:c01::22f X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: The development of GNU GRUB List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Jan 2014 18:09:15 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --w3id6qnR0Jep150wO6XJVnBR11gKRT2qh Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 31.01.2014 16:35, Paulo Flabiano Smorigo wrote: > * grub-core/net/arp.c (grub_net_arp_receive): Trim arp packets with abn= ormal size. >=20 > GRUB uses arp request to create the arp response. If the incoming packe= t is > foobared, GRUB needs to trim the arp response packet before sending it.= >=20 > This is just a fix in time for 2.02. I'm planning to rewrite the arp re= sponse code > after the release. >=20 > diff --git a/ChangeLog b/ChangeLog > index cfa9c83..10e9c3d 100644 > --- a/ChangeLog > +++ b/ChangeLog > @@ -1,3 +1,11 @@ > +2014-01-31 Paulo Flabiano Smorigo > + > + * 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 pac= ket is > + foobared, GRUB needs to trim the arp response packet before sending i= t. > + > 2014-01-29 Vladimir Serbinenko > =20 > * 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) =3D=3D 0 > && grub_be_to_cpu16 (arp_header->op) =3D=3D ARP_REQUEST) > { > + if ((nb->tail - nb->data) > 50) > + { > + grub_dprintf ("net", "arp packet with abnormal size (%ld b= ytes).\n", > + nb->tail - nb->data); > + nb->tail =3D nb->data + 50; > + } This is not right solution, I already commented on it. Instead you need to recompute arp length from its fields. > grub_net_link_level_address_t target; > /* We've already checked that pln is either 4 or 16. */ > char tmp[16]; >=20 --w3id6qnR0Jep150wO6XJVnBR11gKRT2qh Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 Comment: Using GnuPG with Icedove - http://www.enigmail.net/ iF4EAREKAAYFAlLr5rYACgkQmBXlbbo5nOsMAQEAnmXEqyjCRPgfDeH8OseWHHQX ApbYvDU/lYqluvTD87QA/RHVigkTsFS0GyNuRWF0YhPh/mrAFExRgtIyAorRzVBc =EKAT -----END PGP SIGNATURE----- --w3id6qnR0Jep150wO6XJVnBR11gKRT2qh--