44 lines
1.4 KiB
Diff
44 lines
1.4 KiB
Diff
From: Matthias Schiffer <mschiffer@universe-factory.net>
|
|
Date: Mon, 27 Nov 2017 16:39:51 +0100
|
|
Subject: mac80211: fq_impl: Properly enforce memory limit
|
|
|
|
diff --git a/package/kernel/mac80211/patches/095-fq_impl-Properly-enforce-memory-limit.patch b/package/kernel/mac80211/patches/095-fq_impl-Properly-enforce-memory-limit.patch
|
|
new file mode 100644
|
|
index 0000000000000000000000000000000000000000..83b5c259195a121909dae70992d199987c8b262c
|
|
--- /dev/null
|
|
+++ b/package/kernel/mac80211/patches/095-fq_impl-Properly-enforce-memory-limit.patch
|
|
@@ -0,0 +1,33 @@
|
|
+--- a/include/net/fq_impl.h
|
|
++++ b/include/net/fq_impl.h
|
|
+@@ -146,6 +146,7 @@ static void fq_tin_enqueue(struct fq *fq
|
|
+ fq_flow_get_default_t get_default_func)
|
|
+ {
|
|
+ struct fq_flow *flow;
|
|
++ bool oom;
|
|
+
|
|
+ lockdep_assert_held(&fq->lock);
|
|
+
|
|
+@@ -167,8 +168,8 @@ static void fq_tin_enqueue(struct fq *fq
|
|
+ }
|
|
+
|
|
+ __skb_queue_tail(&flow->queue, skb);
|
|
+-
|
|
+- if (fq->backlog > fq->limit || fq->memory_usage > fq->memory_limit) {
|
|
++ oom = (fq->memory_usage > fq->memory_limit);
|
|
++ while (fq->backlog > fq->limit || oom) {
|
|
+ flow = list_first_entry_or_null(&fq->backlogs,
|
|
+ struct fq_flow,
|
|
+ backlogchain);
|
|
+@@ -183,8 +184,10 @@ static void fq_tin_enqueue(struct fq *fq
|
|
+
|
|
+ flow->tin->overlimit++;
|
|
+ fq->overlimit++;
|
|
+- if (fq->memory_usage > fq->memory_limit)
|
|
++ if (oom) {
|
|
+ fq->overmemory++;
|
|
++ oom = (fq->memory_usage > fq->memory_limit);
|
|
++ }
|
|
+ }
|
|
+ }
|
|
+
|