From: Krzysztof Halasa <khc@pm.waw.pl>
To: <netdev@vger.kernel.org>
Cc: David Miller <davem@davemloft.net>
Subject: [PATCH] NET: fix kernel panic from no dev->hard_header_len space
Date: Thu, 27 Jul 2006 15:56:40 +0200 [thread overview]
Message-ID: <m3zmevqhgn.fsf@defiant.localdomain> (raw)
Hi,
ip_output() ignores dev->hard_header_len if dev->hard_header
function == NULL. It's inconsistent with the rest of the kernel. With
some drivers it would mean instant panic, but we are usually saved by
existence of the "default" header space.
With some bad luck things like tun or IPsec may kill the box.
A similar problem may be present in psched_mtu().
Please apply.
I think it should then be applied to stable series as well.
Signed-off-by: Krzysztof Halasa <khc@pm.waw.pl>
diff --git a/include/net/pkt_sched.h b/include/net/pkt_sched.h
index b94d1ad..3ae64ba 100644
--- a/include/net/pkt_sched.h
+++ b/include/net/pkt_sched.h
@@ -234,8 +234,7 @@ extern int tc_classify(struct sk_buff *s
*/
static inline unsigned psched_mtu(struct net_device *dev)
{
- unsigned mtu = dev->mtu;
- return dev->hard_header ? mtu + dev->hard_header_len : mtu;
+ return dev->mtu + dev->hard_header_len;
}
#endif
diff --git a/net/ipv4/ip_output.c b/net/ipv4/ip_output.c
index cff9c3a..f5d9051 100644
--- a/net/ipv4/ip_output.c
+++ b/net/ipv4/ip_output.c
@@ -169,7 +169,7 @@ static inline int ip_finish_output2(stru
int hh_len = LL_RESERVED_SPACE(dev);
/* Be paranoid, rather than too clever. */
- if (unlikely(skb_headroom(skb) < hh_len && dev->hard_header)) {
+ if (unlikely(skb_headroom(skb) < hh_len)) {
struct sk_buff *skb2;
skb2 = skb_realloc_headroom(skb, LL_RESERVED_SPACE(dev));
next reply other threads:[~2006-07-27 13:56 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-07-27 13:56 Krzysztof Halasa [this message]
2006-07-27 16:43 ` [PATCH] NET: fix kernel panic from no dev->hard_header_len space 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
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=m3zmevqhgn.fsf@defiant.localdomain \
--to=khc@pm.waw.pl \
--cc=davem@davemloft.net \
--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