Patch "net: hsr: Use correct offset for HSR TLV values in supervisory HSR frames" 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: Use correct offset for HSR TLV values in supervisory HSR frames

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-use-correct-offset-for-hsr-tlv-values-in-sup.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 47e683e31b3cac783c1ed484d805a1de35005878
Author: Lukasz Majewski <lukma@xxxxxxx>
Date:   Wed Feb 28 09:56:44 2024 +0100

    net: hsr: Use correct offset for HSR TLV values in supervisory HSR frames
    
    [ Upstream commit 51dd4ee0372228ffb0f7709fa7aa0678d4199d06 ]
    
    Current HSR implementation uses following supervisory frame (even for
    HSRv1 the HSR tag is not is not present):
    
    00000000: 01 15 4e 00 01 2d XX YY ZZ 94 77 10 88 fb 00 01
    00000010: 7e 1c 17 06 XX YY ZZ 94 77 10 1e 06 XX YY ZZ 94
    00000020: 77 10 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    00000030: 00 00 00 00 00 00 00 00 00 00 00 00
    
    The current code adds extra two bytes (i.e. sizeof(struct hsr_sup_tlv))
    when offset for skb_pull() is calculated.
    This is wrong, as both 'struct hsrv1_ethhdr_sp' and 'hsrv0_ethhdr_sp'
    already have 'struct hsr_sup_tag' defined in them, so there is no need
    for adding extra two bytes.
    
    This code was working correctly as with no RedBox support, the check for
    HSR_TLV_EOT (0x00) was off by two bytes, which were corresponding to
    zeroed padded bytes for minimal packet size.
    
    Fixes: eafaa88b3eb7 ("net: hsr: Add support for redbox supervision frames")
    Signed-off-by: Lukasz Majewski <lukma@xxxxxxx>
    Reviewed-by: Jiri Pirko <jiri@xxxxxxxxxx>
    Link: https://lore.kernel.org/r/20240228085644.3618044-1-lukma@xxxxxxx
    Signed-off-by: Paolo Abeni <pabeni@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/net/hsr/hsr_forward.c b/net/hsr/hsr_forward.c
index 80cdc6f6b34c9..0323ab5023c69 100644
--- a/net/hsr/hsr_forward.c
+++ b/net/hsr/hsr_forward.c
@@ -83,7 +83,7 @@ static bool is_supervision_frame(struct hsr_priv *hsr, struct sk_buff *skb)
 		return false;
 
 	/* Get next tlv */
-	total_length += sizeof(struct hsr_sup_tlv) + hsr_sup_tag->tlv.HSR_TLV_length;
+	total_length += hsr_sup_tag->tlv.HSR_TLV_length;
 	if (!pskb_may_pull(skb, total_length))
 		return false;
 	skb_pull(skb, total_length);




[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