public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Krzysztof Halasa <khc@pm.waw.pl>
To: Alexey Kuznetsov <kuznet@ms2.inr.ac.ru>
Cc: David Miller <davem@davemloft.net>, netdev@vger.kernel.org
Subject: Re: [PATCH] NET: fix kernel panic from no dev->hard_header_len space
Date: Wed, 02 Aug 2006 02:24:43 +0200	[thread overview]
Message-ID: <m37j1sc7ck.fsf@defiant.localdomain> (raw)
In-Reply-To: <20060801195431.GA29335@ms2.inr.ac.ru> (Alexey Kuznetsov's message of "Tue, 1 Aug 2006 23:54:31 +0400")

Hi,

Alexey Kuznetsov <kuznet@ms2.inr.ac.ru> writes:

> As I already said there is nothing wrong with the first chunk.
> Except that it hides the real problem.

The problem is already very well hidden :-) I have seen just two
reports of this problem since 1994, and I believe both of them
were related to a device without hard_header() (i.e., it probably
wouldn't show with the patch applied).
I have never seen this problem personally, and I've been using
FR for about 10 years (in 1-3 locations - though I think at first it
did use hard_header()).


How about the second part of the patch? I know the second part isn't
related to kernel panic but don't you think hard_header_len
should be treated uniformly across the tree (i.e., shouldn't depend
on hard_header() being non-NULL)?

If not, fine.

> Do not get it wrong. dev->hard_header_len is _NEVER_ guaranteed.
> The places, which allocate skb, take it as a hint to avoid reallocation.
> But each place which stuffs something at head, still must check the space.
>
> The only difference between the situation with dev->hard_header,
> is that when dev->hard_header != NULL, the header is added by IP itself.
> That's why IP checks it.

Do you mean IP calls hard_header() which, in turn, does skb_push()?

How about Ethernet - is it safe? There is hard_header() which blindly
adds 14 bytes.
-- 
Krzysztof Halasa

  reply	other threads:[~2006-08-02  0:24 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-07-27 13:56 [PATCH] NET: fix kernel panic from no dev->hard_header_len space Krzysztof Halasa
2006-07-27 16:43 ` Alexey Kuznetsov
2006-07-27 17:28   ` Krzysztof Halasa
2006-07-28 14:11     ` Krzysztof Halasa
2006-07-30 16:40   ` Krzysztof Halasa
2006-07-30 22:30     ` David Miller
2006-07-31 15:39       ` Alexey Kuznetsov
     [not found]         ` <m3r701zgku.fsf@defiant.localdomain>
2006-07-31 20:23           ` David Miller
2006-08-01  1:04             ` Krzysztof Halasa
2006-08-01  1:13               ` David Miller
2006-08-01  1:56                 ` Krzysztof Halasa
2006-08-01 19:54                   ` Alexey Kuznetsov
2006-08-02  0:24                     ` Krzysztof Halasa [this message]
2006-08-02  0:38                       ` David Miller
2006-08-02 21:11                         ` Krzysztof Halasa
2006-07-31 20:24           ` David Miller
2006-08-01 20:25     ` Alexey Kuznetsov
2006-08-02  0:42       ` Krzysztof Halasa
2006-08-02  0:48         ` David Miller

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=m37j1sc7ck.fsf@defiant.localdomain \
    --to=khc@pm.waw.pl \
    --cc=davem@davemloft.net \
    --cc=kuznet@ms2.inr.ac.ru \
    --cc=netdev@vger.kernel.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