From: Greg Kroah-Hartman Date: Thu, 19 Sep 2019 19:12:29 +0000 (+0200) Subject: 4.14-stable patches X-Git-Tag: v4.4.194~17 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=5fdf0648fe5b744e4a303c0b0e5e57e1c9c16bf4;p=thirdparty%2Fkernel%2Fstable-queue.git 4.14-stable patches added patches: floppy-fix-usercopy-direction.patch --- diff --git a/queue-4.14/floppy-fix-usercopy-direction.patch b/queue-4.14/floppy-fix-usercopy-direction.patch new file mode 100644 index 00000000000..750aee6b9cc --- /dev/null +++ b/queue-4.14/floppy-fix-usercopy-direction.patch @@ -0,0 +1,44 @@ +From 52f6f9d74f31078964ca1574f7bb612da7877ac8 Mon Sep 17 00:00:00 2001 +From: Jann Horn +Date: Tue, 26 Mar 2019 23:03:48 +0100 +Subject: floppy: fix usercopy direction + +From: Jann Horn + +commit 52f6f9d74f31078964ca1574f7bb612da7877ac8 upstream. + +As sparse points out, these two copy_from_user() should actually be +copy_to_user(). + +Fixes: 229b53c9bf4e ("take floppy compat ioctls to sodding floppy.c") +Cc: stable@vger.kernel.org +Acked-by: Alexander Popov +Reviewed-by: Mukesh Ojha +Signed-off-by: Jann Horn +Signed-off-by: Jens Axboe +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/block/floppy.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- a/drivers/block/floppy.c ++++ b/drivers/block/floppy.c +@@ -3786,7 +3786,7 @@ static int compat_getdrvprm(int drive, + v.native_format = UDP->native_format; + mutex_unlock(&floppy_mutex); + +- if (copy_from_user(arg, &v, sizeof(struct compat_floppy_drive_params))) ++ if (copy_to_user(arg, &v, sizeof(struct compat_floppy_drive_params))) + return -EFAULT; + return 0; + } +@@ -3822,7 +3822,7 @@ static int compat_getdrvstat(int drive, + v.bufblocks = UDRS->bufblocks; + mutex_unlock(&floppy_mutex); + +- if (copy_from_user(arg, &v, sizeof(struct compat_floppy_drive_struct))) ++ if (copy_to_user(arg, &v, sizeof(struct compat_floppy_drive_struct))) + return -EFAULT; + return 0; + Eintr: diff --git a/queue-4.14/series b/queue-4.14/series index ccb59467045..bf64113247c 100644 --- a/queue-4.14/series +++ b/queue-4.14/series @@ -52,3 +52,4 @@ keys-fix-missing-null-pointer-check-in-request_key_a.patch iommu-amd-flush-old-domains-in-kdump-kernel.patch iommu-amd-fix-race-in-increase_address_space.patch pci-kirin-fix-section-mismatch-warning.patch +floppy-fix-usercopy-direction.patch