All of lore.kernel.org
 help / color / mirror / Atom feed
* [3.13.y-ckt stable] Linux 3.13.11-ckt35 stable review
@ 2016-02-10 21:41 Kamal Mostafa
  2016-02-10 21:41 ` [PATCH 3.13.y-ckt 01/30] [media] usbvision fix overflow of interfaces array Kamal Mostafa
                   ` (29 more replies)
  0 siblings, 30 replies; 31+ messages in thread
From: Kamal Mostafa @ 2016-02-10 21:41 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team; +Cc: Kamal Mostafa

This is the start of the review cycle for the Linux 3.13.11-ckt35 stable
kernel.

This version contains 30 new patches, summarized below.  The new patches
are posted as replies to this message and also available in this git branch:

http://kernel.ubuntu.com/git/ubuntu/linux.git/log/?h=linux-3.13.y-review

git://kernel.ubuntu.com/ubuntu/linux.git  linux-3.13.y-review

The review period for version 3.13.11-ckt35 will be open for the next three
days.  To report a problem, please reply to the relevant follow-up patch
message.

For more information about the Linux 3.13.y-ckt extended stable kernel
series, see https://wiki.ubuntu.com/Kernel/Dev/ExtendedStable .

 -Kamal

--
 arch/arm64/Makefile                           |  1 +
 arch/powerpc/perf/power8-pmu.c                |  2 +-
 arch/x86/kernel/apic/io_apic.c                |  6 +++-
 arch/x86/mm/pageattr.c                        |  4 +--
 drivers/gpu/drm/vmwgfx/vmwgfx_drv.c           |  7 ++++
 drivers/iio/imu/adis_buffer.c                 |  2 +-
 drivers/media/usb/usbvision/usbvision-video.c | 47 ++++++++++++++++++++++-----
 drivers/s390/net/qeth_l2_main.c               |  1 +
 drivers/s390/net/qeth_l3_main.c               |  1 +
 drivers/scsi/sd.c                             |  7 ++--
 drivers/scsi/sr.c                             |  4 +++
 drivers/tty/n_tty.c                           |  6 ++--
 drivers/tty/tty_io.c                          | 24 +++++++++++++-
 drivers/usb/class/cdc-acm.c                   | 14 +++++++-
 drivers/usb/class/cdc-acm.h                   |  1 +
 drivers/usb/core/hub.c                        |  8 +++--
 drivers/usb/serial/cp210x.c                   |  1 +
 drivers/usb/serial/ftdi_sio.c                 |  1 +
 drivers/usb/serial/ftdi_sio_ids.h             |  1 +
 drivers/usb/serial/option.c                   | 18 +++++++++-
 drivers/usb/serial/visor.c                    | 11 +++++--
 lib/asn1_decoder.c                            |  5 ++-
 sound/core/compress_offload.c                 | 11 +++++++
 sound/core/seq/oss/seq_oss_init.c             |  2 +-
 sound/core/seq/oss/seq_oss_synth.c            |  2 +-
 sound/drivers/dummy.c                         |  2 +-
 sound/usb/quirks.c                            | 14 +++++++-
 tools/perf/ui/browsers/annotate.c             |  4 +--
 28 files changed, 171 insertions(+), 36 deletions(-)

Alan Stern (1):
      SCSI: fix crashes in sd and sr runtime PM

Alexey Khoroshilov (1):
      [media] usbvision: fix leak of usb_dev on failure paths in usbvision_probe()

Daniele Palmas (1):
      USB: serial: option: Adding support for Telit LE922

David Howells (1):
      ASN.1: Fix non-match detection failure on data overrun

Du, Changbin (1):
      usb: hub: do not clear BOS field during reset device

Greg Kroah-Hartman (1):
      USB: serial: ftdi_sio: add support for Yaesu SCU-18 cable

Guillaume Fougnies (1):
      ALSA: usb-audio: Fix TEAC UD-501/UD-503/NT-503 usb delay

Johan Hovold (1):
      USB: visor: fix null-deref at probe

John Ernberg (1):
      USB: option: fix Cinterion AHxx enumeration

Lars-Peter Clausen (1):
      iio: adis_buffer: Fix out-of-bounds memory access

Lu Baolu (2):
      usb: cdc-acm: handle unlinked urb in acm read callback
      usb: cdc-acm: send zero packet for intel 7260 modem

Madhavan Srinivasan (1):
      powerpc/perf: Remove PPMU_HAS_SSLOT flag for Power8

Markus Trippelsdorf (1):
      perf annotate browser: Fix behaviour of Shift-Tab with nothing focussed

Matt Fleming (1):
      x86/mm/pat: Avoid truncation when converting cpa->numpages to address

Oliver Neukum (2):
      [media] usbvision fix overflow of interfaces array
      cdc-acm:exclude Samsung phone 04e8:685d

Peter Dedecker (1):
      USB: cp210x: add ID for IAI USB to RS485 adaptor

Peter Hurley (2):
      tty: Fix unsafe ldisc reference via ioctl(TIOCGETD)
      n_tty: Fix unsafe reference to "other" ldisc

Rob Clark (1):
      drm/vmwgfx: respect 'nomodeset'

Takashi Iwai (4):
      ALSA: seq: Fix incorrect sanity check at snd_seq_oss_synth_cleanup()
      ALSA: seq: Degrade the error message for too many opens
      ALSA: compress: Disable GET_CODEC_CAPS ioctl for some architectures
      ALSA: dummy: Disable switching timer backend via sysfs

Thomas Gleixner (1):
      x86/irq: Call chip->irq_set_affinity in proper context

Ursula Braun (1):
      qeth: initialize net_device with carrier off

Vladis Dronov (2):
      [media] usbvision: fix crash on detecting device with invalid configuration
      USB: serial: visor: fix crash on detecting device without write_urbs

dann frazier (1):
      arm64: errata: Add -mpc-relative-literal-loads to build flags

^ permalink raw reply	[flat|nested] 31+ messages in thread

* [PATCH 3.13.y-ckt 01/30] [media] usbvision fix overflow of interfaces array
  2016-02-10 21:41 [3.13.y-ckt stable] Linux 3.13.11-ckt35 stable review Kamal Mostafa
@ 2016-02-10 21:41 ` Kamal Mostafa
  2016-02-10 21:41 ` [PATCH 3.13.y-ckt 02/30] [media] usbvision: fix leak of usb_dev on failure paths in usbvision_probe() Kamal Mostafa
                   ` (28 subsequent siblings)
  29 siblings, 0 replies; 31+ messages in thread
From: Kamal Mostafa @ 2016-02-10 21:41 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Oliver Neukum, Vladis Dronov, Hans Verkuil,
	Mauro Carvalho Chehab, Kamal Mostafa

3.13.11-ckt35 -stable review patch.  If anyone has any objections, please let me know.

---8<------------------------------------------------------------

From: Oliver Neukum <oneukum@suse.com>

commit 588afcc1c0e45358159090d95bf7b246fb67565f upstream.

This fixes the crash reported in:
http://seclists.org/bugtraq/2015/Oct/35
The interface number needs a sanity check.

Signed-off-by: Oliver Neukum <oneukum@suse.com>
Cc: Vladis Dronov <vdronov@redhat.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 drivers/media/usb/usbvision/usbvision-video.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/media/usb/usbvision/usbvision-video.c b/drivers/media/usb/usbvision/usbvision-video.c
index 5c9e312..d6492f8 100644
--- a/drivers/media/usb/usbvision/usbvision-video.c
+++ b/drivers/media/usb/usbvision/usbvision-video.c
@@ -1536,6 +1536,13 @@ static int usbvision_probe(struct usb_interface *intf,
 	printk(KERN_INFO "%s: %s found\n", __func__,
 				usbvision_device_data[model].model_string);
 
+	/*
+	 * this is a security check.
+	 * an exploit using an incorrect bInterfaceNumber is known
+	 */
+	if (ifnum >= USB_MAXINTERFACES || !dev->actconfig->interface[ifnum])
+		return -ENODEV;
+
 	if (usbvision_device_data[model].interface >= 0)
 		interface = &dev->actconfig->interface[usbvision_device_data[model].interface]->altsetting[0];
 	else
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 31+ messages in thread

* [PATCH 3.13.y-ckt 02/30] [media] usbvision: fix leak of usb_dev on failure paths in usbvision_probe()
  2016-02-10 21:41 [3.13.y-ckt stable] Linux 3.13.11-ckt35 stable review Kamal Mostafa
  2016-02-10 21:41 ` [PATCH 3.13.y-ckt 01/30] [media] usbvision fix overflow of interfaces array Kamal Mostafa
@ 2016-02-10 21:41 ` Kamal Mostafa
  2016-02-10 21:41 ` [PATCH 3.13.y-ckt 03/30] [media] usbvision: fix crash on detecting device with invalid configuration Kamal Mostafa
                   ` (27 subsequent siblings)
  29 siblings, 0 replies; 31+ messages in thread
From: Kamal Mostafa @ 2016-02-10 21:41 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Alexey Khoroshilov, Hans Verkuil, Mauro Carvalho Chehab, Kamal Mostafa

3.13.11-ckt35 -stable review patch.  If anyone has any objections, please let me know.

---8<------------------------------------------------------------

From: Alexey Khoroshilov <khoroshilov@ispras.ru>

commit afd270d1a45043cef14341bcceff62ed50e8dc9a upstream.

There is no usb_put_dev() on failure paths in usbvision_probe().

Found by Linux Driver Verification project (linuxtesting.org).

Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 drivers/media/usb/usbvision/usbvision-video.c | 24 +++++++++++++++++-------
 1 file changed, 17 insertions(+), 7 deletions(-)

diff --git a/drivers/media/usb/usbvision/usbvision-video.c b/drivers/media/usb/usbvision/usbvision-video.c
index d6492f8..72711a1 100644
--- a/drivers/media/usb/usbvision/usbvision-video.c
+++ b/drivers/media/usb/usbvision/usbvision-video.c
@@ -1522,7 +1522,7 @@ static int usbvision_probe(struct usb_interface *intf,
 	const struct usb_host_interface *interface;
 	struct usb_usbvision *usbvision = NULL;
 	const struct usb_endpoint_descriptor *endpoint;
-	int model, i;
+	int model, i, ret;
 
 	PDEBUG(DBG_PROBE, "VID=%#04x, PID=%#04x, ifnum=%u",
 				dev->descriptor.idVendor,
@@ -1531,7 +1531,8 @@ static int usbvision_probe(struct usb_interface *intf,
 	model = devid->driver_info;
 	if (model < 0 || model >= usbvision_device_data_size) {
 		PDEBUG(DBG_PROBE, "model out of bounds %d", model);
-		return -ENODEV;
+		ret = -ENODEV;
+		goto err_usb;
 	}
 	printk(KERN_INFO "%s: %s found\n", __func__,
 				usbvision_device_data[model].model_string);
@@ -1553,18 +1554,21 @@ static int usbvision_probe(struct usb_interface *intf,
 		    __func__, ifnum);
 		dev_err(&intf->dev, "%s: Endpoint attributes %d",
 		    __func__, endpoint->bmAttributes);
-		return -ENODEV;
+		ret = -ENODEV;
+		goto err_usb;
 	}
 	if (usb_endpoint_dir_out(endpoint)) {
 		dev_err(&intf->dev, "%s: interface %d. has ISO OUT endpoint!\n",
 		    __func__, ifnum);
-		return -ENODEV;
+		ret = -ENODEV;
+		goto err_usb;
 	}
 
 	usbvision = usbvision_alloc(dev, intf);
 	if (usbvision == NULL) {
 		dev_err(&intf->dev, "%s: couldn't allocate USBVision struct\n", __func__);
-		return -ENOMEM;
+		ret = -ENOMEM;
+		goto err_usb;
 	}
 
 	if (dev->descriptor.bNumConfigurations > 1)
@@ -1583,8 +1587,8 @@ static int usbvision_probe(struct usb_interface *intf,
 	usbvision->alt_max_pkt_size = kmalloc(32 * usbvision->num_alt, GFP_KERNEL);
 	if (usbvision->alt_max_pkt_size == NULL) {
 		dev_err(&intf->dev, "usbvision: out of memory!\n");
-		usbvision_release(usbvision);
-		return -ENOMEM;
+		ret = -ENOMEM;
+		goto err_pkt;
 	}
 
 	for (i = 0; i < usbvision->num_alt; i++) {
@@ -1619,6 +1623,12 @@ static int usbvision_probe(struct usb_interface *intf,
 
 	PDEBUG(DBG_PROBE, "success");
 	return 0;
+
+err_pkt:
+	usbvision_release(usbvision);
+err_usb:
+	usb_put_dev(dev);
+	return ret;
 }
 
 
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 31+ messages in thread

* [PATCH 3.13.y-ckt 03/30] [media] usbvision: fix crash on detecting device with invalid configuration
  2016-02-10 21:41 [3.13.y-ckt stable] Linux 3.13.11-ckt35 stable review Kamal Mostafa
  2016-02-10 21:41 ` [PATCH 3.13.y-ckt 01/30] [media] usbvision fix overflow of interfaces array Kamal Mostafa
  2016-02-10 21:41 ` [PATCH 3.13.y-ckt 02/30] [media] usbvision: fix leak of usb_dev on failure paths in usbvision_probe() Kamal Mostafa
@ 2016-02-10 21:41 ` Kamal Mostafa
  2016-02-10 21:41 ` [PATCH 3.13.y-ckt 04/30] tty: Fix unsafe ldisc reference via ioctl(TIOCGETD) Kamal Mostafa
                   ` (26 subsequent siblings)
  29 siblings, 0 replies; 31+ messages in thread
