mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 10:41:38 -04:00
net: fix skb_defer_rx_timestamp()
After commit c1f19b51d1 (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 <[email protected]>
Signed-off-by: Eric Dumazet <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
This commit is contained in:
parent
c710245caa
commit
a19faf0250
1 changed files with 4 additions and 2 deletions
|
|
@ -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:
|
||||
|
|
|
|||
Loading…
Reference in a new issue