Patch "net_sched: check error pointer in tcf_dump_walker()" has been added to the 5.4-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_sched: check error pointer in tcf_dump_walker()

to the 5.4-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_sched-check-error-pointer-in-tcf_dump_walker.patch
and it can be found in the queue-5.4 subdirectory.

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



commit 29fab1449162184edd9029e4a1efc1f59f66b446
Author: Cong Wang <xiyou.wangcong@xxxxxxxxx>
Date:   Fri Oct 2 12:13:34 2020 -0700

    net_sched: check error pointer in tcf_dump_walker()
    
    [ Upstream commit 580e4273d7a883ececfefa692c1f96bdbacb99b5 ]
    
    Although we take RTNL on dump path, it is possible to
    skip RTNL on insertion path. So the following race condition
    is possible:
    
    rtnl_lock()             // no rtnl lock
                            mutex_lock(&idrinfo->lock);
                            // insert ERR_PTR(-EBUSY)
                            mutex_unlock(&idrinfo->lock);
    tc_dump_action()
    rtnl_unlock()
    
    So we have to skip those temporary -EBUSY entries on dump path
    too.
    
    Reported-and-tested-by: syzbot+b47bc4f247856fb4d9e1@xxxxxxxxxxxxxxxxxxxxxxxxx
    Fixes: 0fedc63fadf0 ("net_sched: commit action insertions together")
    Cc: Vlad Buslov <vladbu@xxxxxxxxxxxx>
    Cc: Jamal Hadi Salim <jhs@xxxxxxxxxxxx>
    Cc: Jiri Pirko <jiri@xxxxxxxxxxx>
    Signed-off-by: Cong Wang <xiyou.wangcong@xxxxxxxxx>
    Signed-off-by: David S. Miller <davem@xxxxxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/net/sched/act_api.c b/net/sched/act_api.c
index 17e5cd9ebd89..75132d0ca887 100644
--- a/net/sched/act_api.c
+++ b/net/sched/act_api.c
@@ -231,6 +231,8 @@ static int tcf_dump_walker(struct tcf_idrinfo *idrinfo, struct sk_buff *skb,
 		index++;
 		if (index < s_i)
 			continue;
+		if (IS_ERR(p))
+			continue;
 
 		if (jiffy_since &&
 		    time_after(jiffy_since,



[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