From: Kamal Mostafa @ 2016-02-10 21:41 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Vladis Dronov, Mauro Carvalho Chehab, Kamal Mostafa

3.13.11-ckt35 -stable review patch.  If anyone has any objections, please let me know.

---8<------------------------------------------------------------

From: Vladis Dronov <vdronov@redhat.com>

commit fa52bd506f274b7619955917abfde355e3d19ffe upstream.

The usbvision driver crashes when a specially crafted usb device with invalid
number of interfaces or endpoints is detected. This fix adds checks that the
device has proper configuration expected by the driver.

Reported-by: Ralf Spenneberg <ralf@spenneberg.net>
Signed-off-by: Vladis Dronov <vdronov@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 drivers/media/usb/usbvision/usbvision-video.c | 16 +++++++++++++++-
 1 file changed, 15 insertions(+), 1 deletion(-)

diff --git a/drivers/media/usb/usbvision/usbvision-video.c b/drivers/media/usb/usbvision/usbvision-video.c
index 72711a1..ad5070a 100644
--- a/drivers/media/usb/usbvision/usbvision-video.c
+++ b/drivers/media/usb/usbvision/usbvision-video.c
@@ -1546,9 +1546,23 @@ static int usbvision_probe(struct usb_interface *intf,
 
 	if (usbvision_device_data[model].interface >= 0)
 		interface = &dev->actconfig->interface[usbvision_device_data[model].interface]->altsetting[0];
-	else
+	else if (ifnum < dev->actconfig->desc.bNumInterfaces)
 		interface = &dev->actconfig->interface[ifnum]->altsetting[0];
+	else {
+		dev_err(&intf->dev, "interface %d is invalid, max is %d\n",
+		    ifnum, dev->actconfig->desc.bNumInterfaces - 1);
+		ret = -ENODEV;
+		goto err_usb;
+	}
+
+	if (interface->desc.bNumEndpoints < 2) {
+		dev_err(&intf->dev, "interface %d has %d endpoints, but must"
+		    " have minimum 2\n", ifnum, interface->desc.bNumEndpoints);
+		ret = -ENODEV;
+		goto err_usb;
+	}
 	endpoint = &interface->endpoint[1].desc;
+
 	if (!usb_endpoint_xfer_isoc(endpoint)) {
 		dev_err(&intf->dev, "%s: interface %d. has non-ISO endpoint!\n",
 		    __func__, ifnum);
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 31+ messages in thread

* [PATCH 3.13.y-ckt 04/30] tty: Fix unsafe ldisc reference via ioctl(TIOCGETD)
  2016-02-10 21:41 [3.13.y-ckt stable] Linux 3.13.11-ckt35 stable review Kamal Mostafa
                   ` (2 preceding siblings ...)
  2016-02-10 21:41 ` [PATCH 3.13.y-ckt 03/30] [media] usbvision: fix crash on detecting device with invalid configuration Kamal Mostafa
@ 2016-02-10 21:41 ` Kamal Mostafa
  2016-02-10 21:41 ` [PATCH 3.13.y-ckt 05/30] USB: serial: visor: fix crash on detecting device without write_urbs Kamal Mostafa
                   ` (25 subsequent siblings)
  29 siblings, 0 replies; 31+ messages in thread
From: Kamal Mostafa @ 2016-02-10 21:41 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Peter Hurley, Greg Kroah-Hartman, Kamal Mostafa

3.13.11-ckt35 -stable review patch.  If anyone has any objections, please let me know.

---8<------------------------------------------------------------

From: Peter Hurley <peter@hurleysoftware.com>

commit 5c17c861a357e9458001f021a7afa7aab9937439 upstream.

ioctl(TIOCGETD) retrieves the line discipline id directly from the
ldisc because the line discipline id (c_line) in termios is untrustworthy;
userspace may have set termios via ioctl(TCSETS*) without actually
changing the line discipline via ioctl(TIOCSETD).

However, directly accessing the current ldisc via tty->ldisc is
unsafe; the ldisc ptr dereferenced may be stale if the line discipline
is changing via ioctl(TIOCSETD) or hangup.

Wait for the line discipline reference (just like read() or write())
to retrieve the "current" line discipline id.

Signed-off-by: Peter Hurley <peter@hurleysoftware.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 drivers/tty/tty_io.c | 24 +++++++++++++++++++++++-
 1 file changed, 23 insertions(+), 1 deletion(-)

diff --git a/drivers/tty/tty_io.c b/drivers/tty/tty_io.c
index 84b7f1d..f7cb064 100644
--- a/drivers/tty/tty_io.c
+++ b/drivers/tty/tty_io.c
@@ -2585,6 +2585,28 @@ static int tiocsetd(struct tty_struct *tty, int __user *p)
 }
 
 /**
+ *	tiocgetd	-	get line discipline
+ *	@tty: tty device
+ *	@p: pointer to user data
+ *
+ *	Retrieves the line discipline id directly from the ldisc.
+ *
+ *	Locking: waits for ldisc reference (in case the line discipline
+ *		is changing or the tty is being hungup)
+ */
+
+static int tiocgetd(struct tty_struct *tty, int __user *p)
+{
+	struct tty_ldisc *ld;
+	int ret;
+
+	ld = tty_ldisc_ref_wait(tty);
+	ret = put_user(ld->ops->num, p);
+	tty_ldisc_deref(ld);
+	return ret;
+}
+
+/**
  *	send_break	-	performed time break
  *	@tty: device to break on
  *	@duration: timeout in mS
@@ -2798,7 +2820,7 @@ long tty_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
 	case TIOCGSID:
 		return tiocgsid(tty, real_tty, p);
 	case TIOCGETD:
-		return put_user(tty->ldisc->ops->num, (int __user *)p);
+		return tiocgetd(tty, p);
 	case TIOCSETD:
 		return tiocsetd(tty, p);
 	case TIOCVHANGUP:
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 31+ messages in thread

* [PATCH 3.13.y-ckt 05/30] USB: serial: visor: fix crash on detecting device without write_urbs
  2016-02-10 21:41 [3.13.y-ckt stable] Linux 3.13.11-ckt35 stable review Kamal Mostafa
                   ` (3 preceding siblings ...)
  2016-02-10 21:41 ` [PATCH 3.13.y-ckt 04/30] tty: Fix unsafe ldisc reference via ioctl(TIOCGETD) Kamal Mostafa
@ 2016-02-10 21:41 ` Kamal Mostafa
  2016-02-10 21:41 ` [PATCH 3.13.y-ckt 06/30] ASN.1: Fix non-match detection failure on data overrun Kamal Mostafa
                   ` (24 subsequent siblings)
  29 siblings, 0 replies; 31+ messages in thread
From: Kamal Mostafa @ 2016-02-10 21:41 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Vladis Dronov, Johan Hovold, Kamal Mostafa

3.13.11-ckt35 -stable review patch.  If anyone has any objections, please let me know.

---8<------------------------------------------------------------

From: Vladis Dronov <vdronov@redhat.com>

commit cb3232138e37129e88240a98a1d2aba2187ff57c upstream.

The visor driver crashes in clie_5_attach() when a specially crafted USB
device without bulk-out endpoint is detected. This fix adds a check that
the device has proper configuration expected by the driver.

Reported-by: Ralf Spenneberg <ralf@spenneberg.net>
Signed-off-by: Vladis Dronov <vdronov@redhat.com>
Fixes: cfb8da8f69b8 ("USB: visor: fix initialisation of UX50/TH55 devices")
Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 drivers/usb/serial/visor.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/usb/serial/visor.c b/drivers/usb/serial/visor.c
index 727905d..9c61a86 100644
--- a/drivers/usb/serial/visor.c
+++ b/drivers/usb/serial/visor.c
@@ -604,8 +604,10 @@ static int clie_5_attach(struct usb_serial *serial)
 	 */
 
 	/* some sanity check */
-	if (serial->num_ports < 2)
-		return -1;
+	if (serial->num_bulk_out < 2) {
+		dev_err(&serial->interface->dev, "missing bulk out endpoints\n");
+		return -ENODEV;
+	}
 
 	/* port 0 now uses the modified endpoint Address */
 	port = serial->port[0];
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 31+ messages in thread

* [PATCH 3.13.y-ckt 06/30] ASN.1: Fix non-match detection failure on data overrun
  2016-02-10 21:41 [3.13.y-ckt stable] Linux 3.13.11-ckt35 stable review Kamal Mostafa
                   ` (4 preceding siblings ...)
  2016-02-10 21:41 ` [PATCH 3.13.y-ckt 05/30] USB: serial: visor: fix crash on detecting device without write_urbs Kamal Mostafa
@ 2016-02-10 21:41 ` Kamal Mostafa
  2016-02-10 21:41 ` [PATCH 3.13.y-ckt 07/30] qeth: initialize net_device with carrier off Kamal Mostafa
                   ` (23 subsequent siblings)
  29 siblings, 0 replies; 31+ messages in thread
From: Kamal Mostafa @ 2016-02-10 21:41 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team; +Cc: David Howells, Kamal Mostafa

3.13.11-ckt35 -stable review patch.  If anyone has any objections, please let me know.

---8<------------------------------------------------------------

From: David Howells <dhowells@redhat.com>

commit 0d62e9dd6da45bbf0f33a8617afc5fe774c8f45f upstream.

If the ASN.1 decoder is asked to parse a sequence of objects, non-optional
matches get skipped if there's no more data to be had rather than a
data-overrun error being reported.

This is due to the code segment that decides whether to skip optional
matches (ie. matches that could get ignored because an element is marked
OPTIONAL in the grammar) due to a lack of data also skips non-optional
elements if the data pointer has reached the end of the buffer.

This can be tested with the data decoder for the new RSA akcipher algorithm
that takes three non-optional integers.  Currently, it skips the last
integer if there is insufficient data.

Without the fix, #defining DEBUG in asn1_decoder.c will show something
like:

	next_op: pc=0/13 dp=0/270 C=0 J=0
	- match? 30 30 00
	- TAG: 30 266 CONS
	next_op: pc=2/13 dp=4/270 C=1 J=0
	- match? 02 02 00
	- TAG: 02 257
	- LEAF: 257
	next_op: pc=5/13 dp=265/270 C=1 J=0
	- match? 02 02 00
	- TAG: 02 3
	- LEAF: 3
	next_op: pc=8/13 dp=270/270 C=1 J=0
	next_op: pc=11/13 dp=270/270 C=1 J=0
	- end cons t=4 dp=270 l=270/270

The next_op line for pc=8/13 should be followed by a match line.

This is not exploitable for X.509 certificates by means of shortening the
message and fixing up the ASN.1 CONS tags because:

 (1) The relevant records being built up are cleared before use.

 (2) If the message is shortened sufficiently to remove the public key, the
     ASN.1 parse of the RSA key will fail quickly due to a lack of data.

 (3) Extracted signature data is either turned into MPIs (which cope with a
     0 length) or is simpler integers specifying algoritms and suchlike
     (which can validly be 0); and

 (4) The AKID and SKID extensions are optional and their removal is handled
     without risking passing a NULL to asymmetric_key_generate_id().

 (5) If the certificate is truncated sufficiently to remove the subject,
     issuer or serialNumber then the ASN.1 decoder will fail with a 'Cons
     stack underflow' return.

This is not exploitable for PKCS#7 messages by means of removal of elements
from such a message from the tail end of a sequence:

 (1) Any shortened X.509 certs embedded in the PKCS#7 message are survivable
     as detailed above.

 (2) The message digest content isn't used if it shows a NULL pointer,
     similarly, the authattrs aren't used if that shows a NULL pointer.

 (3) A missing signature results in a NULL MPI - which the MPI routines deal
     with.

 (4) If data is NULL, it is expected that the message has detached content and
     that is handled appropriately.

 (5) If the serialNumber is excised, the unconditional action associated
     with it will pick up the containing SEQUENCE instead, so no NULL
     pointer will be seen here.

     If both the issuer and the serialNumber are excised, the ASN.1 decode
     will fail with an 'Unexpected tag' return.

     In either case, there's no way to get to asymmetric_key_generate_id()
     with a NULL pointer.

 (6) Other fields are decoded to simple integers.  Shortening the message
     to omit an algorithm ID field will cause checks on this to fail early
     in the verification process.

This can also be tested by snipping objects off of the end of the ASN.1 stream
such that mandatory tags are removed - or even from the end of internal
SEQUENCEs.  If any mandatory tag is missing, the error EBADMSG *should* be
produced.  Without this patch ERANGE or ENOPKG might be produced or the parse
may apparently succeed, perhaps with ENOKEY or EKEYREJECTED being produced
later, depending on what gets snipped.

Just snipping off the final BIT_STRING or OCTET_STRING from either sample
should be a start since both are mandatory and neither will cause an EBADMSG
without the patches

Reported-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: David Howells <dhowells@redhat.com>
Tested-by: Marcel Holtmann <marcel@holtmann.org>
Reviewed-by: David Woodhouse <David.Woodhouse@intel.com>
[ kamal: backport to 3.19-stable: context ]
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 lib/asn1_decoder.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/lib/asn1_decoder.c b/lib/asn1_decoder.c
index 11b9b01..3787d02 100644
--- a/lib/asn1_decoder.c
+++ b/lib/asn1_decoder.c
@@ -208,9 +208,8 @@ next_op:
 		unsigned char tmp;
 
 		/* Skip conditional matches if possible */
-		if ((op & ASN1_OP_MATCH__COND &&
-		     flags & FLAG_MATCHED) ||
-		    dp == datalen) {
+		if ((op & ASN1_OP_MATCH__COND && flags & FLAG_MATCHED) ||
+		    (op & ASN1_OP_MATCH__SKIP && dp == datalen)) {
 			pc += asn1_op_lengths[op];
 			goto next_op;
 		}
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 31+ messages in thread

* [PATCH 3.13.y-ckt 07/30] qeth: initialize net_device with carrier off
  2016-02-10 21:41 [3.13.y-ckt stable] Linux 3.13.11-ckt35 stable review Kamal Mostafa
                   ` (5 preceding siblings ...)
  2016-02-10 21:41 ` [PATCH 3.13.y-ckt 06/30] ASN.1: Fix non-match detection failure on data overrun Kamal Mostafa
@ 2016-02-10 21:41 ` Kamal Mostafa
  2016-02-10 21:41 ` [PATCH 3.13.y-ckt 08/30] iio: adis_buffer: Fix out-of-bounds memory access Kamal Mostafa
                   ` (22 subsequent siblings)
  29 siblings, 0 replies; 31+ messages in thread
From: Kamal Mostafa @ 2016-02-10 21:41 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Ursula Braun, David S. Miller, Kamal Mostafa

3.13.11-ckt35 -stable review patch.  If anyone has any objections, please let me know.

---8<------------------------------------------------------------

From: Ursula Braun <ubraun@linux.vnet.ibm.com>

commit e5ebe63214d44d4dcf43df02edf3613e04d671b9 upstream.

/sys/class/net/<interface>/operstate for an active qeth network
interface offen shows "unknown", which translates to "state UNKNOWN
in output of "ip link show". It is caused by a missing initialization
of the __LINK_STATE_NOCARRIER bit in the net_device state field.
This patch adds a netif_carrier_off() invocation when creating the
net_device for a qeth device.

Signed-off-by: Ursula Braun <ubraun@linux.vnet.ibm.com>
Acked-by: Hendrik Brueckner <brueckner@linux.vnet.ibm.com>
Reference-ID: Bugzilla 133209
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 drivers/s390/net/qeth_l2_main.c | 1 +
 drivers/s390/net/qeth_l3_main.c | 1 +
 2 files changed, 2 insertions(+)

diff --git a/drivers/s390/net/qeth_l2_main.c b/drivers/s390/net/qeth_l2_main.c
index ec8ccda..8cd15fe 100644
--- a/drivers/s390/net/qeth_l2_main.c
+++ b/drivers/s390/net/qeth_l2_main.c
@@ -965,6 +965,7 @@ static int qeth_l2_setup_netdev(struct qeth_card *card)
 	qeth_l2_request_initial_mac(card);
 	SET_NETDEV_DEV(card->dev, &card->gdev->dev);
 	netif_napi_add(card->dev, &card->napi, qeth_l2_poll, QETH_NAPI_WEIGHT);
+	netif_carrier_off(card->dev);
 	return register_netdev(card->dev);
 }
 
diff --git a/drivers/s390/net/qeth_l3_main.c b/drivers/s390/net/qeth_l3_main.c
index c1b0b27..c882aab 100644
--- a/drivers/s390/net/qeth_l3_main.c
+++ b/drivers/s390/net/qeth_l3_main.c
@@ -3307,6 +3307,7 @@ static int qeth_l3_setup_netdev(struct qeth_card *card)
 
 	SET_NETDEV_DEV(card->dev, &card->gdev->dev);
 	netif_napi_add(card->dev, &card->napi, qeth_l3_poll, QETH_NAPI_WEIGHT);
+	netif_carrier_off(card->dev);
 	return register_netdev(card->dev);
 }
 
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 31+ messages in thread

