From: Greg Kroah-Hartman Date: Wed, 13 Jun 2018 16:46:15 +0000 (+0200) Subject: 4.14-stable patches X-Git-Tag: v4.17.2~34 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=2fd7a3b51abd965445e6ec1394ffae6fdf81fb6a;p=thirdparty%2Fkernel%2Fstable-queue.git 4.14-stable patches added patches: blkdev_report_zones_ioctl-use-vmalloc-to-allocate-large-buffers.patch --- diff --git a/queue-4.14/blkdev_report_zones_ioctl-use-vmalloc-to-allocate-large-buffers.patch b/queue-4.14/blkdev_report_zones_ioctl-use-vmalloc-to-allocate-large-buffers.patch new file mode 100644 index 00000000000..9ab2b4b0561 --- /dev/null +++ b/queue-4.14/blkdev_report_zones_ioctl-use-vmalloc-to-allocate-large-buffers.patch @@ -0,0 +1,69 @@ +From 327ea4adcfa37194739f1ec7c70568944d292281 Mon Sep 17 00:00:00 2001 +From: Bart Van Assche +Date: Tue, 22 May 2018 08:27:22 -0700 +Subject: blkdev_report_zones_ioctl(): Use vmalloc() to allocate large buffers + +From: Bart Van Assche + +commit 327ea4adcfa37194739f1ec7c70568944d292281 upstream. + +Avoid that complaints similar to the following appear in the kernel log +if the number of zones is sufficiently large: + + fio: page allocation failure: order:9, mode:0x140c0c0(GFP_KERNEL|__GFP_COMP|__GFP_ZERO), nodemask=(null) + Call Trace: + dump_stack+0x63/0x88 + warn_alloc+0xf5/0x190 + __alloc_pages_slowpath+0x8f0/0xb0d + __alloc_pages_nodemask+0x242/0x260 + alloc_pages_current+0x6a/0xb0 + kmalloc_order+0x18/0x50 + kmalloc_order_trace+0x26/0xb0 + __kmalloc+0x20e/0x220 + blkdev_report_zones_ioctl+0xa5/0x1a0 + blkdev_ioctl+0x1ba/0x930 + block_ioctl+0x41/0x50 + do_vfs_ioctl+0xaa/0x610 + SyS_ioctl+0x79/0x90 + do_syscall_64+0x79/0x1b0 + entry_SYSCALL_64_after_hwframe+0x3d/0xa2 + +Fixes: 3ed05a987e0f ("blk-zoned: implement ioctls") +Signed-off-by: Bart Van Assche +Cc: Shaun Tancheff +Cc: Damien Le Moal +Cc: Christoph Hellwig +Cc: Martin K. Petersen +Cc: Hannes Reinecke +Cc: +Signed-off-by: Jens Axboe +Signed-off-by: Greg Kroah-Hartman + +--- + block/blk-zoned.c | 8 ++++++-- + 1 file changed, 6 insertions(+), 2 deletions(-) + +--- a/block/blk-zoned.c ++++ b/block/blk-zoned.c +@@ -286,7 +286,11 @@ int blkdev_report_zones_ioctl(struct blo + if (!rep.nr_zones) + return -EINVAL; + +- zones = kcalloc(rep.nr_zones, sizeof(struct blk_zone), GFP_KERNEL); ++ if (rep.nr_zones > INT_MAX / sizeof(struct blk_zone)) ++ return -ERANGE; ++ ++ zones = kvmalloc(rep.nr_zones * sizeof(struct blk_zone), ++ GFP_KERNEL | __GFP_ZERO); + if (!zones) + return -ENOMEM; + +@@ -308,7 +312,7 @@ int blkdev_report_zones_ioctl(struct blo + } + + out: +- kfree(zones); ++ kvfree(zones); + + return ret; + } diff --git a/queue-4.14/series b/queue-4.14/series index 911220c3a07..0c66f7bf089 100644 --- a/queue-4.14/series +++ b/queue-4.14/series @@ -1 +1,2 @@ netfilter-nf_tables-fix-null-pointer-dereference-on-nft_ct_helper_obj_dump.patch +blkdev_report_zones_ioctl-use-vmalloc-to-allocate-large-buffers.patch diff --git a/queue-4.4/series b/queue-4.4/series new file mode 100644 index 00000000000..ee9c380a7e9 --- /dev/null +++ b/queue-4.4/series @@ -0,0 +1,20 @@ +x86-fpu-fix-early-fpu-command-line-parsing.patch +x86-remove-unused-function-cpu_has_ht_siblings.patch +x86-cpufeature-remove-unused-and-seldomly-used-cpu_has_xx-macros.patch +x86-cpufeature-remove-cpu_has_arch_perfmon.patch +x86-mm-pat-x86-cpufeature-remove-cpu_has_pat.patch +x86-cpufeature-remove-cpu_has_osxsave.patch +x86-cpufeature-remove-cpu_has_x2apic.patch +x86-cpufeature-remove-cpu_has_gbpages.patch +x86-cpufeature-remove-cpu_has_clflush.patch +x86-cpufeature-remove-cpu_has_xmm2.patch +x86-cpufeature-remove-cpu_has_pse.patch +x86-cpufeature-replace-cpu_has_avx2-with-boot_cpu_has-usage.patch +x86-cpufeature-replace-cpu_has_aes-with-boot_cpu_has-usage.patch +x86-fpu-disable-mpx-when-eagerfpu-is-off.patch +x86-fpu-disable-avx-when-eagerfpu-is-off.patch +x86-fpu-default-eagerfpu-on-on-all-cpus.patch +x86-fpu-fix-no387-regression.patch +x86-fpu-revert-x86-fpu-disable-avx-when-eagerfpu-is-off.patch +x86-fpu-fix-eager-fpu-handling-on-legacy-fpu-machines.patch +x86-fpu-hard-disable-lazy-fpu-mode.patch