Home Home > GIT Browse
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Bogendoerfer <tbogendoerfer@suse.de>2019-11-05 14:08:48 +0100
committerThomas Bogendoerfer <tbogendoerfer@suse.de>2019-11-05 14:10:09 +0100
commit9b9474a43427bd98f3bcdfdbf22a5fafcd08a34a (patch)
tree0b6ed7ff40bf8e9396269020981854df99c29ffe
parent06e4b77b7d828baf975159189e62afe0282903aa (diff)
net: cls_bpf: fix NULL deref on offload filter removal
(bsc#1154353).
-rw-r--r--patches.suse/net-cls_bpf-fix-NULL-deref-on-offload-filter-removal.patch44
-rw-r--r--series.conf1
2 files changed, 45 insertions, 0 deletions
diff --git a/patches.suse/net-cls_bpf-fix-NULL-deref-on-offload-filter-removal.patch b/patches.suse/net-cls_bpf-fix-NULL-deref-on-offload-filter-removal.patch
new file mode 100644
index 0000000000..837b3e4fc5
--- /dev/null
+++ b/patches.suse/net-cls_bpf-fix-NULL-deref-on-offload-filter-removal.patch
@@ -0,0 +1,44 @@
+From: Jakub Kicinski <jakub.kicinski@netronome.com>
+Date: Thu, 31 Oct 2019 20:06:59 -0700
+Subject: net: cls_bpf: fix NULL deref on offload filter removal
+Patch-mainline: v5.4-rc6
+Git-commit: 41aa29a58b5f7f7be43f35372ef411f304a87a0d
+References: bsc#1154353
+
+Commit 401192113730 ("net: sched: refactor block offloads counter
+usage") missed the fact that either new prog or old prog may be
+NULL.
+
+Fixes: 401192113730 ("net: sched: refactor block offloads counter usage")
+Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+Acked-by: Thomas Bogendoerfer <tbogendoerfer@suse.de>
+---
+ net/sched/cls_bpf.c | 8 ++++++--
+ 1 file changed, 6 insertions(+), 2 deletions(-)
+
+--- a/net/sched/cls_bpf.c
++++ b/net/sched/cls_bpf.c
+@@ -162,16 +162,20 @@ static int cls_bpf_offload_cmd(struct tc
+ cls_bpf.name = obj->bpf_name;
+ cls_bpf.exts_integrated = obj->exts_integrated;
+
+- if (oldprog)
++ if (oldprog && prog)
+ err = tc_setup_cb_replace(block, tp, TC_SETUP_CLSBPF, &cls_bpf,
+ skip_sw, &oldprog->gen_flags,
+ &oldprog->in_hw_count,
+ &prog->gen_flags, &prog->in_hw_count,
+ true);
+- else
++ else if (prog)
+ err = tc_setup_cb_add(block, tp, TC_SETUP_CLSBPF, &cls_bpf,
+ skip_sw, &prog->gen_flags,
+ &prog->in_hw_count, true);
++ else
++ err = tc_setup_cb_destroy(block, tp, TC_SETUP_CLSBPF, &cls_bpf,
++ skip_sw, &oldprog->gen_flags,
++ &oldprog->in_hw_count, true);
+
+ if (prog && err) {
+ cls_bpf_offload_cmd(tp, oldprog, prog, extack);
diff --git a/series.conf b/series.conf
index 9bc2b8b11a..8d645b36be 100644
--- a/series.conf
+++ b/series.conf
@@ -2898,6 +2898,7 @@
patches.suse/ixgbe-Remove-duplicate-clear_bit-call.patch
patches.suse/inet-stop-leaking-jiffies-on-the-wire.patch
patches.suse/net-phylink-Fix-phylink_dbg-macro.patch
+ patches.suse/net-cls_bpf-fix-NULL-deref-on-offload-filter-removal.patch
patches.suse/powerpc-powernv-Fix-CPU-idle-to-be-called-with-IRQs-.patch
patches.suse/scsi-qla2xxx-fixup-incorrect-usage-of-host_byte.patch
patches.suse/scsi-lpfc-Check-queue-pointer-before-use.patch