* [PATCH 3.13.y-ckt 08/30] iio: adis_buffer: Fix out-of-bounds memory access
  2016-02-10 21:41 [3.13.y-ckt stable] Linux 3.13.11-ckt35 stable review Kamal Mostafa
                   ` (6 preceding siblings ...)
  2016-02-10 21:41 ` [PATCH 3.13.y-ckt 07/30] qeth: initialize net_device with carrier off Kamal Mostafa
@ 2016-02-10 21:41 ` Kamal Mostafa
  2016-02-10 21:41 ` [PATCH 3.13.y-ckt 09/30] x86/irq: Call chip->irq_set_affinity in proper context Kamal Mostafa
                   ` (21 subsequent siblings)
  29 siblings, 0 replies; 31+ messages in thread
From: Kamal Mostafa @ 2016-02-10 21:41 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Lars-Peter Clausen, Jonathan Cameron, Kamal Mostafa

3.13.11-ckt35 -stable review patch.  If anyone has any objections, please let me know.

---8<------------------------------------------------------------

From: Lars-Peter Clausen <lars@metafoo.de>

commit d590faf9e8f8509a0a0aa79c38e87fcc6b913248 upstream.

The SPI tx and rx buffers are both supposed to be scan_bytes amount of
bytes large and a common allocation is used to allocate both buffers. This
puts the beginning of the tx buffer scan_bytes bytes after the rx buffer.
The initialization of the tx buffer pointer is done adding scan_bytes to
the beginning of the rx buffer, but since the rx buffer is of type __be16
this will actually add two times as much and the tx buffer ends up pointing
after the allocated buffer.

Fix this by using scan_count, which is scan_bytes / 2, instead of
scan_bytes when initializing the tx buffer pointer.

Fixes: aacff892cbd5 ("staging:iio:adis: Preallocate transfer message")
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 drivers/iio/imu/adis_buffer.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/iio/imu/adis_buffer.c b/drivers/iio/imu/adis_buffer.c
index cb32b59..36607d5 100644
--- a/drivers/iio/imu/adis_buffer.c
+++ b/drivers/iio/imu/adis_buffer.c
@@ -43,7 +43,7 @@ int adis_update_scan_mode(struct iio_dev *indio_dev,
 		return -ENOMEM;
 
 	rx = adis->buffer;
-	tx = rx + indio_dev->scan_bytes;
+	tx = rx + scan_count;
 
 	spi_message_init(&adis->msg);
 
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 31+ messages in thread

* [PATCH 3.13.y-ckt 09/30] x86/irq: Call chip->irq_set_affinity in proper context
  2016-02-10 21:41 [3.13.y-ckt stable] Linux 3.13.11-ckt35 stable review Kamal Mostafa
                   ` (7 preceding siblings ...)
  2016-02-10 21:41 ` [PATCH 3.13.y-ckt 08/30] iio: adis_buffer: Fix out-of-bounds memory access Kamal Mostafa
@ 2016-02-10 21:41 ` Kamal Mostafa
  2016-02-10 21:41 ` [PATCH 3.13.y-ckt 10/30] usb: cdc-acm: handle unlinked urb in acm read callback Kamal Mostafa
                   ` (20 subsequent siblings)
  29 siblings, 0 replies; 31+ messages in thread
From: Kamal Mostafa @ 2016-02-10 21:41 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Thomas Gleixner, Jiang Liu, Jeremiah Mahler, andy.shevchenko,
	Guenter Roeck, Joe Lawrence, Kamal Mostafa

3.13.11-ckt35 -stable review patch.  If anyone has any objections, please let me know.

---8<------------------------------------------------------------

From: Thomas Gleixner <tglx@linutronix.de>

commit e23b257c293ce4bcc8cabb2aa3097b6ed8a8261a upstream.

setup_ioapic_dest() calls irqchip->irq_set_affinity() completely
unprotected. That's wrong in several aspects:

 - it opens a race window where irq_set_affinity() can be interrupted and the
   irq chip left in unconsistent state.

 - it triggers a lockdep splat when we fix the vector race for 4.3+ because
   vector lock is taken with interrupts enabled.

The proper calling convention is irq descriptor lock held and interrupts
disabled.

Reported-and-tested-by: Borislav Petkov <bp@alien8.de>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Jiang Liu <jiang.liu@linux.intel.com>
Cc: Jeremiah Mahler <jmmahler@gmail.com>
Cc: andy.shevchenko@gmail.com
Cc: Guenter Roeck <linux@roeck-us.net>
Cc: Joe Lawrence <joe.lawrence@stratus.com>
Link: http://lkml.kernel.org/r/alpine.DEB.2.11.1601140919420.3575@nanos
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
[ kamal: backport to 3.19-stable: context ]
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 arch/x86/kernel/apic/io_apic.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/arch/x86/kernel/apic/io_apic.c b/arch/x86/kernel/apic/io_apic.c
index e63a5bd..94a3320 100644
--- a/arch/x86/kernel/apic/io_apic.c
+++ b/arch/x86/kernel/apic/io_apic.c
@@ -3610,6 +3610,7 @@ void __init setup_ioapic_dest(void)
 {
 	int pin, ioapic, irq, irq_entry;
 	const struct cpumask *mask;
+	struct irq_desc *desc;
 	struct irq_data *idata;
 
 	if (skip_ioapic_setup == 1)
@@ -3625,7 +3626,9 @@ void __init setup_ioapic_dest(void)
 		if ((ioapic > 0) && (irq > 16))
 			continue;
 
-		idata = irq_get_irq_data(irq);
+		desc = irq_to_desc(irq);
+		raw_spin_lock_irq(&desc->lock);
+		idata = irq_desc_get_irq_data(desc);
 
 		/*
 		 * Honour affinities which have been set in early boot
@@ -3636,6 +3639,7 @@ void __init setup_ioapic_dest(void)
 			mask = apic->target_cpus();
 
 		x86_io_apic_ops.set_affinity(idata, mask, false);
+		raw_spin_unlock_irq(&desc->lock);
 	}
 
 }
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 31+ messages in thread

* [PATCH 3.13.y-ckt 10/30] usb: cdc-acm: handle unlinked urb in acm read callback
  2016-02-10 21:41 [3.13.y-ckt stable] Linux 3.13.11-ckt35 stable review Kamal Mostafa
                   ` (8 preceding siblings ...)
  2016-02-10 21:41 ` [PATCH 3.13.y-ckt 09/30] x86/irq: Call chip->irq_set_affinity in proper context Kamal Mostafa
@ 2016-02-10 21:41 ` Kamal Mostafa
  2016-02-10 21:41 ` [PATCH 3.13.y-ckt 11/30] usb: cdc-acm: send zero packet for intel 7260 modem Kamal Mostafa
                   ` (19 subsequent siblings)
  29 siblings, 0 replies; 31+ messages in thread
From: Kamal Mostafa @ 2016-02-10 21:41 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Tang Jian Qiang, Lu Baolu, Greg Kroah-Hartman, Kamal Mostafa

3.13.11-ckt35 -stable review patch.  If anyone has any objections, please let me know.

---8<------------------------------------------------------------

From: Lu Baolu <baolu.lu@linux.intel.com>

commit 19454462acb1bdef80542061bdc9b410e4ed1ff6 upstream.

In current acm driver, the bulk-in callback function ignores the
URBs unlinked in usb core.

This causes unexpected data loss in some cases. For example,
runtime suspend entry will unlinked all urbs and set urb->status
to -ENOENT even those urbs might have data not processed yet.
Hence, data loss occurs.

This patch lets bulk-in callback function handle unlinked urbs
to avoid data loss.

Signed-off-by: Tang Jian Qiang <jianqiang.tang@intel.com>
Signed-off-by: Lu Baolu <baolu.lu@linux.intel.com>
Acked-by: Oliver Neukum <oneukum@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
[ kamal: backport to 3.19-stable: context ]
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 drivers/usb/class/cdc-acm.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/usb/class/cdc-acm.c b/drivers/usb/class/cdc-acm.c
index 87f216d..917cfdc 100644
--- a/drivers/usb/class/cdc-acm.c
+++ b/drivers/usb/class/cdc-acm.c
@@ -399,7 +399,8 @@ static void acm_read_bulk_callback(struct urb *urb)
 	if (urb->status) {
 		dev_dbg(&acm->data->dev, "%s - non-zero urb status: %d\n",
 							__func__, urb->status);
-		return;
+		if ((urb->status != -ENOENT) || (urb->actual_length == 0))
+			return;
 	}
 	acm_process_read_urb(acm, urb);
 
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 31+ messages in thread

* [PATCH 3.13.y-ckt 11/30] usb: cdc-acm: send zero packet for intel 7260 modem
  2016-02-10 21:41 [3.13.y-ckt stable] Linux 3.13.11-ckt35 stable review Kamal Mostafa
                   ` (9 preceding siblings ...)
  2016-02-10 21:41 ` [PATCH 3.13.y-ckt 10/30] usb: cdc-acm: handle unlinked urb in acm read callback Kamal Mostafa
@ 2016-02-10 21:41 ` Kamal Mostafa
  2016-02-10 21:41 ` [PATCH 3.13.y-ckt 12/30] cdc-acm:exclude Samsung phone 04e8:685d Kamal Mostafa
                   ` (18 subsequent siblings)
  29 siblings, 0 replies; 31+ messages in thread
From: Kamal Mostafa @ 2016-02-10 21:41 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Konrad Leszczynski, Lu Baolu, Greg Kroah-Hartman, Kamal Mostafa

3.13.11-ckt35 -stable review patch.  If anyone has any objections, please let me know.

---8<------------------------------------------------------------

From: Lu Baolu <baolu.lu@linux.intel.com>

commit ffdb1e369a73b380fce95b05f8498d92c43842b4 upstream.

For Intel 7260 modem, it is needed for host side to send zero
packet if the BULK OUT size is equal to USB endpoint max packet
length. Otherwise, modem side may still wait for more data and
cannot give response to host side.

Signed-off-by: Konrad Leszczynski <konrad.leszczynski@intel.com>
Signed-off-by: Lu Baolu <baolu.lu@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
[ kamal: backport to 3.13-stable: hardcode BIT(8) ]
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 drivers/usb/class/cdc-acm.c | 6 ++++++
 drivers/usb/class/cdc-acm.h | 1 +
 2 files changed, 7 insertions(+)

diff --git a/drivers/usb/class/cdc-acm.c b/drivers/usb/class/cdc-acm.c
index 917cfdc..9cff159 100644
--- a/drivers/usb/class/cdc-acm.c
+++ b/drivers/usb/class/cdc-acm.c
@@ -1272,6 +1272,8 @@ made_compressed_probe:
 				usb_sndbulkpipe(usb_dev, epwrite->bEndpointAddress),
 				NULL, acm->writesize, acm_write_bulk, snd);
 		snd->urb->transfer_flags |= URB_NO_TRANSFER_DMA_MAP;
+		if (quirks & SEND_ZERO_PACKET)
+			snd->urb->transfer_flags |= URB_ZERO_PACKET;
 		snd->instance = acm;
 	}
 
@@ -1743,6 +1745,10 @@ static const struct usb_device_id acm_ids[] = {
 	{ USB_INTERFACE_INFO(USB_CLASS_COMM, USB_CDC_SUBCLASS_ACM,
 		USB_CDC_ACM_PROTO_AT_CDMA) },
 
+	{ USB_DEVICE(0x1519, 0x0452), /* Intel 7260 modem */
+	.driver_info = SEND_ZERO_PACKET,
+	},
+
 	{ }
 };
 
