Patch "sch_cake: fix srchost/dsthost hashing mode" 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

    sch_cake: fix srchost/dsthost hashing mode

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:
     sch_cake-fix-srchost-dsthost-hashing-mode.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 e4203030e0fb590793570d76e039146e8a607cac
Author: Toke Høiland-Jørgensen <toke@xxxxxxxxxx>
Date:   Mon Aug 16 13:59:17 2021 +0200

    sch_cake: fix srchost/dsthost hashing mode
    
    [ Upstream commit 86b9bbd332d0510679c7fedcee3e3bd278be5756 ]
    
    When adding support for using the skb->hash value as the flow hash in CAKE,
    I accidentally introduced a logic error that broke the host-only isolation
    modes of CAKE (srchost and dsthost keywords). Specifically, the flow_hash
    variable should stay initialised to 0 in cake_hash() in pure host-based
    hashing mode. Add a check for this before using the skb->hash value as
    flow_hash.
    
    Fixes: b0c19ed6088a ("sch_cake: Take advantage of skb->hash where appropriate")
    Reported-by: Pete Heist <pete@xxxxxxxxxx>
    Tested-by: Pete Heist <pete@xxxxxxxxxx>
    Signed-off-by: Toke Høiland-Jørgensen <toke@xxxxxxxxxx>
    Signed-off-by: David S. Miller <davem@xxxxxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/net/sched/sch_cake.c b/net/sched/sch_cake.c
index 5c15968b5155..c2c37ffd94f2 100644
--- a/net/sched/sch_cake.c
+++ b/net/sched/sch_cake.c
@@ -720,7 +720,7 @@ static u32 cake_hash(struct cake_tin_data *q, const struct sk_buff *skb,
 skip_hash:
 	if (flow_override)
 		flow_hash = flow_override - 1;
-	else if (use_skbhash)
+	else if (use_skbhash && (flow_mode & CAKE_FLOW_FLOWS))
 		flow_hash = skb->hash;
 	if (host_override) {
 		dsthost_hash = host_override - 1;



[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