From: Greg Kroah-Hartman Date: Fri, 15 May 2020 09:19:02 +0000 (+0200) Subject: 5.4-stable patches X-Git-Tag: v4.4.224~61 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=26e7aae490296a7dcea3bd6f90270f57a96b7f49;p=thirdparty%2Fkernel%2Fstable-queue.git 5.4-stable patches added patches: scsi-sg-add-sg_remove_request-in-sg_write.patch selftests-bpf-fix-goto-cleanup-label-not-defined.patch --- 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 index 00000000000..64f1169697a --- /dev/null +++ b/queue-5.4/scsi-sg-add-sg_remove_request-in-sg_write.patch @@ -0,0 +1,39 @@ +From 83c6f2390040f188cc25b270b4befeb5628c1aee Mon Sep 17 00:00:00 2001 +From: Wu Bo +Date: Tue, 14 Apr 2020 10:13:28 +0800 +Subject: scsi: sg: add sg_remove_request in sg_write + +From: Wu Bo + +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 +Signed-off-by: Wu Bo +Signed-off-by: Martin K. Petersen +Signed-off-by: Sasha Levin +[groeck: Backport to v5.4.y and older kernels] +Signed-off-by: Guenter Roeck +Signed-off-by: Greg Kroah-Hartman + +--- + 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 index 00000000000..4db7982fc0e --- /dev/null +++ b/queue-5.4/selftests-bpf-fix-goto-cleanup-label-not-defined.patch @@ -0,0 +1,42 @@ +From liuhangbin@gmail.com Fri May 15 10:53:16 2020 +From: Hangbin Liu +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 , stable@vger.kernel.org, bpf@vger.kernel.org, Andrii Nakryiko , Hangbin Liu , kernel test robot +Message-ID: <20200515033805.2172595-1-liuhangbin@gmail.com> + +From: Hangbin Liu + +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 +Fixes: da43712a7262 ("selftests/bpf: Skip perf hw events test if the setup disabled it") +Signed-off-by: Hangbin Liu +Signed-off-by: Greg Kroah-Hartman + +--- + 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)) diff --git a/queue-5.4/series b/queue-5.4/series index 785ea49661e..08129c38ebb 100644 --- a/queue-5.4/series +++ b/queue-5.4/series @@ -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