From: Eric Dumazet <eric.dumazet@gmail.com>
To: Changli Gao <xiaosuo@gmail.com>
Cc: netdev@vger.kernel.org,
Richard Cochran <richardcochran@gmail.com>,
Andrew Watts <akwatts@ymail.com>,
David Miller <davem@davemloft.net>,
stable@kernel.org
Subject: Re: kernel panic with time-stamping in phy devices (monitor mode)
Date: Mon, 06 Dec 2010 05:50:32 +0100 [thread overview]
Message-ID: <1291611032.2806.310.camel@edumazet-laptop> (raw)
In-Reply-To: <AANLkTinFEUd5vuBu98COXMRGMFcpwtu_dsw=_=cN6oZJ@mail.gmail.com>
Le lundi 06 décembre 2010 à 08:01 +0800, Changli Gao a écrit :
> How about using skb_headroom(skb) < ETH_HLEN ?
>
Yes, good idea, thanks !
[PATCH net-2.6] net: fix skb_defer_rx_timestamp()
After commit c1f19b51d1d8 (net: support time stamping in phy devices.),
kernel might crash if CONFIG_NETWORK_PHY_TIMESTAMPING=y and
skb_defer_rx_timestamp() handles a packet without an ethernet header.
Fixes kernel bugzilla #24102
Reference: https://bugzilla.kernel.org/show_bug.cgi?id=24102
Reported-and-tested-by: Andrew Watts <akwatts@ymail.com>
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Cc: Richard Cochran <richardcochran@gmail.com>
Cc: Changli Gao <xiaosuo@gmail.com>
Cc: stable@kernel.org
---
net/core/timestamping.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/net/core/timestamping.c b/net/core/timestamping.c
index 0ae6c22..c19bb4e 100644
--- a/net/core/timestamping.c
+++ b/net/core/timestamping.c
@@ -96,11 +96,13 @@ bool skb_defer_rx_timestamp(struct sk_buff *skb)
struct phy_device *phydev;
unsigned int type;
- skb_push(skb, ETH_HLEN);
+ if (skb_headroom(skb) < ETH_HLEN)
+ return false;
+ __skb_push(skb, ETH_HLEN);
type = classify(skb);
- skb_pull(skb, ETH_HLEN);
+ __skb_pull(skb, ETH_HLEN);
switch (type) {
case PTP_CLASS_V1_IPV4:
_______________________________________________
stable mailing list
stable@linux.kernel.org
http://linux.kernel.org/mailman/listinfo/stable
next prev parent reply other threads:[~2010-12-06 4:50 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-12-02 16:05 kernel panic with time-stamping in phy devices (monitor mode) Andrew Watts
2010-12-02 16:38 ` Eric Dumazet
2010-12-02 18:21 ` Andrew Watts
2010-12-04 7:57 ` Richard Cochran
2010-12-04 8:17 ` Eric Dumazet
2010-12-04 20:46 ` Andrew Watts
2010-12-05 12:24 ` Eric Dumazet
2010-12-06 0:01 ` Changli Gao
2010-12-06 4:50 ` Eric Dumazet [this message]
2010-12-11 0:18 ` 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=1291611032.2806.310.camel@edumazet-laptop \
--to=eric.dumazet@gmail.com \
--cc=akwatts@ymail.com \
--cc=davem@davemloft.net \
--cc=netdev@vger.kernel.org \
--cc=richardcochran@gmail.com \
--cc=stable@kernel.org \
--cc=xiaosuo@gmail.com \
/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