public inbox for
 help / color / mirror / Atom feed
From: Bernd Edlinger <>
To: "Lambrecht Jürgen" <>,
	"" <>
Subject: RE: RFC: bsd_tcp patch on in.c
Date: Thu, 27 Jun 2013 13:43:00 -0000	[thread overview]
Message-ID: <DUB124-W1028E3B25B46E43F0508BCE4750@phx.gbl> (raw)
In-Reply-To: <>

Hi Jürgen,

> The patch below we already use since 2006.
> We had problems with the TCP/IP stack directly after booting because it
> already received packets before being initialized completely.
> Here our CVS log:
> move
> splx(s);
> from line 682 to line 739
> so that tcp/ip stack has started up before the ethernet driver is released
> (else the not-ready stack will already receive packets)
> Do you agree this is a valid patch?

that is hard to tell - probably it is not necessary to lock anything here,
especially because the in_control() does many things
with the  in_ifaddrhead list, without any lock. It just locks when it
adds/removes entries from that list, which is really the bare minimum.

I had similar problems however: an ICMP packet arriving while there
was zero interface addresses registered. => NULL pointer access in sys/netinet/ip_icmp.c
see the hunk at ip_icmp.c, lines 651-656. This means that the packet may
arrive well before in_ifinit is called. Even before line 293 of in.c enters the address to the list:
this place is locked with splnet however.

That null pointer access became only apparent after I changed the MMU to exclude page zero,
because usually the arm processor would silently allow read accesses to the ISR table.

See my patch at for details
on  "MMU: added Access Protection against NULL-Pointer accesses".
Before I had invented that patch it was really hard to find such hideous bugs.

Bernd Edlinger 		 	   		  

      reply	other threads:[~2013-06-27 13:43 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-27 11:24 Lambrecht Jürgen
2013-06-27 13:43 ` Bernd Edlinger [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:

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

  git send-email \
    --in-reply-to=DUB124-W1028E3B25B46E43F0508BCE4750@phx.gbl \ \ \ \

* 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 read-only IMAP folder(s) and NNTP newsgroup(s).