Patch "net/sched: make psched_mtu() RTNL-less safe" 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

    net/sched: make psched_mtu() RTNL-less safe

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:
     net-sched-make-psched_mtu-rtnl-less-safe.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 138f6a37f75054e68b1ab8f84c79d3580fbbbba5
Author: Pedro Tammela <pctammela@xxxxxxxxxxxx>
Date:   Mon Jul 10 23:16:34 2023 -0300

    net/sched: make psched_mtu() RTNL-less safe
    
    [ Upstream commit 150e33e62c1fa4af5aaab02776b6c3812711d478 ]
    
    Eric Dumazet says[1]:
    -------
    Speaking of psched_mtu(), I see that net/sched/sch_pie.c is using it
    without holding RTNL, so dev->mtu can be changed underneath.
    KCSAN could issue a warning.
    -------
    
    Annotate dev->mtu with READ_ONCE() so KCSAN don't issue a warning.
    
    [1] https://lore.kernel.org/all/CANn89iJoJO5VtaJ-2=_d2aOQhb0Xw8iBT_Cxqp2HyuS-zj6azw@xxxxxxxxxxxxxx/
    
    v1 -> v2: Fix commit message
    
    Fixes: d4b36210c2e6 ("net: pkt_sched: PIE AQM scheme")
    Suggested-by: Eric Dumazet <edumazet@xxxxxxxxxx>
    Signed-off-by: Pedro Tammela <pctammela@xxxxxxxxxxxx>
    Reviewed-by: Simon Horman <simon.horman@xxxxxxxxxxxx>
    Link: https://lore.kernel.org/r/20230711021634.561598-1-pctammela@xxxxxxxxxxxx
    Signed-off-by: Jakub Kicinski <kuba@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/include/net/pkt_sched.h b/include/net/pkt_sched.h
index ba781e0aaf566..e186b2bd8c860 100644
--- a/include/net/pkt_sched.h
+++ b/include/net/pkt_sched.h
@@ -136,7 +136,7 @@ extern const struct nla_policy rtm_tca_policy[TCA_MAX + 1];
  */
 static inline unsigned int psched_mtu(const struct net_device *dev)
 {
-	return dev->mtu + dev->hard_header_len;
+	return READ_ONCE(dev->mtu) + dev->hard_header_len;
 }
 
 static inline struct net *qdisc_net(struct Qdisc *q)



[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