Patch "net: hsr: fix hsr_init_sk() vs network/transport headers." has been added to the 6.1-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    net: hsr: fix hsr_init_sk() vs network/transport headers.

to the 6.1-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     net-hsr-fix-hsr_init_sk-vs-network-transport-headers.patch
and it can be found in the queue-6.1 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit f4adb82150884382816fec149634bfcc54c4907c
Author: Eric Dumazet <edumazet@xxxxxxxxxx>
Date:   Fri Nov 22 17:13:43 2024 +0000

    net: hsr: fix hsr_init_sk() vs network/transport headers.
    
    [ Upstream commit 9cfb5e7f0ded2bfaabc270ceb5f91d13f0e805b9 ]
    
    Following sequence in hsr_init_sk() is invalid :
    
        skb_reset_mac_header(skb);
        skb_reset_mac_len(skb);
        skb_reset_network_header(skb);
        skb_reset_transport_header(skb);
    
    It is invalid because skb_reset_mac_len() needs the correct
    network header, which should be after the mac header.
    
    This patch moves the skb_reset_network_header()
    and skb_reset_transport_header() before
    the call to dev_hard_header().
    
    As a result skb->mac_len is no longer set to a value
    close to 65535.
    
    Fixes: 48b491a5cc74 ("net: hsr: fix mac_len checks")
    Signed-off-by: Eric Dumazet <edumazet@xxxxxxxxxx>
    Cc: George McCollister <george.mccollister@xxxxxxxxx>
    Link: https://patch.msgid.link/20241122171343.897551-1-edumazet@xxxxxxxxxx
    Signed-off-by: Paolo Abeni <pabeni@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/net/hsr/hsr_device.c b/net/hsr/hsr_device.c
index ad75724b69adf..6e434af189bc0 100644
--- a/net/hsr/hsr_device.c
+++ b/net/hsr/hsr_device.c
@@ -253,6 +253,8 @@ static struct sk_buff *hsr_init_skb(struct hsr_port *master)
 	skb->dev = master->dev;
 	skb->priority = TC_PRIO_CONTROL;
 
+	skb_reset_network_header(skb);
+	skb_reset_transport_header(skb);
 	if (dev_hard_header(skb, skb->dev, ETH_P_PRP,
 			    hsr->sup_multicast_addr,
 			    skb->dev->dev_addr, skb->len) <= 0)
@@ -260,8 +262,6 @@ static struct sk_buff *hsr_init_skb(struct hsr_port *master)
 
 	skb_reset_mac_header(skb);
 	skb_reset_mac_len(skb);
-	skb_reset_network_header(skb);
-	skb_reset_transport_header(skb);
 
 	return skb;
 out:




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux