stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: <gregkh@linuxfoundation.org>
To: gregkh@linuxfoundation.org, andreyknvl@google.com,
	felipe.balbi@linux.intel.com
Cc: <stable@vger.kernel.org>, <stable-commits@vger.kernel.org>
Subject: Patch "usb: gadgetfs: restrict upper bound on device configuration size" has been added to the 4.9-stable tree
Date: Mon, 09 Jan 2017 10:33:38 +0100	[thread overview]
Message-ID: <148395441880153@kroah.com> (raw)


This is a note to let you know that I've just added the patch titled

    usb: gadgetfs: restrict upper bound on device configuration size

to the 4.9-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:
     usb-gadgetfs-restrict-upper-bound-on-device-configuration-size.patch
and it can be found in the queue-4.9 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@vger.kernel.org> know about it.


>From 0994b0a257557e18ee8f0b7c5f0f73fe2b54eec1 Mon Sep 17 00:00:00 2001
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Date: Tue, 6 Dec 2016 08:36:29 +0100
Subject: usb: gadgetfs: restrict upper bound on device configuration size

From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 0994b0a257557e18ee8f0b7c5f0f73fe2b54eec1 upstream.

Andrey Konovalov reported that we were not properly checking the upper
limit before of a device configuration size before calling
memdup_user(), which could cause some problems.

So set the upper limit to PAGE_SIZE * 4, which should be good enough for
all devices.

Reported-by: Andrey Konovalov <andreyknvl@google.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/usb/gadget/legacy/inode.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

--- a/drivers/usb/gadget/legacy/inode.c
+++ b/drivers/usb/gadget/legacy/inode.c
@@ -1762,7 +1762,8 @@ dev_config (struct file *fd, const char
 	}
 	spin_unlock_irq(&dev->lock);
 
-	if (len < (USB_DT_CONFIG_SIZE + USB_DT_DEVICE_SIZE + 4))
+	if ((len < (USB_DT_CONFIG_SIZE + USB_DT_DEVICE_SIZE + 4)) ||
+	    (len > PAGE_SIZE * 4))
 		return -EINVAL;
 
 	/* we might need to change message format someday */


Patches currently in stable-queue which might be from gregkh@linuxfoundation.org are

queue-4.9/kvm-mips-don-t-clobber-cp0_status.ux.patch
queue-4.9/kvm-mips-flush-kvm-entry-code-from-icache-globally.patch
queue-4.9/parisc-mark-cr16-clocksource-unstable-on-smp-systems.patch
queue-4.9/usb-dummy-hcd-fix-bug-in-stop_activity-handle-ep0.patch
queue-4.9/usb-dwc3-core-avoid-overflow-events.patch
queue-4.9/usb-gadgetfs-fix-use-after-free-bug.patch
queue-4.9/alsa-hda-fix-up-gpio-for-asus-rog-ranger.patch
queue-4.9/drm-i915-fix-oopses-in-the-overlay-code-due-to-i915_gem_active-stuff.patch
queue-4.9/usb-musb-dsps-implement-clear_ep_rxintr-callback.patch
queue-4.9/alsa-hda-apply-asus-mode8-fixup-to-asus-x71sl.patch
queue-4.9/iio-max44000-correct-value-in-illuminance_integration_time_available.patch
queue-4.9/usb-gadget-composite-test-get_alt-presence-instead-of-set_alt.patch
queue-4.9/hid-sensor-hub-move-the-memset-to-sensor_hub_get_feature.patch
queue-4.9/usb-xhci-fix-possible-wild-pointer.patch
queue-4.9/drm-i915-initialize-overlay-last_flip-properly.patch
queue-4.9/drm-i915-force-vdd-off-on-the-new-power-seqeuencer-before-starting-to-use-it.patch
queue-4.9/usb-gadgetfs-restrict-upper-bound-on-device-configuration-size.patch
queue-4.9/usb-gadgetfs-fix-checks-of-wtotallength-in-config-descriptors.patch
queue-4.9/mac80211-initialize-fast-xmit-info-later.patch
queue-4.9/arm-davinci-da850-don-t-add-emac-clock-to-lookup-table-twice.patch
queue-4.9/pinctrl-amd-set-the-level-based-on-acpi-tables.patch
queue-4.9/asm-prototypes-clear-any-cpp-defines-before-declaring-the-functions.patch
queue-4.9/iio-common-st_sensors-fix-channel-data-parsing.patch
queue-4.9/usb-musb-core-add-clear_ep_rxintr-to-musb_platform_ops.patch
queue-4.9/kvm-x86-reset-mmu-on-kvm_set_vcpu_events.patch
queue-4.9/fscrypt-fix-renaming-and-linking-special-files.patch
queue-4.9/usb-fix-problems-with-duplicate-endpoint-addresses.patch
queue-4.9/staging-octeon-call-set_netdev_dev.patch
queue-4.9/drm-i915-fix-oops-in-overlay-due-to-frontbuffer-tracking.patch
queue-4.9/usb-storage-unusual_uas-add-jmicron-jms56x-to-unusual-device.patch
queue-4.9/gcc-plugins-update-gcc-common.h-for-gcc-7.patch
queue-4.9/alsa-usb-audio-fix-irq-process-data-synchronization.patch
queue-4.9/iio-bmi160-fix-time-needed-to-sleep-after-command-execution.patch
queue-4.9/usb-gadgetfs-fix-unbounded-memory-allocation-bug.patch
queue-4.9/parisc-add-line-break-when-printing-segfault-info.patch

                 reply	other threads:[~2017-01-09  9:34 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=148395441880153@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=andreyknvl@google.com \
    --cc=felipe.balbi@linux.intel.com \
    --cc=stable-commits@vger.kernel.org \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).