]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
5.4-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 15 May 2020 09:19:02 +0000 (11:19 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 15 May 2020 09:19:02 +0000 (11:19 +0200)
added patches:
scsi-sg-add-sg_remove_request-in-sg_write.patch
selftests-bpf-fix-goto-cleanup-label-not-defined.patch

queue-5.4/scsi-sg-add-sg_remove_request-in-sg_write.patch [new file with mode: 0644]
queue-5.4/selftests-bpf-fix-goto-cleanup-label-not-defined.patch [new file with mode: 0644]
queue-5.4/series

diff --git a/queue-5.4/scsi-sg-add-sg_remove_request-in-sg_write.patch b/queue-5.4/scsi-sg-add-sg_remove_request-in-sg_write.patch
new file mode 100644 (file)
index 0000000..64f1169
--- /dev/null
@@ -0,0 +1,39 @@
+From 83c6f2390040f188cc25b270b4befeb5628c1aee Mon Sep 17 00:00:00 2001
+From: Wu Bo <wubo40@huawei.com>
+Date: Tue, 14 Apr 2020 10:13:28 +0800
+Subject: scsi: sg: add sg_remove_request in sg_write
+
+From: Wu Bo <wubo40@huawei.com>
+
+commit 83c6f2390040f188cc25b270b4befeb5628c1aee upstream.
+
+If the __copy_from_user function failed we need to call sg_remove_request
+in sg_write.
+
+Link: https://lore.kernel.org/r/610618d9-e983-fd56-ed0f-639428343af7@huawei.com
+Acked-by: Douglas Gilbert <dgilbert@interlog.com>
+Signed-off-by: Wu Bo <wubo40@huawei.com>
+Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+[groeck: Backport to v5.4.y and older kernels]
+Signed-off-by: Guenter Roeck <linux@roeck-us.net>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/scsi/sg.c |    4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+--- a/drivers/scsi/sg.c
++++ b/drivers/scsi/sg.c
+@@ -689,8 +689,10 @@ sg_write(struct file *filp, const char _
+       hp->flags = input_size; /* structure abuse ... */
+       hp->pack_id = old_hdr.pack_id;
+       hp->usr_ptr = NULL;
+-      if (__copy_from_user(cmnd, buf, cmd_size))
++      if (__copy_from_user(cmnd, buf, cmd_size)) {
++              sg_remove_request(sfp, srp);
+               return -EFAULT;
++      }
+       /*
+        * SG_DXFER_TO_FROM_DEV is functionally equivalent to SG_DXFER_FROM_DEV,
+        * but is is possible that the app intended SG_DXFER_TO_DEV, because there
diff --git a/queue-5.4/selftests-bpf-fix-goto-cleanup-label-not-defined.patch b/queue-5.4/selftests-bpf-fix-goto-cleanup-label-not-defined.patch
new file mode 100644 (file)
index 0000000..4db7982
--- /dev/null
@@ -0,0 +1,42 @@
+From liuhangbin@gmail.com  Fri May 15 10:53:16 2020
+From: Hangbin Liu <liuhangbin@gmail.com>
+Date: Fri, 15 May 2020 11:38:05 +0800
+Subject: selftests/bpf: fix goto cleanup label not defined
+To: linux-kernel@vger.kernel.org
+Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>, stable@vger.kernel.org, bpf@vger.kernel.org, Andrii Nakryiko <andriin@fb.com>, Hangbin Liu <liuhangbin@gmail.com>, kernel test robot <rong.a.chen@intel.com>
+Message-ID: <20200515033805.2172595-1-liuhangbin@gmail.com>
+
+From: Hangbin Liu <liuhangbin@gmail.com>
+
+kernel test robot found a warning when build bpf selftest for 5.4.y stable
+tree:
+
+prog_tests/stacktrace_build_id_nmi.c:55:3: error: label ‘cleanup’ used but not defined
+   goto cleanup;
+   ^~~~
+
+This is because we are lacking upstream commit dde53c1b763b
+("selftests/bpf: Convert few more selftest to skeletons"). But this
+commit is too large and need more backports. To fix it, the
+easiest way is just use the current goto label 'close_prog'.
+
+Reported-by: kernel test robot <rong.a.chen@intel.com>
+Fixes: da43712a7262 ("selftests/bpf: Skip perf hw events test if the setup disabled it")
+Signed-off-by: Hangbin Liu <liuhangbin@gmail.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ tools/testing/selftests/bpf/prog_tests/stacktrace_build_id_nmi.c |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/tools/testing/selftests/bpf/prog_tests/stacktrace_build_id_nmi.c
++++ b/tools/testing/selftests/bpf/prog_tests/stacktrace_build_id_nmi.c
+@@ -52,7 +52,7 @@ retry:
+       if (pmu_fd < 0 && errno == ENOENT) {
+               printf("%s:SKIP:no PERF_COUNT_HW_CPU_CYCLES\n", __func__);
+               test__skip();
+-              goto cleanup;
++              goto close_prog;
+       }
+       if (CHECK(pmu_fd < 0, "perf_event_open", "err %d errno %d\n",
+                 pmu_fd, errno))
index 785ea49661e5acfa689bf7324f59fef471499dae..08129c38ebbbfe82de1f2f2ef1a845d3af929b89 100644 (file)
@@ -12,3 +12,5 @@ drop_monitor-work-around-gcc-10-stringop-overflow-wa.patch
 virtio-blk-handle-block_device_operations-callbacks-.patch
 sun6i-dsi-fix-gcc-4.8.patch
 net_sched-fix-tcm_parent-in-tc-filter-dump.patch
+scsi-sg-add-sg_remove_request-in-sg_write.patch
+selftests-bpf-fix-goto-cleanup-label-not-defined.patch