diff --git a/drivers/usb/class/cdc-acm.h b/drivers/usb/class/cdc-acm.h
index 9c40036..5efb502 100644
--- a/drivers/usb/class/cdc-acm.h
+++ b/drivers/usb/class/cdc-acm.h
@@ -130,3 +130,4 @@ struct acm {
 #define NO_DATA_INTERFACE		16
 #define IGNORE_DEVICE			32
 #define CLEAR_HALT_CONDITIONS		128
+#define SEND_ZERO_PACKET		256
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 31+ messages in thread

* [PATCH 3.13.y-ckt 12/30] cdc-acm:exclude Samsung phone 04e8:685d
  2016-02-10 21:41 [3.13.y-ckt stable] Linux 3.13.11-ckt35 stable review Kamal Mostafa
                   ` (10 preceding siblings ...)
  2016-02-10 21:41 ` [PATCH 3.13.y-ckt 11/30] usb: cdc-acm: send zero packet for intel 7260 modem Kamal Mostafa
@ 2016-02-10 21:41 ` Kamal Mostafa
  2016-02-10 21:41 ` [PATCH 3.13.y-ckt 13/30] usb: hub: do not clear BOS field during reset device Kamal Mostafa
                   ` (17 subsequent siblings)
  29 siblings, 0 replies; 31+ messages in thread
From: Kamal Mostafa @ 2016-02-10 21:41 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Oliver Neukum, Greg Kroah-Hartman, Kamal Mostafa

3.13.11-ckt35 -stable review patch.  If anyone has any objections, please let me know.

---8<------------------------------------------------------------

From: Oliver Neukum <oneukum@suse.com>

commit e912e685f372ab62a2405a1acd923597f524e94a upstream.

This phone needs to be handled by a specialised firmware tool
and is reported to crash irrevocably if cdc-acm takes it.

Signed-off-by: Oliver Neukum <oneukum@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 drivers/usb/class/cdc-acm.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/usb/class/cdc-acm.c b/drivers/usb/class/cdc-acm.c
index 9cff159..81edbac 100644
--- a/drivers/usb/class/cdc-acm.c
+++ b/drivers/usb/class/cdc-acm.c
@@ -1722,6 +1722,11 @@ static const struct usb_device_id acm_ids[] = {
 	},
 #endif
 
+	/*Samsung phone in firmware update mode */
+	{ USB_DEVICE(0x04e8, 0x685d),
+	.driver_info = IGNORE_DEVICE,
+	},
+
 	/* Exclude Infineon Flash Loader utility */
 	{ USB_DEVICE(0x058b, 0x0041),
 	.driver_info = IGNORE_DEVICE,
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 31+ messages in thread

* [PATCH 3.13.y-ckt 13/30] usb: hub: do not clear BOS field during reset device
  2016-02-10 21:41 [3.13.y-ckt stable] Linux 3.13.11-ckt35 stable review Kamal Mostafa
                   ` (11 preceding siblings ...)
  2016-02-10 21:41 ` [PATCH 3.13.y-ckt 12/30] cdc-acm:exclude Samsung phone 04e8:685d Kamal Mostafa
@ 2016-02-10 21:41 ` Kamal Mostafa
  2016-02-10 21:41 ` [PATCH 3.13.y-ckt 14/30] USB: cp210x: add ID for IAI USB to RS485 adaptor Kamal Mostafa
                   ` (16 subsequent siblings)
  29 siblings, 0 replies; 31+ messages in thread
From: Kamal Mostafa @ 2016-02-10 21:41 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Du, Changbin, Greg Kroah-Hartman, Kamal Mostafa

3.13.11-ckt35 -stable review patch.  If anyone has any objections, please let me know.

---8<------------------------------------------------------------

From: "Du, Changbin" <changbin.du@intel.com>

commit d8f00cd685f5c8e0def8593e520a7fef12c22407 upstream.

In function usb_reset_and_verify_device, the old BOS descriptor may
still be used before allocating a new one. (usb_unlocked_disable_lpm
function uses it under the situation that it fails to disable lpm.)
So we cannot set the udev->bos to NULL before that, just keep what it
was. It will be overwrite when allocating a new one.

Crash log:
BUG: unable to handle kernel NULL pointer dereference at
0000000000000010
IP: [<ffffffff8171f98d>] usb_enable_link_state+0x2d/0x2f0
Call Trace:
[<ffffffff8171ed5b>] ? usb_set_lpm_timeout+0x12b/0x140
[<ffffffff8171fcd1>] usb_enable_lpm+0x81/0xa0
[<ffffffff8171fdd8>] usb_disable_lpm+0xa8/0xc0
[<ffffffff8171fe1c>] usb_unlocked_disable_lpm+0x2c/0x50
[<ffffffff81723933>] usb_reset_and_verify_device+0xc3/0x710
[<ffffffff8172c4ed>] ? usb_sg_wait+0x13d/0x190
[<ffffffff81724743>] usb_reset_device+0x133/0x280
[<ffffffff8179ccd1>] usb_stor_port_reset+0x61/0x70
[<ffffffff8179cd68>] usb_stor_invoke_transport+0x88/0x520

Signed-off-by: Du, Changbin <changbin.du@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 drivers/usb/core/hub.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c
index d8ab60d..3a2960f 100644
--- a/drivers/usb/core/hub.c
+++ b/drivers/usb/core/hub.c
@@ -5206,7 +5206,6 @@ static int usb_reset_and_verify_device(struct usb_device *udev)
 	set_bit(port1, parent_hub->busy_bits);
 
 	bos = udev->bos;
-	udev->bos = NULL;
 
 	for (i = 0; i < SET_CONFIG_TRIES; ++i) {
 
@@ -5297,8 +5296,11 @@ done:
 	usb_set_usb2_hardware_lpm(udev, 1);
 	usb_unlocked_enable_lpm(udev);
 	usb_enable_ltm(udev);
-	usb_release_bos_descriptor(udev);
-	udev->bos = bos;
+	/* release the new BOS descriptor allocated  by hub_port_init() */
+	if (udev->bos != bos) {
+		usb_release_bos_descriptor(udev);
+		udev->bos = bos;
+	}
 	return 0;
 
 re_enumerate:
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 31+ messages in thread

* [PATCH 3.13.y-ckt 14/30] USB: cp210x: add ID for IAI USB to RS485 adaptor
  2016-02-10 21:41 [3.13.y-ckt stable] Linux 3.13.11-ckt35 stable review Kamal Mostafa
                   ` (12 preceding siblings ...)
  2016-02-10 21:41 ` [PATCH 3.13.y-ckt 13/30] usb: hub: do not clear BOS field during reset device Kamal Mostafa
@ 2016-02-10 21:41 ` Kamal Mostafa
  2016-02-10 21:41 ` [PATCH 3.13.y-ckt 15/30] USB: visor: fix null-deref at probe Kamal Mostafa
                   ` (15 subsequent siblings)
  29 siblings, 0 replies; 31+ messages in thread
From: Kamal Mostafa @ 2016-02-10 21:41 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Peter Dedecker, Johan Hovold, Kamal Mostafa

3.13.11-ckt35 -stable review patch.  If anyone has any objections, please let me know.

---8<------------------------------------------------------------

From: Peter Dedecker <peter.dedecker@hotmail.com>

commit f487c54ddd544e1c9172cd510954f697b77b76e3 upstream.

Added the USB serial console device ID for IAI Corp. RCB-CV-USB
USB to RS485 adaptor.

Signed-off-by: Peter Dedecker <peter.dedecker@hotmail.com>
Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 drivers/usb/serial/cp210x.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/usb/serial/cp210x.c b/drivers/usb/serial/cp210x.c
index caa08a70..8971c2c 100644
--- a/drivers/usb/serial/cp210x.c
+++ b/drivers/usb/serial/cp210x.c
@@ -98,6 +98,7 @@ static const struct usb_device_id id_table[] = {
 	{ USB_DEVICE(0x10C4, 0x81AC) }, /* MSD Dash Hawk */
 	{ USB_DEVICE(0x10C4, 0x81AD) }, /* INSYS USB Modem */
 	{ USB_DEVICE(0x10C4, 0x81C8) }, /* Lipowsky Industrie Elektronik GmbH, Baby-JTAG */
+	{ USB_DEVICE(0x10C4, 0x81D7) }, /* IAI Corp. RCB-CV-USB USB to RS485 Adaptor */
 	{ USB_DEVICE(0x10C4, 0x81E2) }, /* Lipowsky Industrie Elektronik GmbH, Baby-LIN */
 	{ USB_DEVICE(0x10C4, 0x81E7) }, /* Aerocomm Radio */
 	{ USB_DEVICE(0x10C4, 0x81E8) }, /* Zephyr Bioharness */
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 31+ messages in thread

* [PATCH 3.13.y-ckt 15/30] USB: visor: fix null-deref at probe
  2016-02-10 21:41 [3.13.y-ckt stable] Linux 3.13.11-ckt35 stable review Kamal Mostafa
                   ` (13 preceding siblings ...)
  2016-02-10 21:41 ` [PATCH 3.13.y-ckt 14/30] USB: cp210x: add ID for IAI USB to RS485 adaptor Kamal Mostafa
@ 2016-02-10 21:41 ` Kamal Mostafa
  2016-02-10 21:41 ` [PATCH 3.13.y-ckt 16/30] USB: serial: option: Adding support for Telit LE922 Kamal Mostafa
                   ` (14 subsequent siblings)
  29 siblings, 0 replies; 31+ messages in thread
From: Kamal Mostafa @ 2016-02-10 21:41 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team; +Cc: Johan Hovold, Kamal Mostafa

3.13.11-ckt35 -stable review patch.  If anyone has any objections, please let me know.

---8<------------------------------------------------------------

From: Johan Hovold <johan@kernel.org>

commit cac9b50b0d75a1d50d6c056ff65c005f3224c8e0 upstream.

Fix null-pointer dereference at probe should a (malicious) Treo device
lack the expected endpoints.

Specifically, the Treo port-setup hack was dereferencing the bulk-in and
interrupt-in urbs without first making sure they had been allocated by
core.

Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 drivers/usb/serial/visor.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/usb/serial/visor.c b/drivers/usb/serial/visor.c
index 9c61a86..605068e 100644
--- a/drivers/usb/serial/visor.c
+++ b/drivers/usb/serial/visor.c
@@ -551,6 +551,11 @@ static int treo_attach(struct usb_serial *serial)
 		(serial->num_interrupt_in == 0))
 		return 0;
 
+	if (serial->num_bulk_in < 2 || serial->num_interrupt_in < 2) {
+		dev_err(&serial->interface->dev, "missing endpoints\n");
+		return -ENODEV;
+	}
+
 	/*
 	* It appears that Treos and Kyoceras want to use the
 	* 1st bulk in endpoint to communicate with the 2nd bulk out endpoint,
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 31+ messages in thread

* [PATCH 3.13.y-ckt 16/30] USB: serial: option: Adding support for Telit LE922
  2016-02-10 21:41 [3.13.y-ckt stable] Linux 3.13.11-ckt35 stable review Kamal Mostafa
                   ` (14 preceding siblings ...)
  2016-02-10 21:41 ` [PATCH 3.13.y-ckt 15/30] USB: visor: fix null-deref at probe Kamal Mostafa
@ 2016-02-10 21:41 ` Kamal Mostafa
  2016-02-10 21:41 ` [PATCH 3.13.y-ckt 17/30] ALSA: seq: Fix incorrect sanity check at snd_seq_oss_synth_cleanup() Kamal Mostafa
                   ` (13 subsequent siblings)
  29 siblings, 0 replies; 31+ messages in thread
From: Kamal Mostafa @ 2016-02-10 21:41 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Daniele Palmas, Johan Hovold, Kamal Mostafa

3.13.11-ckt35 -stable review patch.  If anyone has any objections, please let me know.

---8<------------------------------------------------------------

From: Daniele Palmas <dnlplm@gmail.com>

commit ff4e2494dc17b173468e1713fdf6237fd8578bc7 upstream.

This patch adds support for two PIDs of LE922.

Signed-off-by: Daniele Palmas <dnlplm@gmail.com>
Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 drivers/usb/serial/option.c | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c
index f807079..0f78c8d 100644
--- a/drivers/usb/serial/option.c
+++ b/drivers/usb/serial/option.c
@@ -271,6 +271,8 @@ static void option_instat_callback(struct urb *urb);
 #define TELIT_PRODUCT_CC864_SINGLE		0x1006
 #define TELIT_PRODUCT_DE910_DUAL		0x1010
 #define TELIT_PRODUCT_UE910_V2			0x1012
+#define TELIT_PRODUCT_LE922_USBCFG0		0x1042
+#define TELIT_PRODUCT_LE922_USBCFG3		0x1043
 #define TELIT_PRODUCT_LE920			0x1200
 #define TELIT_PRODUCT_LE910			0x1201
 
@@ -630,6 +632,16 @@ static const struct option_blacklist_info sierra_mc73xx_blacklist = {
 	.reserved = BIT(8) | BIT(10) | BIT(11),
 };
 
+static const struct option_blacklist_info telit_le922_blacklist_usbcfg0 = {
+	.sendsetup = BIT(2),
+	.reserved = BIT(0) | BIT(1) | BIT(3),
+};
+
+static const struct option_blacklist_info telit_le922_blacklist_usbcfg3 = {
+	.sendsetup = BIT(0),
+	.reserved = BIT(1) | BIT(2) | BIT(3),
+};
+
 static const struct usb_device_id option_ids[] = {
 	{ USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_COLT) },
 	{ USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_RICOLA) },
@@ -1177,6 +1189,10 @@ static const struct usb_device_id option_ids[] = {
 	{ USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_CC864_SINGLE) },
 	{ USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_DE910_DUAL) },
 	{ USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_UE910_V2) },
+	{ USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_LE922_USBCFG0),
+		.driver_info = (kernel_ulong_t)&telit_le922_blacklist_usbcfg0 },
+	{ USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_LE922_USBCFG3),
+		.driver_info = (kernel_ulong_t)&telit_le922_blacklist_usbcfg3 },
 	{ USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_LE910),
 		.driver_info = (kernel_ulong_t)&telit_le910_blacklist },
 	{ USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_LE920),
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 31+ messages in thread

* [PATCH 3.13.y-ckt 17/30] ALSA: seq: Fix incorrect sanity check at snd_seq_oss_synth_cleanup()
  2016-02-10 21:41 [3.13.y-ckt stable] Linux 3.13.11-ckt35 stable review Kamal Mostafa
                   ` (15 preceding siblings ...)
  2016-02-10 21:41 ` [PATCH 3.13.y-ckt 16/30] USB: serial: option: Adding support for Telit LE922 Kamal Mostafa
@ 2016-02-10 21:41 ` Kamal Mostafa
  2016-02-10 21:41 ` [PATCH 3.13.y-ckt 18/30] ALSA: seq: Degrade the error message for too many opens Kamal Mostafa
                   ` (12 subsequent siblings)
  29 siblings, 0 replies; 31+ messages in thread
From: Kamal Mostafa @ 2016-02-10 21:41 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team; +Cc: Takashi Iwai, Kamal Mostafa

3.13.11-ckt35 -stable review patch.  If anyone has any objections, please let me know.

---8<------------------------------------------------------------

From: Takashi Iwai <tiwai@suse.de>

commit 599151336638d57b98d92338aa59c048e3a3e97d upstream.

ALSA sequencer OSS emulation code has a sanity check for currently
opened devices, but there is a thinko there, eventually it spews
warnings and skips the operation wrongly like:
  WARNING: CPU: 1 PID: 7573 at sound/core/seq/oss/seq_oss_synth.c:311

Fix this off-by-one error.

Reported-by: Dmitry Vyukov <dvyukov@google.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 sound/core/seq/oss/seq_oss_synth.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/core/seq/oss/seq_oss_synth.c b/sound/core/seq/oss/seq_oss_synth.c
index c5b773a..4a09c30 100644
--- a/sound/core/seq/oss/seq_oss_synth.c
+++ b/sound/core/seq/oss/seq_oss_synth.c
@@ -310,7 +310,7 @@ snd_seq_oss_synth_cleanup(struct seq_oss_devinfo *dp)
 	struct seq_oss_synth *rec;
 	struct seq_oss_synthinfo *info;
 
-	if (snd_BUG_ON(dp->max_synthdev >= SNDRV_SEQ_OSS_MAX_SYNTH_DEVS))
+	if (snd_BUG_ON(dp->max_synthdev > SNDRV_SEQ_OSS_MAX_SYNTH_DEVS))
 		return;
 	for (i = 0; i < dp->max_synthdev; i++) {
 		info = &dp->synths[i];
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 31+ messages in thread

* [PATCH 3.13.y-ckt 18/30] ALSA: seq: Degrade the error message for too many opens
  2016-02-10 21:41 [3.13.y-ckt stable] Linux 3.13.11-ckt35 stable review Kamal Mostafa
                   ` (16 preceding siblings ...)
  2016-02-10 21:41 ` [PATCH 3.13.y-ckt 17/30] ALSA: seq: Fix incorrect sanity check at snd_seq_oss_synth_cleanup() Kamal Mostafa
@ 2016-02-10 21:41 ` Kamal Mostafa
  2016-02-10 21:41 ` [PATCH 3.13.y-ckt 19/30] USB: serial: ftdi_sio: add support for Yaesu SCU-18 cable Kamal Mostafa
                   ` (11 subsequent siblings)
  29 siblings, 0 replies; 31+ messages in thread
From: Kamal Mostafa @ 2016-02-10 21:41 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team; +Cc: Takashi Iwai, Kamal Mostafa

3.13.11-ckt35 -stable review patch.  If anyone has any objections, please let me know.

---8<------------------------------------------------------------

From: Takashi Iwai <tiwai@suse.de>

commit da10816e3d923565b470fec78a674baba794ed33 upstream.

ALSA OSS sequencer spews a kernel error message ("ALSA: seq_oss: too
many applications") when user-space tries to open more than the
limit.  This means that it can easily fill the log buffer.

Since it's merely a normal error, it's safe to suppress it via
pr_debug() instead.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
[ kamal: backport to 3.13-stable: context ]
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 sound/core/seq/oss/seq_oss_init.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/core/seq/oss/seq_oss_init.c b/sound/core/seq/oss/seq_oss_init.c
index b3f39b5..caa68d5 100644
--- a/sound/core/seq/oss/seq_oss_init.c
+++ b/sound/core/seq/oss/seq_oss_init.c
@@ -206,7 +206,7 @@ snd_seq_oss_open(struct file *file, int level)
 
 	dp->index = i;
 	if (i >= SNDRV_SEQ_OSS_MAX_CLIENTS) {
-		snd_printk(KERN_ERR "too many applications\n");
+		snd_printk(KERN_DEBUG "too many applications\n");
 		rc = -ENOMEM;
 		goto _error;
 	}
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 31+ messages in thread

* [PATCH 3.13.y-ckt 19/30] USB: serial: ftdi_sio: add support for Yaesu SCU-18 cable
  2016-02-10 21:41 [3.13.y-ckt stable] Linux 3.13.11-ckt35 stable review Kamal Mostafa
                   ` (17 preceding siblings ...)
  2016-02-10 21:41 ` [PATCH 3.13.y-ckt 18/30] ALSA: seq: Degrade the error message for too many opens Kamal Mostafa
@ 2016-02-10 21:41 ` Kamal Mostafa
  2016-02-10 21:41 ` [PATCH 3.13.y-ckt 20/30] USB: option: fix Cinterion AHxx enumeration Kamal Mostafa
                   ` (10 subsequent siblings)
  29 siblings, 0 replies; 31+ messages in thread
From: Kamal Mostafa @ 2016-02-10 21:41 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Greg Kroah-Hartman, Johan Hovold, Kamal Mostafa

3.13.11-ckt35 -stable review patch.  If anyone has any objections, please let me know.

---8<------------------------------------------------------------

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

commit e03cdf22a2727c60307be6a729233edab3bfda9c upstream.

Harald Linden reports that the ftdi_sio driver works properly for the
Yaesu SCU-18 cable if the device ids are added to the driver.  So let's
add them.

Reported-by: Harald Linden <harald.linden@7183.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 drivers/usb/serial/ftdi_sio.c     | 1 +
 drivers/usb/serial/ftdi_sio_ids.h | 1 +
 2 files changed, 2 insertions(+)

diff --git a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c
index 50505a8..811bbd9 100644
--- a/drivers/usb/serial/ftdi_sio.c
+++ b/drivers/usb/serial/ftdi_sio.c
@@ -838,6 +838,7 @@ static struct usb_device_id id_table_combined [] = {
 	{ USB_DEVICE(FTDI_VID, FTDI_TURTELIZER_PID),
 		.driver_info = (kernel_ulong_t)&ftdi_jtag_quirk },
 	{ USB_DEVICE(RATOC_VENDOR_ID, RATOC_PRODUCT_ID_USB60F) },
+	{ USB_DEVICE(RATOC_VENDOR_ID, RATOC_PRODUCT_ID_SCU18) },
 	{ USB_DEVICE(FTDI_VID, FTDI_REU_TINY_PID) },
 
 	/* Papouch devices based on FTDI chip */
diff --git a/drivers/usb/serial/ftdi_sio_ids.h b/drivers/usb/serial/ftdi_sio_ids.h
index 2943b97..7850071 100644
--- a/drivers/usb/serial/ftdi_sio_ids.h
+++ b/drivers/usb/serial/ftdi_sio_ids.h
@@ -615,6 +615,7 @@
  */
 #define RATOC_VENDOR_ID		0x0584
 #define RATOC_PRODUCT_ID_USB60F	0xb020
+#define RATOC_PRODUCT_ID_SCU18	0xb03a
 
 /*
  * Infineon Technologies
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 31+ messages in thread

* [PATCH 3.13.y-ckt 20/30] USB: option: fix Cinterion AHxx enumeration
  2016-02-10 21:41 [3.13.y-ckt stable] Linux 3.13.11-ckt35 stable review Kamal Mostafa
                   ` (18 preceding siblings ...)
  2016-02-10 21:41 ` [PATCH 3.13.y-ckt 19/30] USB: serial: ftdi_sio: add support for Yaesu SCU-18 cable Kamal Mostafa
@ 2016-02-10 21:41 ` Kamal Mostafa
  2016-02-10 21:41 ` [PATCH 3.13.y-ckt 21/30] ALSA: compress: Disable GET_CODEC_CAPS ioctl for some architectures Kamal Mostafa
                   ` (9 subsequent siblings)
  29 siblings, 0 replies; 31+ messages in thread
From: Kamal Mostafa @ 2016-02-10 21:41 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: John Ernberg, Johan Hovold, Kamal Mostafa

3.13.11-ckt35 -stable review patch.  If anyone has any objections, please let me know.

---8<------------------------------------------------------------

From: John Ernberg <john.ernberg@actia.se>

commit 4152b387da81617c80cb2946b2d56e3958906b3e upstream.

In certain kernel configurations where the cdc_ether and option drivers
are compiled as modules there can occur a race condition in enumeration.
This causes the option driver to enumerate the ethernet(wwan) interface
as usb-serial interfaces.

usb-devices output for the modem:
T:  Bus=01 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#=  5 Spd=480 MxCh= 0
D:  Ver= 2.00 Cls=ef(misc ) Sub=02 Prot=01 MxPS=64 #Cfgs=  1
P:  Vendor=1e2d ProdID=0055 Rev=00.00
S:  Manufacturer=Cinterion
S:  Product=AHx
C:  #Ifs= 6 Cfg#= 1 Atr=e0 MxPwr=10mA
I:  If#= 0 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=option
I:  If#= 1 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=option
I:  If#= 2 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=option
I:  If#= 3 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=ff Driver=option
I:  If#= 4 Alt= 0 #EPs= 1 Cls=02(commc) Sub=06 Prot=00 Driver=cdc_ether
I:  If#= 5 Alt= 1 #EPs= 2 Cls=0a(data ) Sub=00 Prot=00 Driver=cdc_ether

Signed-off-by: John Ernberg <john.ernberg@actia.se>
Fixes: 1941138e1c02 ("USB: added support for Cinterion's products...")
Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 drivers/usb/serial/option.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c
index 0f78c8d..1f193fd 100644
--- a/drivers/usb/serial/option.c
+++ b/drivers/usb/serial/option.c
@@ -1704,7 +1704,7 @@ static const struct usb_device_id option_ids[] = {
 	{ USB_DEVICE(CINTERION_VENDOR_ID, CINTERION_PRODUCT_EU3_P) },
 	{ USB_DEVICE(CINTERION_VENDOR_ID, CINTERION_PRODUCT_PH8),
 		.driver_info = (kernel_ulong_t)&net_intf4_blacklist },
-	{ USB_DEVICE(CINTERION_VENDOR_ID, CINTERION_PRODUCT_AHXX) },
+	{ USB_DEVICE_INTERFACE_CLASS(CINTERION_VENDOR_ID, CINTERION_PRODUCT_AHXX, 0xff) },
 	{ USB_DEVICE(CINTERION_VENDOR_ID, CINTERION_PRODUCT_PLXX),
 		.driver_info = (kernel_ulong_t)&net_intf4_blacklist },
 	{ USB_DEVICE(CINTERION_VENDOR_ID, CINTERION_PRODUCT_HC28_MDM) }, 
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 31+ messages in thread

* [PATCH 3.13.y-ckt 21/30] ALSA: compress: Disable GET_CODEC_CAPS ioctl for some architectures
  2016-02-10 21:41 [3.13.y-ckt stable] Linux 3.13.11-ckt35 stable review Kamal Mostafa
                   ` (19 preceding siblings ...)
  2016-02-10 21:41 ` [PATCH 3.13.y-ckt 20/30] USB: option: fix Cinterion AHxx enumeration Kamal Mostafa
@ 2016-02-10 21:41 ` Kamal Mostafa
  2016-02-10 21:42 ` [PATCH 3.13.y-ckt 22/30] ALSA: usb-audio: Fix TEAC UD-501/UD-503/NT-503 usb delay Kamal Mostafa
                   ` (8 subsequent siblings)
  29 siblings, 0 replies; 31+ messages in thread
From: Kamal Mostafa @ 2016-02-10 21:41 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team; +Cc: Takashi Iwai, Kamal Mostafa

3.13.11-ckt35 -stable review patch.  If anyone has any objections, please let me know.

---8<------------------------------------------------------------

From: Takashi Iwai <tiwai@suse.de>

commit 462b3f161beb62eeb290f4ec52f5ead29a2f8ac7 upstream.

Some architectures like PowerPC can handle the maximum struct size in
an ioctl only up to 13 bits, and struct snd_compr_codec_caps used by
SNDRV_COMPRESS_GET_CODEC_CAPS ioctl overflows this limit.  This
problem was revealed recently by a powerpc change, as it's now treated
as a fatal build error.

This patch is a stop-gap for that: for architectures with less than 14
bit ioctl struct size, get rid of the handling of the relevant ioctl.
We should provide an alternative equivalent ioctl code later, but for
now just paper over it.  Luckily, the compress API hasn't been used on
such architectures, so the impact must be effectively zero.

Reviewed-by: Mark Brown <broonie@kernel.org>
Acked-by: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 sound/core/compress_offload.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/sound/core/compress_offload.c b/sound/core/compress_offload.c
index 85fde7e..4983f30 100644
--- a/sound/core/compress_offload.c
+++ b/sound/core/compress_offload.c
@@ -44,6 +44,13 @@
 #include <sound/compress_offload.h>
 #include <sound/compress_driver.h>
 
+/* struct snd_compr_codec_caps overflows the ioctl bit size for some
+ * architectures, so we need to disable the relevant ioctls.
+ */
+#if _IOC_SIZEBITS < 14
+#define COMPR_CODEC_CAPS_OVERFLOW
+#endif
+
 /* TODO:
  * - add substream support for multiple devices in case of
  *	SND_DYNAMIC_MINORS is not used
@@ -438,6 +445,7 @@ out:
 	return retval;
 }
 
+#ifndef COMPR_CODEC_CAPS_OVERFLOW
 static int
 snd_compr_get_codec_caps(struct snd_compr_stream *stream, unsigned long arg)
 {
@@ -461,6 +469,7 @@ out:
 	kfree(caps);
 	return retval;
 }
+#endif /* !COMPR_CODEC_CAPS_OVERFLOW */
 
 /* revisit this with snd_pcm_preallocate_xxx */
 static int snd_compr_allocate_buffer(struct snd_compr_stream *stream,
@@ -802,9 +811,11 @@ static long snd_compr_ioctl(struct file *f, unsigned int cmd, unsigned long arg)
 	case _IOC_NR(SNDRV_COMPRESS_GET_CAPS):
 		retval = snd_compr_get_caps(stream, arg);
 		break;
+#ifndef COMPR_CODEC_CAPS_OVERFLOW
 	case _IOC_NR(SNDRV_COMPRESS_GET_CODEC_CAPS):
 		retval = snd_compr_get_codec_caps(stream, arg);
 		break;
+#endif
 	case _IOC_NR(SNDRV_COMPRESS_SET_PARAMS):
 		retval = snd_compr_set_params(stream, arg);
 		break;
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 31+ messages in thread

* [PATCH 3.13.y-ckt 22/30] ALSA: usb-audio: Fix TEAC UD-501/UD-503/NT-503 usb delay
  2016-02-10 21:41 [3.13.y-ckt stable] Linux 3.13.11-ckt35 stable review Kamal Mostafa
                   ` (20 preceding siblings ...)
  2016-02-10 21:41 ` [PATCH 3.13.y-ckt 21/30] ALSA: compress: Disable GET_CODEC_CAPS ioctl for some architectures Kamal Mostafa
@ 2016-02-10 21:42 ` Kamal Mostafa
  2016-02-10 21:42 ` [PATCH 3.13.y-ckt 23/30] arm64: errata: Add -mpc-relative-literal-loads to build flags Kamal Mostafa
                   ` (7 subsequent siblings)
  29 siblings, 0 replies; 31+ messages in thread
From: Kamal Mostafa @ 2016-02-10 21:42 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Guillaume Fougnies, Takashi Iwai, Kamal Mostafa

3.13.11-ckt35 -stable review patch.  If anyone has any objections, please let me know.

---8<------------------------------------------------------------

From: Guillaume Fougnies <guillaume@eulerian.com>

commit 5a4ff9ec8d6edd2ab1cfe8ce6a080d6e57cbea9a upstream.

TEAC UD-501/UD-503/NT-503 fail to switch properly between different
rate/format. Similar to 'Playback Design', this patch corrects the
invalid clock source error for TEAC products and avoids complete
freeze of the usb interface of 503 series.

Signed-off-by: Guillaume Fougnies <guillaume@eulerian.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 sound/usb/quirks.c | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/sound/usb/quirks.c b/sound/usb/quirks.c
index c3af0ce..44a04f3 100644
--- a/sound/usb/quirks.c
+++ b/sound/usb/quirks.c
@@ -1113,8 +1113,12 @@ void snd_usb_set_interface_quirk(struct usb_device *dev)
 	 * "Playback Design" products need a 50ms delay after setting the
 	 * USB interface.
 	 */
-	if (le16_to_cpu(dev->descriptor.idVendor) == 0x23ba)
+	switch (le16_to_cpu(dev->descriptor.idVendor)) {
+	case 0x23ba: /* Playback Design */
+	case 0x0644: /* TEAC Corp. */
 		mdelay(50);
+		break;
+	}
 }
 
 void snd_usb_ctl_msg_quirk(struct usb_device *dev, unsigned int pipe,
@@ -1129,6 +1133,14 @@ void snd_usb_ctl_msg_quirk(struct usb_device *dev, unsigned int pipe,
 	    (requesttype & USB_TYPE_MASK) == USB_TYPE_CLASS)
 		mdelay(20);
 
+	/*
+	 * "TEAC Corp." products need a 20ms delay after each
+	 * class compliant request
+	 */
+	if ((le16_to_cpu(dev->descriptor.idVendor) == 0x0644) &&
+	    (requesttype & USB_TYPE_MASK) == USB_TYPE_CLASS)
+		mdelay(20);
+
 	/* Marantz/Denon devices with USB DAC functionality need a delay
 	 * after each class compliant request
 	 */
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 31+ messages in thread

* [PATCH 3.13.y-ckt 23/30] arm64: errata: Add -mpc-relative-literal-loads to build flags
  2016-02-10 21:41 [3.13.y-ckt stable] Linux 3.13.11-ckt35 stable review Kamal Mostafa
                   ` (21 preceding siblings ...)
  2016-02-10 21:42 ` [PATCH 3.13.y-ckt 22/30] ALSA: usb-audio: Fix TEAC UD-501/UD-503/NT-503 usb delay Kamal Mostafa
@ 2016-02-10 21:42 ` Kamal Mostafa
  2016-02-10 21:42 ` [PATCH 3.13.y-ckt 24/30] SCSI: fix crashes in sd and sr runtime PM Kamal Mostafa
                   ` (6 subsequent siblings)
  29 siblings, 0 replies; 31+ messages in thread
From: Kamal Mostafa @ 2016-02-10 21:42 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Dann Frazier, Will Deacon, Kamal Mostafa

3.13.11-ckt35 -stable review patch.  If anyone has any objections, please let me know.

---8<------------------------------------------------------------

From: dann frazier <dann.frazier@canonical.com>

commit 67dfa1751ce71e629aad7c438e1678ad41054677 upstream.

GCC6 (and Linaro's 2015.12 snapshot of GCC5) has a new default that uses
adrp/ldr or adrp/add to address literal pools. When CONFIG_ARM64_ERRATUM_843419
is enabled, modules built with this toolchain fail to load:

  module libahci: unsupported RELA relocation: 275

This patch fixes the problem by passing '-mpc-relative-literal-loads'
to the compiler.

Fixes: df057cc7b4fa ("arm64: errata: add module build workaround for erratum #843419")
BugLink: http://bugs.launchpad.net/bugs/1533009
Acked-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Suggested-by: Christophe Lyon <christophe.lyon@linaro.org>
Signed-off-by: Dann Frazier <dann.frazier@canonical.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 arch/arm64/Makefile | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm64/Makefile b/arch/arm64/Makefile
index dcc2685..7167963 100644
--- a/arch/arm64/Makefile
+++ b/arch/arm64/Makefile
@@ -20,6 +20,7 @@ LIBGCC 		:= $(shell $(CC) $(KBUILD_CFLAGS) -print-libgcc-file-name)
 KBUILD_DEFCONFIG := defconfig
 
 KBUILD_CFLAGS	+= -mgeneral-regs-only
+KBUILD_CFLAGS	+= $(call cc-option, -mpc-relative-literal-loads)
 ifeq ($(CONFIG_CPU_BIG_ENDIAN), y)
 KBUILD_CPPFLAGS	+= -mbig-endian
 AS		+= -EB
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 31+ messages in thread

* [PATCH 3.13.y-ckt 24/30] SCSI: fix crashes in sd and sr runtime PM
  2016-02-10 21:41 [3.13.y-ckt stable] Linux 3.13.11-ckt35 stable review Kamal Mostafa
                   ` (22 preceding siblings ...)
  2016-02-10 21:42 ` [PATCH 3.13.y-ckt 23/30] arm64: errata: Add -mpc-relative-literal-loads to build flags Kamal Mostafa
@ 2016-02-10 21:42 ` Kamal Mostafa
  2016-02-10 21:42 ` [PATCH 3.13.y-ckt 25/30] n_tty: Fix unsafe reference to "other" ldisc Kamal Mostafa
                   ` (5 subsequent siblings)
  29 siblings, 0 replies; 31+ messages in thread
From: Kamal Mostafa @ 2016-02-10 21:42 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Alan Stern, James Bottomley, Kamal Mostafa

3.13.11-ckt35 -stable review patch.  If anyone has any objections, please let me know.

---8<------------------------------------------------------------

From: Alan Stern <stern@rowland.harvard.edu>

commit 13b4389143413a1f18127c07f72c74cad5b563e8 upstream.

Runtime suspend during driver probe and removal can cause problems.
The driver's runtime_suspend or runtime_resume callbacks may invoked
before the driver has finished binding to the device or after the
driver has unbound from the device.

This problem shows up with the sd and sr drivers, and can cause disk
or CD/DVD drives to become unusable as a result.  The fix is simple.
The drivers store a pointer to the scsi_disk or scsi_cd structure as
their private device data when probing is finished, so we simply have
to be sure to clear the private data during removal and test it during
runtime suspend/resume.

This fixes <https://bugs.debian.org/801925>.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Reported-by: Paul Menzel <paul.menzel@giantmonkey.de>
Reported-by: Erich Schubert <erich@debian.org>
Reported-by: Alexandre Rossi <alexandre.rossi@gmail.com>
Tested-by: Paul Menzel <paul.menzel@giantmonkey.de>
Tested-by: Erich Schubert <erich@debian.org>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 drivers/scsi/sd.c | 7 +++++--
 drivers/scsi/sr.c | 4 ++++
 2 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c
index 6e26021..7fee8c0 100644
--- a/drivers/scsi/sd.c
+++ b/drivers/scsi/sd.c
@@ -3134,8 +3134,8 @@ static int sd_suspend_common(struct device *dev, bool ignore_stop_errors)
 	struct scsi_disk *sdkp = scsi_disk_get_from_dev(dev);
 	int ret = 0;
 
-	if (!sdkp)
-		return 0;	/* this can happen */
+	if (!sdkp)	/* E.g.: runtime suspend following sd_remove() */
+		return 0;
 
 	if (sdkp->WCE && sdkp->media_present) {
 		sd_printk(KERN_NOTICE, sdkp, "Synchronizing SCSI cache\n");
@@ -3176,6 +3176,9 @@ static int sd_resume(struct device *dev)
 	struct scsi_disk *sdkp = scsi_disk_get_from_dev(dev);
 	int ret = 0;
 
+	if (!sdkp)	/* E.g.: runtime resume at the start of sd_probe() */
+		return 0;
+
 	if (!sdkp->device->manage_start_stop)
 		goto done;
 
diff --git a/drivers/scsi/sr.c b/drivers/scsi/sr.c
index 119d67f..1ac9943 100644
--- a/drivers/scsi/sr.c
+++ b/drivers/scsi/sr.c
@@ -142,6 +142,9 @@ static int sr_runtime_suspend(struct device *dev)
 {
 	struct scsi_cd *cd = dev_get_drvdata(dev);
 
+	if (!cd)	/* E.g.: runtime suspend following sr_remove() */
+		return 0;
+
 	if (cd->media_present)
 		return -EBUSY;
 	else
@@ -1006,6 +1009,7 @@ static int sr_remove(struct device *dev)
 
 	blk_queue_prep_rq(cd->device->request_queue, scsi_prep_fn);
 	del_gendisk(cd->disk);
+	dev_set_drvdata(dev, NULL);
 
 	mutex_lock(&sr_ref_mutex);
 	kref_put(&cd->kref, sr_kref_release);
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 31+ messages in thread

* [PATCH 3.13.y-ckt 25/30] n_tty: Fix unsafe reference to "other" ldisc
  2016-02-10 21:41 [3.13.y-ckt stable] Linux 3.13.11-ckt35 stable review Kamal Mostafa
                   ` (23 preceding siblings ...)
  2016-02-10 21:42 ` [PATCH 3.13.y-ckt 24/30] SCSI: fix crashes in sd and sr runtime PM Kamal Mostafa
@ 2016-02-10 21:42 ` Kamal Mostafa
  2016-02-10 21:42 ` [PATCH 3.13.y-ckt 26/30] ALSA: dummy: Disable switching timer backend via sysfs Kamal Mostafa
                   ` (4 subsequent siblings)
  29 siblings, 0 replies; 31+ messages in thread
From: Kamal Mostafa @ 2016-02-10 21:42 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Peter Hurley, Greg Kroah-Hartman, Kamal Mostafa

3.13.11-ckt35 -stable review patch.  If anyone has any objections, please let me know.

---8<------------------------------------------------------------

From: Peter Hurley <peter@hurleysoftware.com>

commit 6d27a63caad3f13e96cf065d2d96828c2006be6b upstream.

Although n_tty_check_unthrottle() has a valid ldisc reference (since
the tty core gets the ldisc ref in tty_read() before calling the line
discipline read() method), it does not have a valid ldisc reference to
the "other" pty of a pty pair. Since getting an ldisc reference for
tty->link essentially open-codes tty_wakeup(), just replace with the
equivalent tty_wakeup().

Signed-off-by: Peter Hurley <peter@hurleysoftware.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
[ kamal: backport to 3.13-stable: context ]
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 drivers/tty/n_tty.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/tty/n_tty.c b/drivers/tty/n_tty.c
index efc4075..9238ce9 100644
--- a/drivers/tty/n_tty.c
+++ b/drivers/tty/n_tty.c
@@ -276,15 +276,13 @@ static void n_tty_check_throttle(struct tty_struct *tty)
 
 static void n_tty_check_unthrottle(struct tty_struct *tty)
 {
-	if (tty->driver->type == TTY_DRIVER_TYPE_PTY &&
-	    tty->link->ldisc->ops->write_wakeup == n_tty_write_wakeup) {
+	if (tty->driver->type == TTY_DRIVER_TYPE_PTY) {
 		if (chars_in_buffer(tty) > TTY_THRESHOLD_UNTHROTTLE)
 			return;
 		if (!tty->count)
 			return;
 		n_tty_set_room(tty);
-		n_tty_write_wakeup(tty->link);
-		wake_up_interruptible_poll(&tty->link->write_wait, POLLOUT);
+		tty_wakeup(tty->link);
 		return;
 	}
 
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 31+ messages in thread

* [PATCH 3.13.y-ckt 26/30] ALSA: dummy: Disable switching timer backend via sysfs
  2016-02-10 21:41 [3.13.y-ckt stable] Linux 3.13.11-ckt35 stable review Kamal Mostafa
                   ` (24 preceding siblings ...)
  2016-02-10 21:42 ` [PATCH 3.13.y-ckt 25/30] n_tty: Fix unsafe reference to "other" ldisc Kamal Mostafa
@ 2016-02-10 21:42 ` Kamal Mostafa
  2016-02-10 21:42 ` [PATCH 3.13.y-ckt 27/30] drm/vmwgfx: respect 'nomodeset' Kamal Mostafa
                   ` (3 subsequent siblings)
  29 siblings, 0 replies; 31+ messages in thread
From: Kamal Mostafa @ 2016-02-10 21:42 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team; +Cc: Takashi Iwai, Kamal Mostafa

3.13.11-ckt35 -stable review patch.  If anyone has any objections, please let me know.

---8<------------------------------------------------------------

From: Takashi Iwai <tiwai@suse.de>

commit 7ee96216c31aabe1eb42fb91ff50dae9fcd014b2 upstream.

ALSA dummy driver can switch the timer backend between system timer
and hrtimer via its hrtimer module option.  This can be also switched
dynamically via sysfs, but it may lead to a memory corruption when
switching is done while a PCM stream is running; the stream instance
for the newly switched timer method tries to access the memory that
was allocated by another timer method although the sizes differ.

As the simplest fix, this patch just disables the switch via sysfs by
dropping the writable bit.

BugLink: http://lkml.kernel.org/r/CACT4Y+ZGEeEBntHW5WHn2GoeE0G_kRrCmUh6=dWyy-wfzvuJLg@mail.gmail.com
Reported-by: Dmitry Vyukov <dvyukov@google.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 sound/drivers/dummy.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/drivers/dummy.c b/sound/drivers/dummy.c
index 915b4d7..f4d626c 100644
--- a/sound/drivers/dummy.c
+++ b/sound/drivers/dummy.c
@@ -87,7 +87,7 @@ MODULE_PARM_DESC(pcm_substreams, "PCM substreams # (1-128) for dummy driver.");
 module_param(fake_buffer, bool, 0444);
 MODULE_PARM_DESC(fake_buffer, "Fake buffer allocations.");
 #ifdef CONFIG_HIGH_RES_TIMERS
-module_param(hrtimer, bool, 0644);
+module_param(hrtimer, bool, 0444);
 MODULE_PARM_DESC(hrtimer, "Use hrtimer as the timer source.");
 #endif
 
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 31+ messages in thread

* [PATCH 3.13.y-ckt 27/30] drm/vmwgfx: respect 'nomodeset'
  2016-02-10 21:41 [3.13.y-ckt stable] Linux 3.13.11-ckt35 stable review Kamal Mostafa
                   ` (25 preceding siblings ...)
  2016-02-10 21:42 ` [PATCH 3.13.y-ckt 26/30] ALSA: dummy: Disable switching timer backend via sysfs Kamal Mostafa
@ 2016-02-10 21:42 ` Kamal Mostafa
  2016-02-10 21:42 ` [PATCH 3.13.y-ckt 28/30] x86/mm/pat: Avoid truncation when converting cpa->numpages to address Kamal Mostafa
                   ` (2 subsequent siblings)
  29 siblings, 0 replies; 31+ messages in thread
From: Kamal Mostafa @ 2016-02-10 21:42 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team; +Cc: Rob Clark, Dave Airlie, Kamal Mostafa

3.13.11-ckt35 -stable review patch.  If anyone has any objections, please let me know.

---8<------------------------------------------------------------

From: Rob Clark <robdclark@gmail.com>

commit 96c5d076f0a5e2023ecdb44d8261f87641ee71e0 upstream.

Signed-off-by: Rob Clark <robdclark@gmail.com>
Reviewed-by: Thomas Hellstrom <thellstrom@vmware.com>.
Signed-off-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 drivers/gpu/drm/vmwgfx/vmwgfx_drv.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c
index 6c792f7..d5a22de 100644
--- a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c
@@ -25,6 +25,7 @@
  *
  **************************************************************************/
 #include <linux/module.h>
+#include <linux/console.h>
 
 #include <drm/drmP.h>
 #include "vmwgfx_drv.h"
@@ -1290,6 +1291,12 @@ static int vmw_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 static int __init vmwgfx_init(void)
 {
 	int ret;
+
+#ifdef CONFIG_VGA_CONSOLE
+	if (vgacon_text_force())
+		return -EINVAL;
+#endif
+
 	ret = drm_pci_init(&driver, &vmw_pci_driver);
 	if (ret)
 		DRM_ERROR("Failed initializing DRM.\n");
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 31+ messages in thread

* [PATCH 3.13.y-ckt 28/30] x86/mm/pat: Avoid truncation when converting cpa->numpages to address
  2016-02-10 21:41 [3.13.y-ckt stable] Linux 3.13.11-ckt35 stable review Kamal Mostafa
                   ` (26 preceding siblings ...)
  2016-02-10 21:42 ` [PATCH 3.13.y-ckt 27/30] drm/vmwgfx: respect 'nomodeset' Kamal Mostafa
@ 2016-02-10 21:42 ` Kamal Mostafa
  2016-02-10 21:42 ` [PATCH 3.13.y-ckt 29/30] perf annotate browser: Fix behaviour of Shift-Tab with nothing focussed Kamal Mostafa
  2016-02-10 21:42 ` [PATCH 3.13.y-ckt 30/30] powerpc/perf: Remove PPMU_HAS_SSLOT flag for Power8 Kamal Mostafa
  29 siblings, 0 replies; 31+ messages in thread
From: Kamal Mostafa @ 2016-02-10 21:42 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Sai Praneeth Prakhya, Matt Fleming, Thomas Gleixner, Kamal Mostafa

3.13.11-ckt35 -stable review patch.  If anyone has any objections, please let me know.

---8<------------------------------------------------------------

From: Matt Fleming <matt@codeblueprint.co.uk>

commit 742563777e8da62197d6cb4b99f4027f59454735 upstream.

There are a couple of nasty truncation bugs lurking in the pageattr
code that can be triggered when mapping EFI regions, e.g. when we pass
a cpa->pgd pointer. Because cpa->numpages is a 32-bit value, shifting
left by PAGE_SHIFT will truncate the resultant address to 32-bits.

Viorel-Cătălin managed to trigger this bug on his Dell machine that
provides a ~5GB EFI region which requires 1236992 pages to be mapped.
When calling populate_pud() the end of the region gets calculated
incorrectly in the following buggy expression,

  end = start + (cpa->numpages << PAGE_SHIFT);

And only 188416 pages are mapped. Next, populate_pud() gets invoked
for a second time because of the loop in __change_page_attr_set_clr(),
only this time no pages get mapped because shifting the remaining
number of pages (1048576) by PAGE_SHIFT is zero. At which point the
loop in __change_page_attr_set_clr() spins forever because we fail to
map progress.

Hitting this bug depends very much on the virtual address we pick to
map the large region at and how many pages we map on the initial run
through the loop. This explains why this issue was only recently hit
with the introduction of commit

  a5caa209ba9c ("x86/efi: Fix boot crash by mapping EFI memmap
   entries bottom-up at runtime, instead of top-down")

It's interesting to note that safe uses of cpa->numpages do exist in
the pageattr code. If instead of shifting ->numpages we multiply by
PAGE_SIZE, no truncation occurs because PAGE_SIZE is a UL value, and
so the result is unsigned long.

To avoid surprises when users try to convert very large cpa->numpages
values to addresses, change the data type from 'int' to 'unsigned
long', thereby making it suitable for shifting by PAGE_SHIFT without
any type casting.

The alternative would be to make liberal use of casting, but that is
far more likely to cause problems in the future when someone adds more
code and fails to cast properly; this bug was difficult enough to
track down in the first place.

Reported-and-tested-by: Viorel-Cătălin Răpițeanu <rapiteanu.catalin@gmail.com>
Acked-by: Borislav Petkov <bp@alien8.de>
Cc: Sai Praneeth Prakhya <sai.praneeth.prakhya@intel.com>
Signed-off-by: Matt Fleming <matt@codeblueprint.co.uk>
Link: https://bugzilla.kernel.org/show_bug.cgi?id=110131
Link: http://lkml.kernel.org/r/1454067370-10374-1-git-send-email-matt@codeblueprint.co.uk
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 arch/x86/mm/pageattr.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/x86/mm/pageattr.c b/arch/x86/mm/pageattr.c
index aabdf76..0fcd960 100644
--- a/arch/x86/mm/pageattr.c
+++ b/arch/x86/mm/pageattr.c
@@ -32,7 +32,7 @@ struct cpa_data {
 	unsigned long	*vaddr;
 	pgprot_t	mask_set;
 	pgprot_t	mask_clr;
-	int		numpages;
+	unsigned long	numpages;
 	int		flags;
 	unsigned long	pfn;
 	unsigned	force_split : 1;
@@ -884,7 +884,7 @@ static int __change_page_attr_set_clr(struct cpa_data *cpa, int checkalias)
 		 * CPA operation. Either a large page has been
 		 * preserved or a single page update happened.
 		 */
-		BUG_ON(cpa->numpages > numpages);
+		BUG_ON(cpa->numpages > numpages || !cpa->numpages);
 		numpages -= cpa->numpages;
 		if (cpa->flags & (CPA_PAGES_ARRAY | CPA_ARRAY))
 			cpa->curpage++;
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 31+ messages in thread

* [PATCH 3.13.y-ckt 29/30] perf annotate browser: Fix behaviour of Shift-Tab with nothing focussed
  2016-02-10 21:41 [3.13.y-ckt stable] Linux 3.13.11-ckt35 stable review Kamal Mostafa
                   ` (27 preceding siblings ...)
  2016-02-10 21:42 ` [PATCH 3.13.y-ckt 28/30] x86/mm/pat: Avoid truncation when converting cpa->numpages to address Kamal Mostafa
@ 2016-02-10 21:42 ` Kamal Mostafa
  2016-02-10 21:42 ` [PATCH 3.13.y-ckt 30/30] powerpc/perf: Remove PPMU_HAS_SSLOT flag for Power8 Kamal Mostafa
  29 siblings, 0 replies; 31+ messages in thread
From: Kamal Mostafa @ 2016-02-10 21:42 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Markus Trippelsdorf, Ben Hutchings, Matt Fleming, Peter Zijlstra,
	Arnaldo Carvalho de Melo, Kamal Mostafa

3.13.11-ckt35 -stable review patch.  If anyone has any objections, please let me know.

---8<------------------------------------------------------------

From: Markus Trippelsdorf <markus@trippelsdorf.de>

commit d4913cbd05bab685e49c8174896e563b2487d054 upstream.

The issue was pointed out by gcc-6's -Wmisleading-indentation.

Signed-off-by: Markus Trippelsdorf <markus@trippelsdorf.de>
Acked-by: Ingo Molnar <mingo@kernel.org>
Cc: Ben Hutchings <ben@decadent.org.uk>
Cc: Matt Fleming <matt@codeblueprint.co.uk>
Cc: Peter Zijlstra <peterz@infradead.org>
Fixes: c97cf42219b7 ("perf top: Live TUI Annotation")
Link: http://lkml.kernel.org/r/20151214154403.GB1409@x4
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 tools/perf/ui/browsers/annotate.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/perf/ui/browsers/annotate.c b/tools/perf/ui/browsers/annotate.c
index f0697a3..4cc7d05 100644
--- a/tools/perf/ui/browsers/annotate.c
+++ b/tools/perf/ui/browsers/annotate.c
@@ -711,11 +711,11 @@ static int annotate_browser__run(struct annotate_browser *browser,
 				nd = browser->curr_hot;
 			break;
 		case K_UNTAB:
-			if (nd != NULL)
+			if (nd != NULL) {
 				nd = rb_next(nd);
 				if (nd == NULL)
 					nd = rb_first(&browser->entries);
-			else
+			} else
 				nd = browser->curr_hot;
 			break;
 		case K_F1:
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 31+ messages in thread

* [PATCH 3.13.y-ckt 30/30] powerpc/perf: Remove PPMU_HAS_SSLOT flag for Power8
  2016-02-10 21:41 [3.13.y-ckt stable] Linux 3.13.11-ckt35 stable review Kamal Mostafa
                   ` (28 preceding siblings ...)
  2016-02-10 21:42 ` [PATCH 3.13.y-ckt 29/30] perf annotate browser: Fix behaviour of Shift-Tab with nothing focussed Kamal Mostafa
@ 2016-02-10 21:42 ` Kamal Mostafa
  29 siblings, 0 replies; 31+ messages in thread
From: Kamal Mostafa @ 2016-02-10 21:42 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Madhavan Srinivasan, Michael Ellerman, Kamal Mostafa

3.13.11-ckt35 -stable review patch.  If anyone has any objections, please let me know.

---8<------------------------------------------------------------

From: Madhavan Srinivasan <maddy@linux.vnet.ibm.com>

commit 370f06c88528b3988fe24a372c10e1303bb94cf6 upstream.

Commit 7a7868326d77 ("powerpc/perf: Add an explict flag indicating
presence of SLOT field") introduced the PPMU_HAS_SSLOT flag to remove
the assumption that MMCRA[SLOT] was present when PPMU_ALT_SIPR was not
set.

That commit's changelog also mentions that Power8 does not support
MMCRA[SLOT]. However when the Power8 PMU support was merged, it
errnoeously included the PPMU_HAS_SSLOT flag.

So remove PPMU_HAS_SSLOT from the Power8 flags.

mpe: On systems where MMCRA[SLOT] exists, the field occupies bits 37:39
(IBM numbering). On Power8 bit 37 is reserved, and 38:39 overlap with
the high bits of the Threshold Event Counter Mantissa. I am not aware of
any published events which use the threshold counting mechanism, which
would cause the mantissa bits to be set. So in practice this bug is
unlikely to trigger.

Fixes: e05b9b9e5c10 ("powerpc/perf: Power8 PMU support")
Signed-off-by: Madhavan Srinivasan <maddy@linux.vnet.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 arch/powerpc/perf/power8-pmu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/powerpc/perf/power8-pmu.c b/arch/powerpc/perf/power8-pmu.c
index 79b7e20..d68494a 100644
--- a/arch/powerpc/perf/power8-pmu.c
+++ b/arch/powerpc/perf/power8-pmu.c
@@ -608,7 +608,7 @@ static struct power_pmu power8_pmu = {
 	.get_constraint		= power8_get_constraint,
 	.get_alternatives	= power8_get_alternatives,
 	.disable_pmc		= power8_disable_pmc,
-	.flags			= PPMU_HAS_SSLOT | PPMU_HAS_SIER | PPMU_ARCH_207S,
+	.flags			= PPMU_HAS_SIER | PPMU_ARCH_207S,
 	.n_generic		= ARRAY_SIZE(power8_generic_events),
 	.generic_events		= power8_generic_events,
 	.attr_groups		= power8_pmu_attr_groups,
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 31+ messages in thread

end of thread, other threads:[~2016-02-10 21:50 UTC | newest]

Thread overview: 31+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-02-10 21:41 [3.13.y-ckt stable] Linux 3.13.11-ckt35 stable review Kamal Mostafa
2016-02-10 21:41 ` [PATCH 3.13.y-ckt 01/30] [media] usbvision fix overflow of interfaces array Kamal Mostafa
2016-02-10 21:41 ` [PATCH 3.13.y-ckt 02/30] [media] usbvision: fix leak of usb_dev on failure paths in usbvision_probe() Kamal Mostafa
2016-02-10 21:41 ` [PATCH 3.13.y-ckt 03/30] [media] usbvision: fix crash on detecting device with invalid configuration Kamal Mostafa
2016-02-10 21:41 ` [PATCH 3.13.y-ckt 04/30] tty: Fix unsafe ldisc reference via ioctl(TIOCGETD) Kamal Mostafa
2016-02-10 21:41 ` [PATCH 3.13.y-ckt 05/30] USB: serial: visor: fix crash on detecting device without write_urbs Kamal Mostafa
2016-02-10 21:41 ` [PATCH 3.13.y-ckt 06/30] ASN.1: Fix non-match detection failure on data overrun Kamal Mostafa
2016-02-10 21:41 ` [PATCH 3.13.y-ckt 07/30] qeth: initialize net_device with carrier off Kamal Mostafa
2016-02-10 21:41 ` [PATCH 3.13.y-ckt 08/30] iio: adis_buffer: Fix out-of-bounds memory access Kamal Mostafa
2016-02-10 21:41 ` [PATCH 3.13.y-ckt 09/30] x86/irq: Call chip->irq_set_affinity in proper context Kamal Mostafa
2016-02-10 21:41 ` [PATCH 3.13.y-ckt 10/30] usb: cdc-acm: handle unlinked urb in acm read callback Kamal Mostafa
2016-02-10 21:41 ` [PATCH 3.13.y-ckt 11/30] usb: cdc-acm: send zero packet for intel 7260 modem Kamal Mostafa
2016-02-10 21:41 ` [PATCH 3.13.y-ckt 12/30] cdc-acm:exclude Samsung phone 04e8:685d Kamal Mostafa
2016-02-10 21:41 ` [PATCH 3.13.y-ckt 13/30] usb: hub: do not clear BOS field during reset device Kamal Mostafa
2016-02-10 21:41 ` [PATCH 3.13.y-ckt 14/30] USB: cp210x: add ID for IAI USB to RS485 adaptor Kamal Mostafa
2016-02-10 21:41 ` [PATCH 3.13.y-ckt 15/30] USB: visor: fix null-deref at probe Kamal Mostafa
2016-02-10 21:41 ` [PATCH 3.13.y-ckt 16/30] USB: serial: option: Adding support for Telit LE922 Kamal Mostafa
2016-02-10 21:41 ` [PATCH 3.13.y-ckt 17/30] ALSA: seq: Fix incorrect sanity check at snd_seq_oss_synth_cleanup() Kamal Mostafa
2016-02-10 21:41 ` [PATCH 3.13.y-ckt 18/30] ALSA: seq: Degrade the error message for too many opens Kamal Mostafa
2016-02-10 21:41 ` [PATCH 3.13.y-ckt 19/30] USB: serial: ftdi_sio: add support for Yaesu SCU-18 cable Kamal Mostafa
2016-02-10 21:41 ` [PATCH 3.13.y-ckt 20/30] USB: option: fix Cinterion AHxx enumeration Kamal Mostafa
2016-02-10 21:41 ` [PATCH 3.13.y-ckt 21/30] ALSA: compress: Disable GET_CODEC_CAPS ioctl for some architectures Kamal Mostafa
2016-02-10 21:42 ` [PATCH 3.13.y-ckt 22/30] ALSA: usb-audio: Fix TEAC UD-501/UD-503/NT-503 usb delay Kamal Mostafa
2016-02-10 21:42 ` [PATCH 3.13.y-ckt 23/30] arm64: errata: Add -mpc-relative-literal-loads to build flags Kamal Mostafa
2016-02-10 21:42 ` [PATCH 3.13.y-ckt 24/30] SCSI: fix crashes in sd and sr runtime PM Kamal Mostafa
2016-02-10 21:42 ` [PATCH 3.13.y-ckt 25/30] n_tty: Fix unsafe reference to "other" ldisc Kamal Mostafa
2016-02-10 21:42 ` [PATCH 3.13.y-ckt 26/30] ALSA: dummy: Disable switching timer backend via sysfs Kamal Mostafa
2016-02-10 21:42 ` [PATCH 3.13.y-ckt 27/30] drm/vmwgfx: respect 'nomodeset' Kamal Mostafa
2016-02-10 21:42 ` [PATCH 3.13.y-ckt 28/30] x86/mm/pat: Avoid truncation when converting cpa->numpages to address Kamal Mostafa
2016-02-10 21:42 ` [PATCH 3.13.y-ckt 29/30] perf annotate browser: Fix behaviour of Shift-Tab with nothing focussed Kamal Mostafa
2016-02-10 21:42 ` [PATCH 3.13.y-ckt 30/30] powerpc/perf: Remove PPMU_HAS_SSLOT flag for Power8 Kamal Mostafa

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.