From e0397ea5bbba6772f49be1e6afde0e6a332da3f1 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Tue, 23 Jun 2020 19:45:25 +0200 Subject: [PATCH] 4.4-stable patches added patches: net-revert-pkt_sched-fq-use-proper-locking-in-fq_dump_stats.patch --- ...-use-proper-locking-in-fq_dump_stats.patch | 65 +++++++++++++++++++ queue-4.4/series | 1 + 2 files changed, 66 insertions(+) create mode 100644 queue-4.4/net-revert-pkt_sched-fq-use-proper-locking-in-fq_dump_stats.patch diff --git a/queue-4.4/net-revert-pkt_sched-fq-use-proper-locking-in-fq_dump_stats.patch b/queue-4.4/net-revert-pkt_sched-fq-use-proper-locking-in-fq_dump_stats.patch new file mode 100644 index 00000000000..5c32829a3bf --- /dev/null +++ b/queue-4.4/net-revert-pkt_sched-fq-use-proper-locking-in-fq_dump_stats.patch @@ -0,0 +1,65 @@ +From toke@redhat.com Tue Jun 23 19:43:53 2020 +From: "Toke Høiland-Jørgensen" +Date: Tue, 23 Jun 2020 17:00:53 +0200 +Subject: [PATCH 4.4] net: Revert "pkt_sched: fq: use proper locking in fq_dump_stats()" +To: stable@vger.kernel.org, gregkh@linuxfoundation.org +Cc: "Toke Høiland-Jørgensen" , "Eric Dumazet" , "David S . Miller" +Message-ID: <20200623150053.272985-1-toke@redhat.com> + +From: "Toke Høiland-Jørgensen" + +This reverts commit 191cf872190de28a92e1bd2b56d8860e37e07443 which is +commit 695b4ec0f0a9cf29deabd3ac075911d58b31f42b upstream. + +That commit should never have been backported since it relies on a change in +locking semantics that was introduced in v4.8 and not backported. Because of +this, the backported commit to sch_fq leads to lockups because of the double +locking. + +Signed-off-by: Toke Høiland-Jørgensen +Signed-off-by: Greg Kroah-Hartman +--- + net/sched/sch_fq.c | 32 ++++++++++++++------------------ + 1 file changed, 14 insertions(+), 18 deletions(-) + +--- a/net/sched/sch_fq.c ++++ b/net/sched/sch_fq.c +@@ -830,24 +830,20 @@ nla_put_failure: + static int fq_dump_stats(struct Qdisc *sch, struct gnet_dump *d) + { + struct fq_sched_data *q = qdisc_priv(sch); +- struct tc_fq_qd_stats st; +- +- sch_tree_lock(sch); +- +- st.gc_flows = q->stat_gc_flows; +- st.highprio_packets = q->stat_internal_packets; +- st.tcp_retrans = q->stat_tcp_retrans; +- st.throttled = q->stat_throttled; +- st.flows_plimit = q->stat_flows_plimit; +- st.pkts_too_long = q->stat_pkts_too_long; +- st.allocation_errors = q->stat_allocation_errors; +- st.time_next_delayed_flow = q->time_next_delayed_flow - ktime_get_ns(); +- st.flows = q->flows; +- st.inactive_flows = q->inactive_flows; +- st.throttled_flows = q->throttled_flows; +- st.pad = 0; +- +- sch_tree_unlock(sch); ++ u64 now = ktime_get_ns(); ++ struct tc_fq_qd_stats st = { ++ .gc_flows = q->stat_gc_flows, ++ .highprio_packets = q->stat_internal_packets, ++ .tcp_retrans = q->stat_tcp_retrans, ++ .throttled = q->stat_throttled, ++ .flows_plimit = q->stat_flows_plimit, ++ .pkts_too_long = q->stat_pkts_too_long, ++ .allocation_errors = q->stat_allocation_errors, ++ .flows = q->flows, ++ .inactive_flows = q->inactive_flows, ++ .throttled_flows = q->throttled_flows, ++ .time_next_delayed_flow = q->time_next_delayed_flow - now, ++ }; + + return gnet_stats_copy_app(d, &st, sizeof(st)); + } diff --git a/queue-4.4/series b/queue-4.4/series index aad52fdc1c8..a04ce3602e0 100644 --- a/queue-4.4/series +++ b/queue-4.4/series @@ -76,3 +76,4 @@ kretprobe-prevent-triggering-kretprobe-from-within-k.patch e1000e-do-not-wake-up-the-system-via-wol-if-device-w.patch sched-rt-net-use-config_preemption.patch.patch net-core-device_rename-use-rwsem-instead-of-a-seqcou.patch +net-revert-pkt_sched-fq-use-proper-locking-in-fq_dump_stats.patch -- 2.47.3