Re: [PATCH] NET: fix kernel panic from no dev->hard_header_len space

Alexey Kuznetsov
2006-08-01T19:55:05Z

Hello!

> > Alexey, any suggestions on how to handle this kind of thing?

Device, which adds something at head must check for space.
Anyone, who adds something at head, must check.
Otherwise, it will remain buggy forever.

> What's wrong with my patch?

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

> hardly their author's fault. I don't think we've ever advertised
> "hard_header_len is valid only with non-NULL hard_header".

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.

Alexey