Patch "flow_dissector: fix byteorder of dissected ICMP ID" has been added to the 5.10-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

    flow_dissector: fix byteorder of dissected ICMP ID

to the 5.10-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:
     flow_dissector-fix-byteorder-of-dissected-icmp-id.patch
and it can be found in the queue-5.10 subdirectory.

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



commit 92b0ec51f9f6e8bc349b12db36c050fd364de983
Author: Alexander Lobakin <alobakin@xxxxx>
Date:   Fri Mar 12 20:08:57 2021 +0000

    flow_dissector: fix byteorder of dissected ICMP ID
    
    [ Upstream commit a25f822285420486f5da434efc8d940d42a83bce ]
    
    flow_dissector_key_icmp::id is of type u16 (CPU byteorder),
    ICMP header has its ID field in network byteorder obviously.
    Sparse says:
    
    net/core/flow_dissector.c:178:43: warning: restricted __be16 degrades to integer
    
    Convert ID value to CPU byteorder when storing it into
    flow_dissector_key_icmp.
    
    Fixes: 5dec597e5cd0 ("flow_dissector: extract more ICMP information")
    Signed-off-by: Alexander Lobakin <alobakin@xxxxx>
    Signed-off-by: David S. Miller <davem@xxxxxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/net/core/flow_dissector.c b/net/core/flow_dissector.c
index e21950a2c897..c79be25b2e0c 100644
--- a/net/core/flow_dissector.c
+++ b/net/core/flow_dissector.c
@@ -175,7 +175,7 @@ void skb_flow_get_icmp_tci(const struct sk_buff *skb,
 	 * avoid confusion with packets without such field
 	 */
 	if (icmp_has_id(ih->type))
-		key_icmp->id = ih->un.echo.id ? : 1;
+		key_icmp->id = ih->un.echo.id ? ntohs(ih->un.echo.id) : 1;
 	else
 		key_icmp->id = 0;
 }



[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