From: Jan Kiszka <jan.kiszka@siemens.com>
To: Nickolai Zeldovich <nickolai@csail.mit.edu>
Cc: "qemu-devel@nongnu.org" <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] [PATCH] slirp: Don't crash on packets from 0.0.0.0/8.
Date: Mon, 12 Nov 2012 17:24:16 +0100 [thread overview]
Message-ID: <50A122B0.7000701@siemens.com> (raw)
In-Reply-To: <CADGQE7EwKVAb+F94wd-aj-JXp7QLUqK3ryfACXbQiTHZJzxJwA@mail.gmail.com>
On 2012-11-12 15:41, Nickolai Zeldovich wrote:
> On Mon, Nov 12, 2012 at 4:37 AM, Jan Kiszka <jan.kiszka@siemens.com> wrote:
>> On 2012-11-12 01:59, Nickolai Zeldovich wrote:
>>> LWIP can generate packets with a source of 0.0.0.0, which triggers an
>>> assertion failure in arp_table_add(). Instead of crashing, simply return
>>> to avoid adding an invalid ARP table entry.
>>
>> I would prefer to filter out such invalid packets at a different level.
>> Did you analyzed which path it takes through the stack?
>
> The particular packet that crashed qemu for me was a gratuitous ARP,
> though it looks like all three calls to arp_table_add() in arp_input()
> can trigger this.
>
> Popping up one level, I'm not sure why arp_table_add() and
> arp_table_search() need a special case for 0.0.0.0/8 in the first
> place. I couldn't find any other code that assumes the ARP table
> cannot contain 0.0.0.0/8 entries. Would anything break if the check
> for 0.0.0.0/8 was removed from arp_table_add() and arp_table_search()
> altogether?
0.0.0.0/8 are source-only, invalid as destination. So they have no place
in the ARP table.
OK, let's follow your path and filter them in arp_table_add. Just add
the missing braces and resend.
Jan
--
Siemens AG, Corporate Technology, CT RTC ITP SDP-DE
Corporate Competence Center Embedded Linux
prev parent reply other threads:[~2012-11-12 16:24 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-11-12 0:59 [Qemu-devel] [PATCH] slirp: Don't crash on packets from 0.0.0.0/8 Nickolai Zeldovich
2012-11-12 9:37 ` Jan Kiszka
2012-11-12 14:41 ` Nickolai Zeldovich
2012-11-12 16:24 ` Jan Kiszka [this message]
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=50A122B0.7000701@siemens.com \
--to=jan.kiszka@siemens.com \
--cc=nickolai@csail.mit.edu \
--cc=qemu-devel@nongnu.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).