From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.linuxfoundation.org ([140.211.169.12]:38952 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751873AbeCYKE0 (ORCPT ); Sun, 25 Mar 2018 06:04:26 -0400 Subject: Patch "drm: udl: Properly check framebuffer mmap offsets" has been added to the 4.14-stable tree To: gregkh@linuxfoundation.org, daniel.vetter@ffwll.ch, eyalit@checkpoint.com, stable@vger.kernel.org Cc: , From: Date: Sun, 25 Mar 2018 12:04:00 +0200 Message-ID: <152197224033142@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org List-ID: This is a note to let you know that I've just added the patch titled drm: udl: Properly check framebuffer mmap offsets to the 4.14-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: drm-udl-properly-check-framebuffer-mmap-offsets.patch and it can be found in the queue-4.14 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let know about it. >>From 3b82a4db8eaccce735dffd50b4d4e1578099b8e8 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Wed, 21 Mar 2018 16:45:53 +0100 Subject: drm: udl: Properly check framebuffer mmap offsets From: Greg Kroah-Hartman commit 3b82a4db8eaccce735dffd50b4d4e1578099b8e8 upstream. The memmap options sent to the udl framebuffer driver were not being checked for all sets of possible crazy values. Fix this up by properly bounding the allowed values. Reported-by: Eyal Itkin Cc: stable Signed-off-by: Greg Kroah-Hartman Signed-off-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20180321154553.GA18454@kroah.com Signed-off-by: Greg Kroah-Hartman --- drivers/gpu/drm/udl/udl_fb.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) --- a/drivers/gpu/drm/udl/udl_fb.c +++ b/drivers/gpu/drm/udl/udl_fb.c @@ -159,10 +159,15 @@ static int udl_fb_mmap(struct fb_info *i { unsigned long start = vma->vm_start; unsigned long size = vma->vm_end - vma->vm_start; - unsigned long offset = vma->vm_pgoff << PAGE_SHIFT; + unsigned long offset; unsigned long page, pos; - if (offset + size > info->fix.smem_len) + if (vma->vm_pgoff > (~0UL >> PAGE_SHIFT)) + return -EINVAL; + + offset = vma->vm_pgoff << PAGE_SHIFT; + + if (offset > info->fix.smem_len || size > info->fix.smem_len - offset) return -EINVAL; pos = (unsigned long)info->fix.smem_start + offset; Patches currently in stable-queue which might be from gregkh@linuxfoundation.org are queue-4.14/mips-lantiq-ase-enable-mfd_syscon.patch queue-4.14/mm-khugepaged.c-convert-vm_bug_on-to-collapse-fail.patch queue-4.14/drm-vmwgfx-fix-a-destoy-while-held-mutex-problem.patch queue-4.14/mmc-core-disable-hpi-for-certain-micron-numonyx-emmc-cards.patch queue-4.14/alsa-aloop-fix-access-to-not-yet-ready-substream-via-cable.patch queue-4.14/alsa-hda-realtek-fix-speaker-no-sound-after-system-resume.patch queue-4.14/libata-disable-lpm-for-crucial-bx100-ssd-500gb-drive.patch queue-4.14/can-ifi-check-core-revision-upon-probe.patch queue-4.14/bluetooth-btusb-fix-quirk-for-atheros-1525-qca6174.patch queue-4.14/nfsd-remove-blocked-locks-on-client-teardown.patch queue-4.14/mtdchar-fix-usage-of-mtd_ooblayout_ecc.patch queue-4.14/libata-apply-nolpm-quirk-to-crucial-m500-480-and-960gb-ssds.patch queue-4.14/drm-radeon-don-t-turn-off-dp-sink-when-disconnected.patch queue-4.14/clk-bcm2835-protect-sections-updating-shared-registers.patch queue-4.14/alsa-hda-realtek-fix-dell-headset-mic-can-t-record.patch queue-4.14/mmc-dw_mmc-fix-the-dto-cto-timeout-overflow-calculation-for-32-bit-systems.patch queue-4.14/rtlwifi-rtl8723be-fix-loss-of-signal.patch queue-4.14/libata-fix-length-validation-of-atapi-relayed-scsi-commands.patch queue-4.14/can-peak-pcie_fd-fix-echo_skb-is-occupied-bug.patch queue-4.14/tracing-probeevent-fix-to-support-minus-offset-from-symbol.patch queue-4.14/can-cc770-fix-use-after-free-in-cc770_tx_interrupt.patch queue-4.14/rdma-mlx5-fix-crash-while-accessing-garbage-pointer-and-freed-memory.patch queue-4.14/libata-apply-nolpm-quirk-to-crucial-mx100-512gb-ssds.patch queue-4.14/alsa-hda-realtek-always-immediately-update-mute-led-with-pin-vref.patch queue-4.14/iio-st_pressure-st_accel-pass-correct-platform-data-to-init.patch queue-4.14/h8300-remove-extraneous-__big_endian-definition.patch queue-4.14/iio-chemical-ccs811-corrected-firmware-boot-application-mode-transition.patch queue-4.14/pinctrl-samsung-validate-alias-coming-from-dt.patch queue-4.14/pci-add-function-1-dma-alias-quirk-for-highpoint-rocketraid-644l.patch queue-4.14/revert-mm-page_alloc-skip-over-regions-of-invalid-pfns-where-possible.patch queue-4.14/libata-modify-quirks-for-mx100-to-limit-ncq_trim-quirk-to-mu01-version.patch queue-4.14/mtd-nand-fsl_ifc-fix-nand-waitfunc-return-value.patch queue-4.14/drivers-hv-vmbus-fix-ring-buffer-signaling.patch queue-4.14/drm-reject-getfb-for-multi-plane-framebuffers.patch queue-4.14/can-ifi-repair-the-error-handling.patch queue-4.14/can-cc770-fix-queue-stall-dropped-rtr-reply.patch queue-4.14/libata-enable-queued-trim-for-samsung-ssd-860.patch queue-4.14/staging-ncpfs-memory-corruption-in-ncp_read_kernel.patch queue-4.14/ahci-add-pci-id-for-the-highpoint-rocketraid-644l-card.patch queue-4.14/mmc-dw_mmc-exynos-fix-the-suspend-resume-issue-for-exynos5433.patch queue-4.14/drm-udl-properly-check-framebuffer-mmap-offsets.patch queue-4.14/mips-lantiq-enable-ahb-bus-for-usb.patch queue-4.14/can-cc770-fix-stalls-on-rt-linux-remove-redundant-irq-ack.patch queue-4.14/iio-adc-meson-saradc-unlock-on-error-in-meson_sar_adc_lock.patch queue-4.14/mips-ralink-fix-booting-on-mt7621.patch queue-4.14/clk-sunxi-ng-a31-fix-clk_out_-clock-ops.patch queue-4.14/brcmfmac-fix-p2p_device-ethernet-address-generation.patch queue-4.14/mm-thp-do-not-wait-for-lock_page-in-deferred_split_scan.patch queue-4.14/mtd-nand-fsl_ifc-fix-eccstat-array-overflow-for-ifc-ver-2.0.0.patch queue-4.14/hugetlbfs-check-for-pgoff-value-overflow.patch queue-4.14/lockdep-fix-fs_reclaim-warning.patch queue-4.14/mips-lantiq-fix-danube-usb-clock.patch queue-4.14/cgroup-fix-rule-checking-for-threaded-mode-switching.patch queue-4.14/mmc-core-fix-tracepoint-print-of-blk_addr-and-blksz.patch queue-4.14/alsa-usb-audio-fix-parsing-descriptor-of-uac2-processing-unit.patch queue-4.14/mm-vmscan-wake-up-flushers-for-legacy-cgroups-too.patch queue-4.14/acpi-numa-fix-pxm-to-online-numa-node-associations.patch queue-4.14/mmc-block-fix-updating-ext_csd-caches-on-ioctl-call.patch queue-4.14/can-peak-pcie_fd-remove-useless-code-when-interface-starts.patch queue-4.14/alsa-aloop-sync-stale-timer-before-release.patch queue-4.14/mips-ralink-remove-ralink_halt.patch queue-4.14/libnvdimm-btt-blk-do-integrity-setup-before-add_disk.patch queue-4.14/acpi-watchdog-fix-off-by-one-error-at-resource-assignment.patch queue-4.14/mtd-nand-fsl_ifc-read-eccstat0-and-eccstat1-registers-for-ifc-2.0.patch queue-4.14/mmc-dw_mmc-fix-falling-from-idmac-to-pio-mode-when-dw_mci_reset-occurs.patch queue-4.14/libata-make-crucial-bx100-500gb-lpm-quirk-apply-to-all-firmware-versions.patch queue-4.14/clk-bcm2835-fix-ana-maskx-definitions.patch queue-4.14/alsa-hda-force-polling-mode-on-cfl-for-fixing-codec-communication.patch queue-4.14/libata-remove-warn-for-dma-or-pio-command-without-data.patch queue-4.14/drm-vmwgfx-fix-black-screen-and-device-errors-when-running-without-fbdev.patch queue-4.14/mm-vmalloc-add-interfaces-to-free-unmapped-page-table.patch queue-4.14/bluetooth-btusb-add-dell-optiplex-3060-to-btusb_needs_reset_resume_table.patch queue-4.14/mm-shmem-do-not-wait-for-lock_page-in-shmem_unused_huge_shrink.patch queue-4.14/bluetooth-btusb-remove-yoga-920-from-the-btusb_needs_reset_resume_table.patch queue-4.14/x86-mm-implement-free-pmd-pte-page-interfaces.patch queue-4.14/libata-don-t-try-to-pass-through-ncq-commands-to-non-ncq-devices.patch