All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 3.18 00/19] 3.18.76-stable review
@ 2017-10-16 16:11 Greg Kroah-Hartman
  2017-10-16 16:11 ` [PATCH 3.18 01/19] ext4: in ext4_seek_{hole,data}, return -ENXIO for negative offsets Greg Kroah-Hartman
                   ` (21 more replies)
  0 siblings, 22 replies; 30+ messages in thread
From: Greg Kroah-Hartman @ 2017-10-16 16:11 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, torvalds, akpm, linux, shuahkh, patches,
	ben.hutchings, stable

This is the start of the stable review cycle for the 3.18.76 release.
There are 19 patches in this series, all will be posted as a response
to this one.  If anyone has any issues with these being applied, please
let me know.

Responses should be made by Wed Oct 18 16:09:03 UTC 2017.
Anything received after that time might be too late.

The whole patch series can be found in one patch at:
	kernel.org/pub/linux/kernel/v3.x/stable-review/patch-3.18.76-rc1.gz
or in the git tree and branch at:
  git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-3.18.y
and the diffstat can be found below.

thanks,

greg k-h

-------------
Pseudo-Shortlog of commits:

Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Linux 3.18.76-rc1

Takashi Iwai <tiwai@suse.de>
    ALSA: seq: Fix missing NULL check at remove_events ioctl

Johan Hovold <johan@kernel.org>
    USB: serial: console: fix use-after-free after failed setup

Shrirang Bagul <shrirang.bagul@canonical.com>
    USB: serial: qcserial: add Dell DW5818, DW5819

Henryk Heisig <hyniu@o2.pl>
    USB: serial: option: add support for TP-Link LTE module

Andreas Engel <anen-nospam@gmx.net>
    USB: serial: cp210x: add support for ELV TFD500

Vitaly Mayatskikh <v.mayatskih@gmail.com>
    fix unbalanced page refcounting in bio_map_user_iov

Andreas Gruenbacher <agruenba@redhat.com>
    direct-io: Prevent NULL pointer access in submit_page_section

Andrew Gabbasov <andrew_gabbasov@mentor.com>
    usb: gadget: composite: Fix use-after-free in usb_composite_overwrite_options

Takashi Iwai <tiwai@suse.de>
    ALSA: caiaq: Fix stray URB at probe error path

Takashi Iwai <tiwai@suse.de>
    ALSA: seq: Fix copy_from_user() call inside lock

Takashi Iwai <tiwai@suse.de>
    ALSA: seq: Fix use-after-free at creating a port

Takashi Iwai <tiwai@suse.de>
    ALSA: usb-audio: Kill stray URB at exiting

Joerg Roedel <jroedel@suse.de>
    iommu/amd: Finish TLB flush in amd_iommu_unmap()

Kazuya Mizuguchi <kazuya.mizuguchi.ks@renesas.com>
    usb: renesas_usbhs: Fix DMAC sequence for receiving zero-length packet

Haozhong Zhang <haozhong.zhang@intel.com>
    KVM: nVMX: fix guest CR4 loading when emulating L2 to L1 exit

Herbert Xu <herbert@gondor.apana.org.au>
    crypto: shash - Fix zero-length shash ahash digest crash

Jaejoong Kim <climbbb.kim@gmail.com>
    HID: usbhid: fix out-of-bounds bug

Pavel Shilovsky <pshilov@microsoft.com>
    CIFS: Reconnect expired SMB sessions

Darrick J. Wong <darrick.wong@oracle.com>
    ext4: in ext4_seek_{hole,data}, return -ENXIO for negative offsets


-------------

Diffstat:

 Makefile                         |  4 ++--
 arch/x86/kvm/vmx.c               |  2 +-
 block/bio.c                      |  8 ++++++++
 crypto/shash.c                   |  8 +++++---
 drivers/hid/usbhid/hid-core.c    | 12 +++++++++++-
 drivers/iommu/amd_iommu.c        |  1 +
 drivers/usb/gadget/composite.c   |  5 +++++
 drivers/usb/renesas_usbhs/fifo.c |  2 +-
 drivers/usb/serial/console.c     |  1 +
 drivers/usb/serial/cp210x.c      |  1 +
 drivers/usb/serial/option.c      |  2 ++
 drivers/usb/serial/qcserial.c    |  4 ++++
 fs/cifs/cifsglob.h               |  2 ++
 fs/cifs/cifssmb.c                |  7 +++++++
 fs/cifs/connect.c                |  7 +++++++
 fs/cifs/smb2ops.c                | 15 +++++++++++++++
 fs/direct-io.c                   |  3 ++-
 fs/ext4/file.c                   |  4 ++--
 include/sound/seq_virmidi.h      |  1 +
 sound/core/seq/seq_clientmgr.c   |  8 ++++++--
 sound/core/seq/seq_ports.c       |  7 +++++--
 sound/core/seq/seq_virmidi.c     | 27 +++++++++++++++++++--------
 sound/usb/caiaq/device.c         | 12 +++++++++---
 sound/usb/mixer.c                | 12 ++++++++++--
 sound/usb/mixer.h                |  2 ++
 25 files changed, 129 insertions(+), 28 deletions(-)

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

* [PATCH 3.18 01/19] ext4: in ext4_seek_{hole,data}, return -ENXIO for negative offsets
  2017-10-16 16:11 [PATCH 3.18 00/19] 3.18.76-stable review Greg Kroah-Hartman
@ 2017-10-16 16:11 ` Greg Kroah-Hartman
  2017-10-16 16:11 ` [PATCH 3.18 02/19] CIFS: Reconnect expired SMB sessions Greg Kroah-Hartman
                   ` (20 subsequent siblings)
  21 siblings, 0 replies; 30+ messages in thread
From: Greg Kroah-Hartman @ 2017-10-16 16:11 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, stable, Mateusz S, Darrick J. Wong, Theodore Tso

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

------------------

From: Darrick J. Wong <darrick.wong@oracle.com>

commit 1bd8d6cd3e413d64e543ec3e69ff43e75a1cf1ea upstream.

In the ext4 implementations of SEEK_HOLE and SEEK_DATA, make sure we
return -ENXIO for negative offsets instead of banging around inside
the extent code and returning -EFSCORRUPTED.

Reported-by: Mateusz S <muttdini@gmail.com>
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 fs/ext4/file.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

--- a/fs/ext4/file.c
+++ b/fs/ext4/file.c
@@ -399,7 +399,7 @@ static loff_t ext4_seek_data(struct file
 	mutex_lock(&inode->i_mutex);
 
 	isize = i_size_read(inode);
-	if (offset >= isize) {
+	if (offset < 0 || offset >= isize) {
 		mutex_unlock(&inode->i_mutex);
 		return -ENXIO;
 	}
@@ -472,7 +472,7 @@ static loff_t ext4_seek_hole(struct file
 	mutex_lock(&inode->i_mutex);
 
 	isize = i_size_read(inode);
-	if (offset >= isize) {
+	if (offset < 0 || offset >= isize) {
 		mutex_unlock(&inode->i_mutex);
 		return -ENXIO;
 	}

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

* [PATCH 3.18 02/19] CIFS: Reconnect expired SMB sessions
  2017-10-16 16:11 [PATCH 3.18 00/19] 3.18.76-stable review Greg Kroah-Hartman
  2017-10-16 16:11 ` [PATCH 3.18 01/19] ext4: in ext4_seek_{hole,data}, return -ENXIO for negative offsets Greg Kroah-Hartman
@ 2017-10-16 16:11 ` Greg Kroah-Hartman
  2017-10-16 16:11 ` [PATCH 3.18 03/19] HID: usbhid: fix out-of-bounds bug Greg Kroah-Hartman
                   ` (19 subsequent siblings)
  21 siblings, 0 replies; 30+ messages in thread
From: Greg Kroah-Hartman @ 2017-10-16 16:11 UTC (permalink / raw)
  To: linux-kernel; +Cc: Greg Kroah-Hartman, stable, Pavel Shilovsky, Steve French

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

------------------

From: Pavel Shilovsky <pshilov@microsoft.com>

commit 511c54a2f69195b28afb9dd119f03787b1625bb4 upstream.

According to the MS-SMB2 spec (3.2.5.1.6) once the client receives
STATUS_NETWORK_SESSION_EXPIRED error code from a server it should
reconnect the current SMB session. Currently the client doesn't do
that. This can result in subsequent client requests failing by
the server. The patch adds an additional logic to the demultiplex
thread to identify expired sessions and reconnect them.

Signed-off-by: Pavel Shilovsky <pshilov@microsoft.com>
Signed-off-by: Steve French <smfrench@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


---
 fs/cifs/cifsglob.h |    2 ++
 fs/cifs/cifssmb.c  |    7 +++++++
 fs/cifs/connect.c  |    7 +++++++
 fs/cifs/smb2ops.c  |   15 +++++++++++++++
 4 files changed, 31 insertions(+)

--- a/fs/cifs/cifsglob.h
+++ b/fs/cifs/cifsglob.h
@@ -347,6 +347,8 @@ struct smb_version_operations {
 	unsigned int (*calc_smb_size)(void *);
 	/* check for STATUS_PENDING and process it in a positive case */
 	bool (*is_status_pending)(char *, struct TCP_Server_Info *, int);
+	/* check for STATUS_NETWORK_SESSION_EXPIRED */
+	bool (*is_session_expired)(char *);
 	/* send oplock break response */
 	int (*oplock_response)(struct cifs_tcon *, struct cifs_fid *,
 			       struct cifsInodeInfo *);
--- a/fs/cifs/cifssmb.c
+++ b/fs/cifs/cifssmb.c
@@ -1458,6 +1458,13 @@ cifs_readv_receive(struct TCP_Server_Inf
 		return length;
 	server->total_read += length;
 
+	if (server->ops->is_session_expired &&
+	    server->ops->is_session_expired(buf)) {
+		cifs_reconnect(server);
+		wake_up(&server->response_q);
+		return -1;
+	}
+
 	if (server->ops->is_status_pending &&
 	    server->ops->is_status_pending(buf, server, 0)) {
 		discard_remaining_data(server);
--- a/fs/cifs/connect.c
+++ b/fs/cifs/connect.c
@@ -839,6 +839,13 @@ standard_receive3(struct TCP_Server_Info
 		cifs_dump_mem("Bad SMB: ", buf,
 			min_t(unsigned int, server->total_read, 48));
 
+	if (server->ops->is_session_expired &&
+	    server->ops->is_session_expired(buf)) {
+		cifs_reconnect(server);
+		wake_up(&server->response_q);
+		return -1;
+	}
+
 	if (server->ops->is_status_pending &&
 	    server->ops->is_status_pending(buf, server, length))
 		return -1;
--- a/fs/cifs/smb2ops.c
+++ b/fs/cifs/smb2ops.c
@@ -896,6 +896,18 @@ smb2_is_status_pending(char *buf, struct
 	return true;
 }
 
+static bool
+smb2_is_session_expired(char *buf)
+{
+	struct smb2_hdr *hdr = (struct smb2_hdr *)buf;
+
+	if (hdr->Status != STATUS_NETWORK_SESSION_EXPIRED)
+		return false;
+
+	cifs_dbg(FYI, "Session expired\n");
+	return true;
+}
+
 static int
 smb2_oplock_response(struct cifs_tcon *tcon, struct cifs_fid *fid,
 		     struct cifsInodeInfo *cinode)
@@ -1424,6 +1436,7 @@ struct smb_version_operations smb20_oper
 	.close_dir = smb2_close_dir,
 	.calc_smb_size = smb2_calc_size,
 	.is_status_pending = smb2_is_status_pending,
+	.is_session_expired = smb2_is_session_expired,
 	.oplock_response = smb2_oplock_response,
 	.queryfs = smb2_queryfs,
 	.mand_lock = smb2_mand_lock,
@@ -1505,6 +1518,7 @@ struct smb_version_operations smb21_oper
 	.close_dir = smb2_close_dir,
 	.calc_smb_size = smb2_calc_size,
 	.is_status_pending = smb2_is_status_pending,
+	.is_session_expired = smb2_is_session_expired,
 	.oplock_response = smb2_oplock_response,
 	.queryfs = smb2_queryfs,
 	.mand_lock = smb2_mand_lock,
@@ -1587,6 +1601,7 @@ struct smb_version_operations smb30_oper
 	.close_dir = smb2_close_dir,
 	.calc_smb_size = smb2_calc_size,
 	.is_status_pending = smb2_is_status_pending,
+	.is_session_expired = smb2_is_session_expired,
 	.oplock_response = smb2_oplock_response,
 	.queryfs = smb2_queryfs,
 	.mand_lock = smb2_mand_lock,

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

* [PATCH 3.18 03/19] HID: usbhid: fix out-of-bounds bug
  2017-10-16 16:11 [PATCH 3.18 00/19] 3.18.76-stable review Greg Kroah-Hartman
  2017-10-16 16:11 ` [PATCH 3.18 01/19] ext4: in ext4_seek_{hole,data}, return -ENXIO for negative offsets Greg Kroah-Hartman
  2017-10-16 16:11 ` [PATCH 3.18 02/19] CIFS: Reconnect expired SMB sessions Greg Kroah-Hartman
@ 2017-10-16 16:11 ` Greg Kroah-Hartman
  2017-10-16 16:11 ` [PATCH 3.18 05/19] KVM: nVMX: fix guest CR4 loading when emulating L2 to L1 exit Greg Kroah-Hartman
                   ` (18 subsequent siblings)
  21 siblings, 0 replies; 30+ messages in thread
From: Greg Kroah-Hartman @ 2017-10-16 16:11 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, stable, Andrey Konovalov, Jaejoong Kim,
	Alan Stern, Jiri Kosina

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

------------------

From: Jaejoong Kim <climbbb.kim@gmail.com>

commit f043bfc98c193c284e2cd768fefabe18ac2fed9b upstream.

The hid descriptor identifies the length and type of subordinate
descriptors for a device. If the received hid descriptor is smaller than
the size of the struct hid_descriptor, it is possible to cause
out-of-bounds.

In addition, if bNumDescriptors of the hid descriptor have an incorrect
value, this can also cause out-of-bounds while approaching hdesc->desc[n].

So check the size of hid descriptor and bNumDescriptors.

	BUG: KASAN: slab-out-of-bounds in usbhid_parse+0x9b1/0xa20
	Read of size 1 at addr ffff88006c5f8edf by task kworker/1:2/1261

	CPU: 1 PID: 1261 Comm: kworker/1:2 Not tainted
	4.14.0-rc1-42251-gebb2c2437d80 #169
	Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS Bochs 01/01/2011
	Workqueue: usb_hub_wq hub_event
	Call Trace:
	__dump_stack lib/dump_stack.c:16
	dump_stack+0x292/0x395 lib/dump_stack.c:52
	print_address_description+0x78/0x280 mm/kasan/report.c:252
	kasan_report_error mm/kasan/report.c:351
	kasan_report+0x22f/0x340 mm/kasan/report.c:409
	__asan_report_load1_noabort+0x19/0x20 mm/kasan/report.c:427
	usbhid_parse+0x9b1/0xa20 drivers/hid/usbhid/hid-core.c:1004
	hid_add_device+0x16b/0xb30 drivers/hid/hid-core.c:2944
	usbhid_probe+0xc28/0x1100 drivers/hid/usbhid/hid-core.c:1369
	usb_probe_interface+0x35d/0x8e0 drivers/usb/core/driver.c:361
	really_probe drivers/base/dd.c:413
	driver_probe_device+0x610/0xa00 drivers/base/dd.c:557
	__device_attach_driver+0x230/0x290 drivers/base/dd.c:653
	bus_for_each_drv+0x161/0x210 drivers/base/bus.c:463
	__device_attach+0x26e/0x3d0 drivers/base/dd.c:710
	device_initial_probe+0x1f/0x30 drivers/base/dd.c:757
	bus_probe_device+0x1eb/0x290 drivers/base/bus.c:523
	device_add+0xd0b/0x1660 drivers/base/core.c:1835
	usb_set_configuration+0x104e/0x1870 drivers/usb/core/message.c:1932
	generic_probe+0x73/0xe0 drivers/usb/core/generic.c:174
	usb_probe_device+0xaf/0xe0 drivers/usb/core/driver.c:266
	really_probe drivers/base/dd.c:413
	driver_probe_device+0x610/0xa00 drivers/base/dd.c:557
	__device_attach_driver+0x230/0x290 drivers/base/dd.c:653
	bus_for_each_drv+0x161/0x210 drivers/base/bus.c:463
	__device_attach+0x26e/0x3d0 drivers/base/dd.c:710
	device_initial_probe+0x1f/0x30 drivers/base/dd.c:757
	bus_probe_device+0x1eb/0x290 drivers/base/bus.c:523
	device_add+0xd0b/0x1660 drivers/base/core.c:1835
	usb_new_device+0x7b8/0x1020 drivers/usb/core/hub.c:2457
	hub_port_connect drivers/usb/core/hub.c:4903
	hub_port_connect_change drivers/usb/core/hub.c:5009
	port_event drivers/usb/core/hub.c:5115
	hub_event+0x194d/0x3740 drivers/usb/core/hub.c:5195
	process_one_work+0xc7f/0x1db0 kernel/workqueue.c:2119
	worker_thread+0x221/0x1850 kernel/workqueue.c:2253
	kthread+0x3a1/0x470 kernel/kthread.c:231
	ret_from_fork+0x2a/0x40 arch/x86/entry/entry_64.S:431

Reported-by: Andrey Konovalov <andreyknvl@google.com>
Signed-off-by: Jaejoong Kim <climbbb.kim@gmail.com>
Tested-by: Andrey Konovalov <andreyknvl@google.com>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/hid/usbhid/hid-core.c |   12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

--- a/drivers/hid/usbhid/hid-core.c
+++ b/drivers/hid/usbhid/hid-core.c
@@ -959,6 +959,8 @@ static int usbhid_parse(struct hid_devic
 	unsigned int rsize = 0;
 	char *rdesc;
 	int ret, n;
+	int num_descriptors;
+	size_t offset = offsetof(struct hid_descriptor, desc);
 
 	quirks = usbhid_lookup_quirk(le16_to_cpu(dev->descriptor.idVendor),
 			le16_to_cpu(dev->descriptor.idProduct));
@@ -981,10 +983,18 @@ static int usbhid_parse(struct hid_devic
 		return -ENODEV;
 	}
 
+	if (hdesc->bLength < sizeof(struct hid_descriptor)) {
+		dbg_hid("hid descriptor is too short\n");
+		return -EINVAL;
+	}
+
 	hid->version = le16_to_cpu(hdesc->bcdHID);
 	hid->country = hdesc->bCountryCode;
 
-	for (n = 0; n < hdesc->bNumDescriptors; n++)
+	num_descriptors = min_t(int, hdesc->bNumDescriptors,
+	       (hdesc->bLength - offset) / sizeof(struct hid_class_descriptor));
+
+	for (n = 0; n < num_descriptors; n++)
 		if (hdesc->desc[n].bDescriptorType == HID_DT_REPORT)
 			rsize = le16_to_cpu(hdesc->desc[n].wDescriptorLength);
 

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

* [PATCH 3.18 05/19] KVM: nVMX: fix guest CR4 loading when emulating L2 to L1 exit
  2017-10-16 16:11 [PATCH 3.18 00/19] 3.18.76-stable review Greg Kroah-Hartman
                   ` (2 preceding siblings ...)
  2017-10-16 16:11 ` [PATCH 3.18 03/19] HID: usbhid: fix out-of-bounds bug Greg Kroah-Hartman
@ 2017-10-16 16:11 ` Greg Kroah-Hartman
  2017-10-16 16:11 ` [PATCH 3.18 06/19] usb: renesas_usbhs: Fix DMAC sequence for receiving zero-length packet Greg Kroah-Hartman
                   ` (17 subsequent siblings)
  21 siblings, 0 replies; 30+ messages in thread
From: Greg Kroah-Hartman @ 2017-10-16 16:11 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, stable, qemu-stable, Haozhong Zhang, Paolo Bonzini

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

------------------

From: Haozhong Zhang <haozhong.zhang@intel.com>

commit 8eb3f87d903168bdbd1222776a6b1e281f50513e upstream.

When KVM emulates an exit from L2 to L1, it loads L1 CR4 into the
guest CR4. Before this CR4 loading, the guest CR4 refers to L2
CR4. Because these two CR4's are in different levels of guest, we
should vmx_set_cr4() rather than kvm_set_cr4() here. The latter, which
is used to handle guest writes to its CR4, checks the guest change to
CR4 and may fail if the change is invalid.

The failure may cause trouble. Consider we start
  a L1 guest with non-zero L1 PCID in use,
     (i.e. L1 CR4.PCIDE == 1 && L1 CR3.PCID != 0)
and
  a L2 guest with L2 PCID disabled,
     (i.e. L2 CR4.PCIDE == 0)
and following events may happen:

1. If kvm_set_cr4() is used in load_vmcs12_host_state() to load L1 CR4
   into guest CR4 (in VMCS01) for L2 to L1 exit, it will fail because
   of PCID check. As a result, the guest CR4 recorded in L0 KVM (i.e.
   vcpu->arch.cr4) is left to the value of L2 CR4.

2. Later, if L1 attempts to change its CR4, e.g., clearing VMXE bit,
   kvm_set_cr4() in L0 KVM will think L1 also wants to enable PCID,
   because the wrong L2 CR4 is used by L0 KVM as L1 CR4. As L1
   CR3.PCID != 0, L0 KVM will inject GP to L1 guest.

Fixes: 4704d0befb072 ("KVM: nVMX: Exiting from L2 to L1")
Cc: qemu-stable@nongnu.org
Signed-off-by: Haozhong Zhang <haozhong.zhang@intel.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 arch/x86/kvm/vmx.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/arch/x86/kvm/vmx.c
+++ b/arch/x86/kvm/vmx.c
@@ -8904,7 +8904,7 @@ static void load_vmcs12_host_state(struc
 	 * (KVM doesn't change it)- no reason to call set_cr4_guest_host_mask();
 	 */
 	vcpu->arch.cr4_guest_owned_bits = ~vmcs_readl(CR4_GUEST_HOST_MASK);
-	kvm_set_cr4(vcpu, vmcs12->host_cr4);
+	vmx_set_cr4(vcpu, vmcs12->host_cr4);
 
 	nested_ept_uninit_mmu_context(vcpu);
 

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

* [PATCH 3.18 06/19] usb: renesas_usbhs: Fix DMAC sequence for receiving zero-length packet
  2017-10-16 16:11 [PATCH 3.18 00/19] 3.18.76-stable review Greg Kroah-Hartman
                   ` (3 preceding siblings ...)
  2017-10-16 16:11 ` [PATCH 3.18 05/19] KVM: nVMX: fix guest CR4 loading when emulating L2 to L1 exit Greg Kroah-Hartman
@ 2017-10-16 16:11 ` Greg Kroah-Hartman
  2017-10-16 16:11 ` [PATCH 3.18 07/19] iommu/amd: Finish TLB flush in amd_iommu_unmap() Greg Kroah-Hartman
                   ` (16 subsequent siblings)
  21 siblings, 0 replies; 30+ messages in thread
From: Greg Kroah-Hartman @ 2017-10-16 16:11 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, stable, Kazuya Mizuguchi, Yoshihiro Shimoda,
	Felipe Balbi

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

------------------

From: Kazuya Mizuguchi <kazuya.mizuguchi.ks@renesas.com>

commit 29c7f3e68eec4ae94d85ad7b5dfdafdb8089f513 upstream.

The DREQE bit of the DnFIFOSEL should be set to 1 after the DE bit of
USB-DMAC on R-Car SoCs is set to 1 after the USB-DMAC received a
zero-length packet. Otherwise, a transfer completion interruption
of USB-DMAC doesn't happen. Even if the driver changes the sequence,
normal operations (transmit/receive without zero-length packet) will
not cause any side-effects. So, this patch fixes the sequence anyway.

Signed-off-by: Kazuya Mizuguchi <kazuya.mizuguchi.ks@renesas.com>
[shimoda: revise the commit log]
Fixes: e73a9891b3a1 ("usb: renesas_usbhs: add DMAEngine support")
Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/usb/renesas_usbhs/fifo.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/usb/renesas_usbhs/fifo.c
+++ b/drivers/usb/renesas_usbhs/fifo.c
@@ -880,9 +880,9 @@ static void xfer_work(struct work_struct
 		fifo->name, usbhs_pipe_number(pipe), pkt->length, pkt->zero);
 
 	usbhs_pipe_running(pipe, 1);
-	usbhsf_dma_start(pipe, fifo);
 	usbhs_pipe_set_trans_count_if_bulk(pipe, pkt->trans);
 	dma_async_issue_pending(chan);
+	usbhsf_dma_start(pipe, fifo);
 	usbhs_pipe_enable(pipe);
 
 xfer_work_end:

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

* [PATCH 3.18 07/19] iommu/amd: Finish TLB flush in amd_iommu_unmap()
  2017-10-16 16:11 [PATCH 3.18 00/19] 3.18.76-stable review Greg Kroah-Hartman
                   ` (4 preceding siblings ...)
  2017-10-16 16:11 ` [PATCH 3.18 06/19] usb: renesas_usbhs: Fix DMAC sequence for receiving zero-length packet Greg Kroah-Hartman
@ 2017-10-16 16:11 ` Greg Kroah-Hartman
  2017-10-16 16:11 ` [PATCH 3.18 08/19] ALSA: usb-audio: Kill stray URB at exiting Greg Kroah-Hartman
                   ` (15 subsequent siblings)
  21 siblings, 0 replies; 30+ messages in thread
From: Greg Kroah-Hartman @ 2017-10-16 16:11 UTC (permalink / raw)
  To: linux-kernel; +Cc: Greg Kroah-Hartman, stable, Joerg Roedel

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

------------------

From: Joerg Roedel <jroedel@suse.de>

commit ce76353f169a6471542d999baf3d29b121dce9c0 upstream.

The function only sends the flush command to the IOMMU(s),
but does not wait for its completion when it returns. Fix
that.

Fixes: 601367d76bd1 ('x86/amd-iommu: Remove iommu_flush_domain function')
Signed-off-by: Joerg Roedel <jroedel@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/iommu/amd_iommu.c |    1 +
 1 file changed, 1 insertion(+)

--- a/drivers/iommu/amd_iommu.c
+++ b/drivers/iommu/amd_iommu.c
@@ -3381,6 +3381,7 @@ static size_t amd_iommu_unmap(struct iom
 	mutex_unlock(&domain->api_lock);
 
 	domain_flush_tlb_pde(domain);
+	domain_flush_complete(domain);
 
 	return unmap_size;
 }

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

* [PATCH 3.18 08/19] ALSA: usb-audio: Kill stray URB at exiting
  2017-10-16 16:11 [PATCH 3.18 00/19] 3.18.76-stable review Greg Kroah-Hartman
                   ` (5 preceding siblings ...)
  2017-10-16 16:11 ` [PATCH 3.18 07/19] iommu/amd: Finish TLB flush in amd_iommu_unmap() Greg Kroah-Hartman
@ 2017-10-16 16:11 ` Greg Kroah-Hartman
  2017-10-16 18:50   ` Takashi Iwai
  2017-10-16 16:12 ` [PATCH 3.18 09/19] ALSA: seq: Fix use-after-free at creating a port Greg Kroah-Hartman
                   ` (14 subsequent siblings)
  21 siblings, 1 reply; 30+ messages in thread
From: Greg Kroah-Hartman @ 2017-10-16 16:11 UTC (permalink / raw)
  To: linux-kernel; +Cc: Greg Kroah-Hartman, stable, Andrey Konovalov, Takashi Iwai

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

------------------

From: Takashi Iwai <tiwai@suse.de>

commit 124751d5e63c823092060074bd0abaae61aaa9c4 upstream.

USB-audio driver may leave a stray URB for the mixer interrupt when it
exits by some error during probe.  This leads to a use-after-free
error as spotted by syzkaller like:
  ==================================================================
  BUG: KASAN: use-after-free in snd_usb_mixer_interrupt+0x604/0x6f0
  Call Trace:
   <IRQ>
   __dump_stack lib/dump_stack.c:16
   dump_stack+0x292/0x395 lib/dump_stack.c:52
   print_address_description+0x78/0x280 mm/kasan/report.c:252
   kasan_report_error mm/kasan/report.c:351
   kasan_report+0x23d/0x350 mm/kasan/report.c:409
   __asan_report_load8_noabort+0x19/0x20 mm/kasan/report.c:430
   snd_usb_mixer_interrupt+0x604/0x6f0 sound/usb/mixer.c:2490
   __usb_hcd_giveback_urb+0x2e0/0x650 drivers/usb/core/hcd.c:1779
   ....

  Allocated by task 1484:
   save_stack_trace+0x1b/0x20 arch/x86/kernel/stacktrace.c:59
   save_stack+0x43/0xd0 mm/kasan/kasan.c:447
   set_track mm/kasan/kasan.c:459
   kasan_kmalloc+0xad/0xe0 mm/kasan/kasan.c:551
   kmem_cache_alloc_trace+0x11e/0x2d0 mm/slub.c:2772
   kmalloc ./include/linux/slab.h:493
   kzalloc ./include/linux/slab.h:666
   snd_usb_create_mixer+0x145/0x1010 sound/usb/mixer.c:2540
   create_standard_mixer_quirk+0x58/0x80 sound/usb/quirks.c:516
   snd_usb_create_quirk+0x92/0x100 sound/usb/quirks.c:560
   create_composite_quirk+0x1c4/0x3e0 sound/usb/quirks.c:59
   snd_usb_create_quirk+0x92/0x100 sound/usb/quirks.c:560
   usb_audio_probe+0x1040/0x2c10 sound/usb/card.c:618
   ....

  Freed by task 1484:
   save_stack_trace+0x1b/0x20 arch/x86/kernel/stacktrace.c:59
   save_stack+0x43/0xd0 mm/kasan/kasan.c:447
   set_track mm/kasan/kasan.c:459
   kasan_slab_free+0x72/0xc0 mm/kasan/kasan.c:524
   slab_free_hook mm/slub.c:1390
   slab_free_freelist_hook mm/slub.c:1412
   slab_free mm/slub.c:2988
   kfree+0xf6/0x2f0 mm/slub.c:3919
   snd_usb_mixer_free+0x11a/0x160 sound/usb/mixer.c:2244
   snd_usb_mixer_dev_free+0x36/0x50 sound/usb/mixer.c:2250
   __snd_device_free+0x1ff/0x380 sound/core/device.c:91
   snd_device_free_all+0x8f/0xe0 sound/core/device.c:244
   snd_card_do_free sound/core/init.c:461
   release_card_device+0x47/0x170 sound/core/init.c:181
   device_release+0x13f/0x210 drivers/base/core.c:814
   ....

Actually such a URB is killed properly at disconnection when the
device gets probed successfully, and what we need is to apply it for
the error-path, too.

In this patch, we apply snd_usb_mixer_disconnect() at releasing.
Also introduce a new flag, disconnected, to struct usb_mixer_interface
for not performing the disconnection procedure twice.

Reported-by: Andrey Konovalov <andreyknvl@google.com>
Tested-by: Andrey Konovalov <andreyknvl@google.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 sound/usb/mixer.c |   12 ++++++++++--
 sound/usb/mixer.h |    2 ++
 2 files changed, 12 insertions(+), 2 deletions(-)

--- a/sound/usb/mixer.c
+++ b/sound/usb/mixer.c
@@ -2157,6 +2157,9 @@ static int parse_audio_unit(struct mixer
 
 static void snd_usb_mixer_free(struct usb_mixer_interface *mixer)
 {
+	/* kill pending URBs */
+	snd_usb_mixer_disconnect(mixer);
+
 	kfree(mixer->id_elems);
 	if (mixer->urb) {
 		kfree(mixer->urb->transfer_buffer);
@@ -2501,8 +2504,13 @@ void snd_usb_mixer_disconnect(struct lis
 /* stop any bus activity of a mixer */
 static void snd_usb_mixer_inactivate(struct usb_mixer_interface *mixer)
 {
-	usb_kill_urb(mixer->urb);
-	usb_kill_urb(mixer->rc_urb);
+	if (mixer->disconnected)
+		return;
+	if (mixer->urb)
+		usb_kill_urb(mixer->urb);
+	if (mixer->rc_urb)
+		usb_kill_urb(mixer->rc_urb);
+	mixer->disconnected = true;
 }
 
 static int snd_usb_mixer_activate(struct usb_mixer_interface *mixer)
--- a/sound/usb/mixer.h
+++ b/sound/usb/mixer.h
@@ -23,6 +23,8 @@ struct usb_mixer_interface {
 
 	u8 audigy2nx_leds[3];
 	u8 xonar_u1_status;
+
+	bool disconnected;
 };
 
 #define MAX_CHANNELS	16	/* max logical channels */

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

* [PATCH 3.18 09/19] ALSA: seq: Fix use-after-free at creating a port
  2017-10-16 16:11 [PATCH 3.18 00/19] 3.18.76-stable review Greg Kroah-Hartman
                   ` (6 preceding siblings ...)
  2017-10-16 16:11 ` [PATCH 3.18 08/19] ALSA: usb-audio: Kill stray URB at exiting Greg Kroah-Hartman
@ 2017-10-16 16:12 ` Greg Kroah-Hartman
  2017-10-16 16:12 ` [PATCH 3.18 10/19] ALSA: seq: Fix copy_from_user() call inside lock Greg Kroah-Hartman
                   ` (13 subsequent siblings)
  21 siblings, 0 replies; 30+ messages in thread
From: Greg Kroah-Hartman @ 2017-10-16 16:12 UTC (permalink / raw)
  To: linux-kernel; +Cc: Greg Kroah-Hartman, stable, Linus Torvalds, Takashi Iwai

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

------------------

From: Takashi Iwai <tiwai@suse.de>

commit 71105998845fb012937332fe2e806d443c09e026 upstream.

There is a potential race window opened at creating and deleting a
port via ioctl, as spotted by fuzzing.  snd_seq_create_port() creates
a port object and returns its pointer, but it doesn't take the
refcount, thus it can be deleted immediately by another thread.
Meanwhile, snd_seq_ioctl_create_port() still calls the function
snd_seq_system_client_ev_port_start() with the created port object
that is being deleted, and this triggers use-after-free like:

 BUG: KASAN: use-after-free in snd_seq_ioctl_create_port+0x504/0x630 [snd_seq] at addr ffff8801f2241cb1
 =============================================================================
 BUG kmalloc-512 (Tainted: G    B          ): kasan: bad access detected
 -----------------------------------------------------------------------------
 INFO: Allocated in snd_seq_create_port+0x94/0x9b0 [snd_seq] age=1 cpu=3 pid=4511
 	___slab_alloc+0x425/0x460
 	__slab_alloc+0x20/0x40
  	kmem_cache_alloc_trace+0x150/0x190
	snd_seq_create_port+0x94/0x9b0 [snd_seq]
	snd_seq_ioctl_create_port+0xd1/0x630 [snd_seq]
 	snd_seq_do_ioctl+0x11c/0x190 [snd_seq]
 	snd_seq_ioctl+0x40/0x80 [snd_seq]
 	do_vfs_ioctl+0x54b/0xda0
 	SyS_ioctl+0x79/0x90
 	entry_SYSCALL_64_fastpath+0x16/0x75
 INFO: Freed in port_delete+0x136/0x1a0 [snd_seq] age=1 cpu=2 pid=4717
 	__slab_free+0x204/0x310
 	kfree+0x15f/0x180
 	port_delete+0x136/0x1a0 [snd_seq]
 	snd_seq_delete_port+0x235/0x350 [snd_seq]
 	snd_seq_ioctl_delete_port+0xc8/0x180 [snd_seq]
 	snd_seq_do_ioctl+0x11c/0x190 [snd_seq]
 	snd_seq_ioctl+0x40/0x80 [snd_seq]
 	do_vfs_ioctl+0x54b/0xda0
 	SyS_ioctl+0x79/0x90
 	entry_SYSCALL_64_fastpath+0x16/0x75
 Call Trace:
  [<ffffffff81b03781>] dump_stack+0x63/0x82
  [<ffffffff81531b3b>] print_trailer+0xfb/0x160
  [<ffffffff81536db4>] object_err+0x34/0x40
  [<ffffffff815392d3>] kasan_report.part.2+0x223/0x520
  [<ffffffffa07aadf4>] ? snd_seq_ioctl_create_port+0x504/0x630 [snd_seq]
  [<ffffffff815395fe>] __asan_report_load1_noabort+0x2e/0x30
  [<ffffffffa07aadf4>] snd_seq_ioctl_create_port+0x504/0x630 [snd_seq]
  [<ffffffffa07aa8f0>] ? snd_seq_ioctl_delete_port+0x180/0x180 [snd_seq]
  [<ffffffff8136be50>] ? taskstats_exit+0xbc0/0xbc0
  [<ffffffffa07abc5c>] snd_seq_do_ioctl+0x11c/0x190 [snd_seq]
  [<ffffffffa07abd10>] snd_seq_ioctl+0x40/0x80 [snd_seq]
  [<ffffffff8136d433>] ? acct_account_cputime+0x63/0x80
  [<ffffffff815b515b>] do_vfs_ioctl+0x54b/0xda0
  .....

We may fix this in a few different ways, and in this patch, it's fixed
simply by taking the refcount properly at snd_seq_create_port() and
letting the caller unref the object after use.  Also, there is another
potential use-after-free by sprintf() call in snd_seq_create_port(),
and this is moved inside the lock.

This fix covers CVE-2017-15265.

Reported-and-tested-by: Michael23 Yu <ycqzsy@gmail.com>
Suggested-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 sound/core/seq/seq_clientmgr.c |    6 +++++-
 sound/core/seq/seq_ports.c     |    7 +++++--
 2 files changed, 10 insertions(+), 3 deletions(-)

--- a/sound/core/seq/seq_clientmgr.c
+++ b/sound/core/seq/seq_clientmgr.c
@@ -1260,6 +1260,7 @@ static int snd_seq_ioctl_create_port(str
 	struct snd_seq_client_port *port;
 	struct snd_seq_port_info info;
 	struct snd_seq_port_callback *callback;
+	int port_idx;
 
 	if (copy_from_user(&info, arg, sizeof(info)))
 		return -EFAULT;
@@ -1273,7 +1274,9 @@ static int snd_seq_ioctl_create_port(str
 		return -ENOMEM;
 
 	if (client->type == USER_CLIENT && info.kernel) {
-		snd_seq_delete_port(client, port->addr.port);
+		port_idx = port->addr.port;
+		snd_seq_port_unlock(port);
+		snd_seq_delete_port(client, port_idx);
 		return -EINVAL;
 	}
 	if (client->type == KERNEL_CLIENT) {
@@ -1295,6 +1298,7 @@ static int snd_seq_ioctl_create_port(str
 
 	snd_seq_set_port_info(port, &info);
 	snd_seq_system_client_ev_port_start(port->addr.client, port->addr.port);
+	snd_seq_port_unlock(port);
 
 	if (copy_to_user(arg, &info, sizeof(info)))
 		return -EFAULT;
--- a/sound/core/seq/seq_ports.c
+++ b/sound/core/seq/seq_ports.c
@@ -122,7 +122,9 @@ static void port_subs_info_init(struct s
 }
 
 
-/* create a port, port number is returned (-1 on failure) */
+/* create a port, port number is returned (-1 on failure);
+ * the caller needs to unref the port via snd_seq_port_unlock() appropriately
+ */
 struct snd_seq_client_port *snd_seq_create_port(struct snd_seq_client *client,
 						int port)
 {
@@ -151,6 +153,7 @@ struct snd_seq_client_port *snd_seq_crea
 	snd_use_lock_init(&new_port->use_lock);
 	port_subs_info_init(&new_port->c_src);
 	port_subs_info_init(&new_port->c_dest);
+	snd_use_lock_use(&new_port->use_lock);
 
 	num = port >= 0 ? port : 0;
 	mutex_lock(&client->ports_mutex);
@@ -165,9 +168,9 @@ struct snd_seq_client_port *snd_seq_crea
 	list_add_tail(&new_port->list, &p->list);
 	client->num_ports++;
 	new_port->addr.port = num;	/* store the port number in the port */
+	sprintf(new_port->name, "port-%d", num);
 	write_unlock_irqrestore(&client->ports_lock, flags);
 	mutex_unlock(&client->ports_mutex);
-	sprintf(new_port->name, "port-%d", num);
 
 	return new_port;
 }

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

* [PATCH 3.18 10/19] ALSA: seq: Fix copy_from_user() call inside lock
  2017-10-16 16:11 [PATCH 3.18 00/19] 3.18.76-stable review Greg Kroah-Hartman
                   ` (7 preceding siblings ...)
  2017-10-16 16:12 ` [PATCH 3.18 09/19] ALSA: seq: Fix use-after-free at creating a port Greg Kroah-Hartman
@ 2017-10-16 16:12 ` Greg Kroah-Hartman
  2017-10-16 16:12 ` [PATCH 3.18 11/19] ALSA: caiaq: Fix stray URB at probe error path Greg Kroah-Hartman
                   ` (12 subsequent siblings)
  21 siblings, 0 replies; 30+ messages in thread
From: Greg Kroah-Hartman @ 2017-10-16 16:12 UTC (permalink / raw)
  To: linux-kernel; +Cc: Greg Kroah-Hartman, stable, Jia-Ju Bai, Takashi Iwai

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

------------------

From: Takashi Iwai <tiwai@suse.de>

commit 5803b023881857db32ffefa0d269c90280a67ee0 upstream.

The event handler in the virmidi sequencer code takes a read-lock for
the linked list traverse, while it's calling snd_seq_dump_var_event()
in the loop.  The latter function may expand the user-space data
depending on the event type.  It eventually invokes copy_from_user(),
which might be a potential dead-lock.

The sequencer core guarantees that the user-space data is passed only
with atomic=0 argument, but snd_virmidi_dev_receive_event() ignores it
and always takes read-lock().  For avoiding the problem above, this
patch introduces rwsem for non-atomic case, while keeping rwlock for
atomic case.

Also while we're at it: the superfluous irq flags is dropped in
snd_virmidi_input_open().

Reported-by: Jia-Ju Bai <baijiaju1990@163.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 include/sound/seq_virmidi.h  |    1 +
 sound/core/seq/seq_virmidi.c |   27 +++++++++++++++++++--------
 2 files changed, 20 insertions(+), 8 deletions(-)

--- a/include/sound/seq_virmidi.h
+++ b/include/sound/seq_virmidi.h
@@ -60,6 +60,7 @@ struct snd_virmidi_dev {
 	int port;			/* created/attached port */
 	unsigned int flags;		/* SNDRV_VIRMIDI_* */
 	rwlock_t filelist_lock;
+	struct rw_semaphore filelist_sem;
 	struct list_head filelist;
 };
 
--- a/sound/core/seq/seq_virmidi.c
+++ b/sound/core/seq/seq_virmidi.c
@@ -77,13 +77,17 @@ static void snd_virmidi_init_event(struc
  * decode input event and put to read buffer of each opened file
  */
 static int snd_virmidi_dev_receive_event(struct snd_virmidi_dev *rdev,
-					 struct snd_seq_event *ev)
+					 struct snd_seq_event *ev,
+					 bool atomic)
 {
 	struct snd_virmidi *vmidi;
 	unsigned char msg[4];
 	int len;
 
-	read_lock(&rdev->filelist_lock);
+	if (atomic)
+		read_lock(&rdev->filelist_lock);
+	else
+		down_read(&rdev->filelist_sem);
 	list_for_each_entry(vmidi, &rdev->filelist, list) {
 		if (!vmidi->trigger)
 			continue;
@@ -97,7 +101,10 @@ static int snd_virmidi_dev_receive_event
 				snd_rawmidi_receive(vmidi->substream, msg, len);
 		}
 	}
-	read_unlock(&rdev->filelist_lock);
+	if (atomic)
+		read_unlock(&rdev->filelist_lock);
+	else
+		up_read(&rdev->filelist_sem);
 
 	return 0;
 }
@@ -115,7 +122,7 @@ int snd_virmidi_receive(struct snd_rawmi
 	struct snd_virmidi_dev *rdev;
 
 	rdev = rmidi->private_data;
-	return snd_virmidi_dev_receive_event(rdev, ev);
+	return snd_virmidi_dev_receive_event(rdev, ev, true);
 }
 #endif  /*  0  */
 
@@ -130,7 +137,7 @@ static int snd_virmidi_event_input(struc
 	rdev = private_data;
 	if (!(rdev->flags & SNDRV_VIRMIDI_USE))
 		return 0; /* ignored */
-	return snd_virmidi_dev_receive_event(rdev, ev);
+	return snd_virmidi_dev_receive_event(rdev, ev, atomic);
 }
 
 /*
@@ -209,7 +216,6 @@ static int snd_virmidi_input_open(struct
 	struct snd_virmidi_dev *rdev = substream->rmidi->private_data;
 	struct snd_rawmidi_runtime *runtime = substream->runtime;
 	struct snd_virmidi *vmidi;
-	unsigned long flags;
 
 	vmidi = kzalloc(sizeof(*vmidi), GFP_KERNEL);
 	if (vmidi == NULL)
@@ -223,9 +229,11 @@ static int snd_virmidi_input_open(struct
 	vmidi->client = rdev->client;
 	vmidi->port = rdev->port;	
 	runtime->private_data = vmidi;
-	write_lock_irqsave(&rdev->filelist_lock, flags);
+	down_write(&rdev->filelist_sem);
+	write_lock_irq(&rdev->filelist_lock);
 	list_add_tail(&vmidi->list, &rdev->filelist);
-	write_unlock_irqrestore(&rdev->filelist_lock, flags);
+	write_unlock_irq(&rdev->filelist_lock);
+	up_write(&rdev->filelist_sem);
 	vmidi->rdev = rdev;
 	return 0;
 }
@@ -264,9 +272,11 @@ static int snd_virmidi_input_close(struc
 	struct snd_virmidi_dev *rdev = substream->rmidi->private_data;
 	struct snd_virmidi *vmidi = substream->runtime->private_data;
 
+	down_write(&rdev->filelist_sem);
 	write_lock_irq(&rdev->filelist_lock);
 	list_del(&vmidi->list);
 	write_unlock_irq(&rdev->filelist_lock);
+	up_write(&rdev->filelist_sem);
 	snd_midi_event_free(vmidi->parser);
 	substream->runtime->private_data = NULL;
 	kfree(vmidi);
@@ -520,6 +530,7 @@ int snd_virmidi_new(struct snd_card *car
 	rdev->rmidi = rmidi;
 	rdev->device = device;
 	rdev->client = -1;
+	init_rwsem(&rdev->filelist_sem);
 	rwlock_init(&rdev->filelist_lock);
 	INIT_LIST_HEAD(&rdev->filelist);
 	rdev->seq_mode = SNDRV_VIRMIDI_SEQ_DISPATCH;

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

* [PATCH 3.18 11/19] ALSA: caiaq: Fix stray URB at probe error path
  2017-10-16 16:11 [PATCH 3.18 00/19] 3.18.76-stable review Greg Kroah-Hartman
                   ` (8 preceding siblings ...)
  2017-10-16 16:12 ` [PATCH 3.18 10/19] ALSA: seq: Fix copy_from_user() call inside lock Greg Kroah-Hartman
@ 2017-10-16 16:12 ` Greg Kroah-Hartman
  2017-10-16 16:12 ` [PATCH 3.18 12/19] usb: gadget: composite: Fix use-after-free in usb_composite_overwrite_options Greg Kroah-Hartman
                   ` (11 subsequent siblings)
  21 siblings, 0 replies; 30+ messages in thread
From: Greg Kroah-Hartman @ 2017-10-16 16:12 UTC (permalink / raw)
  To: linux-kernel; +Cc: Greg Kroah-Hartman, stable, Johan Hovold, Takashi Iwai

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

------------------

From: Takashi Iwai <tiwai@suse.de>

commit 99fee508245825765ff60155fed43f970ff83a8f upstream.

caiaq driver doesn't kill the URB properly at its error path during
the probe, which may lead to a use-after-free error later.  This patch
addresses it.

Reported-by: Johan Hovold <johan@kernel.org>
Reviewed-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 sound/usb/caiaq/device.c |   12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

--- a/sound/usb/caiaq/device.c
+++ b/sound/usb/caiaq/device.c
@@ -469,10 +469,12 @@ static int init_card(struct snd_usb_caia
 
 	err = snd_usb_caiaq_send_command(cdev, EP1_CMD_GET_DEVICE_INFO, NULL, 0);
 	if (err)
-		return err;
+		goto err_kill_urb;
 
-	if (!wait_event_timeout(cdev->ep1_wait_queue, cdev->spec_received, HZ))
-		return -ENODEV;
+	if (!wait_event_timeout(cdev->ep1_wait_queue, cdev->spec_received, HZ)) {
+		err = -ENODEV;
+		goto err_kill_urb;
+	}
 
 	usb_string(usb_dev, usb_dev->descriptor.iManufacturer,
 		   cdev->vendor_name, CAIAQ_USB_STR_LEN);
@@ -507,6 +509,10 @@ static int init_card(struct snd_usb_caia
 
 	setup_card(cdev);
 	return 0;
+
+ err_kill_urb:
+	usb_kill_urb(&cdev->ep1_in_urb);
+	return err;
 }
 
 static int snd_probe(struct usb_interface *intf,

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

* [PATCH 3.18 12/19] usb: gadget: composite: Fix use-after-free in usb_composite_overwrite_options
  2017-10-16 16:11 [PATCH 3.18 00/19] 3.18.76-stable review Greg Kroah-Hartman
                   ` (9 preceding siblings ...)
  2017-10-16 16:12 ` [PATCH 3.18 11/19] ALSA: caiaq: Fix stray URB at probe error path Greg Kroah-Hartman
@ 2017-10-16 16:12 ` Greg Kroah-Hartman
  2017-10-16 16:12 ` [PATCH 3.18 13/19] direct-io: Prevent NULL pointer access in submit_page_section Greg Kroah-Hartman
                   ` (10 subsequent siblings)
  21 siblings, 0 replies; 30+ messages in thread
From: Greg Kroah-Hartman @ 2017-10-16 16:12 UTC (permalink / raw)
  To: linux-kernel; +Cc: Greg Kroah-Hartman, stable, Andrew Gabbasov, Felipe Balbi

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

------------------

From: Andrew Gabbasov <andrew_gabbasov@mentor.com>

commit aec17e1e249567e82b26dafbb86de7d07fde8729 upstream.

KASAN enabled configuration reports an error

    BUG: KASAN: use-after-free in usb_composite_overwrite_options+...
                [libcomposite] at addr ...
    Read of size 1 by task ...

when some driver is un-bound and then bound again.
For example, this happens with FunctionFS driver when "ffs-test"
test application is run several times in a row.

If the driver has empty manufacturer ID string in initial static data,
it is then replaced with generated string. After driver unbinding
the generated string is freed, but the driver data still keep that
pointer. And if the driver is then bound again, that pointer
is re-used for string emptiness check.

The fix is to clean up the driver string data upon its unbinding
to drop the pointer to freed memory.

Fixes: cc2683c318a5 ("usb: gadget: Provide a default implementation of default manufacturer string")
Signed-off-by: Andrew Gabbasov <andrew_gabbasov@mentor.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/usb/gadget/composite.c |    5 +++++
 1 file changed, 5 insertions(+)

--- a/drivers/usb/gadget/composite.c
+++ b/drivers/usb/gadget/composite.c
@@ -1806,6 +1806,8 @@ static DEVICE_ATTR_RO(suspended);
 static void __composite_unbind(struct usb_gadget *gadget, bool unbind_driver)
 {
 	struct usb_composite_dev	*cdev = get_gadget_data(gadget);
+	struct usb_gadget_strings	*gstr = cdev->driver->strings[0];
+	struct usb_string		*dev_str = gstr->strings;
 
 	/* composite_disconnect() must already have been called
 	 * by the underlying peripheral controller driver!
@@ -1825,6 +1827,9 @@ static void __composite_unbind(struct us
 
 	composite_dev_cleanup(cdev);
 
+	if (dev_str[USB_GADGET_MANUFACTURER_IDX].s == cdev->def_manufacturer)
+		dev_str[USB_GADGET_MANUFACTURER_IDX].s = "";
+
 	kfree(cdev->def_manufacturer);
 	kfree(cdev);
 	set_gadget_data(gadget, NULL);

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

* [PATCH 3.18 13/19] direct-io: Prevent NULL pointer access in submit_page_section
  2017-10-16 16:11 [PATCH 3.18 00/19] 3.18.76-stable review Greg Kroah-Hartman
                   ` (10 preceding siblings ...)
  2017-10-16 16:12 ` [PATCH 3.18 12/19] usb: gadget: composite: Fix use-after-free in usb_composite_overwrite_options Greg Kroah-Hartman
@ 2017-10-16 16:12 ` Greg Kroah-Hartman
  2017-10-16 16:12 ` [PATCH 3.18 14/19] fix unbalanced page refcounting in bio_map_user_iov Greg Kroah-Hartman
                   ` (9 subsequent siblings)
  21 siblings, 0 replies; 30+ messages in thread
From: Greg Kroah-Hartman @ 2017-10-16 16:12 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, stable, Andreas Gruenbacher, Jan Kara, Al Viro

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

------------------

From: Andreas Gruenbacher <agruenba@redhat.com>

commit 899f0429c7d3eed886406cd72182bee3b96aa1f9 upstream.

In the code added to function submit_page_section by commit b1058b981,
sdio->bio can currently be NULL when calling dio_bio_submit.  This then
leads to a NULL pointer access in dio_bio_submit, so check for a NULL
bio in submit_page_section before trying to submit it instead.

Fixes xfstest generic/250 on gfs2.

Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
Reviewed-by: Jan Kara <jack@suse.cz>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 fs/direct-io.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

--- a/fs/direct-io.c
+++ b/fs/direct-io.c
@@ -812,7 +812,8 @@ out:
 	 */
 	if (sdio->boundary) {
 		ret = dio_send_cur_page(dio, sdio, map_bh);
-		dio_bio_submit(dio, sdio);
+		if (sdio->bio)
+			dio_bio_submit(dio, sdio);
 		page_cache_release(sdio->cur_page);
 		sdio->cur_page = NULL;
 	}

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

* [PATCH 3.18 14/19] fix unbalanced page refcounting in bio_map_user_iov
  2017-10-16 16:11 [PATCH 3.18 00/19] 3.18.76-stable review Greg Kroah-Hartman
                   ` (11 preceding siblings ...)
  2017-10-16 16:12 ` [PATCH 3.18 13/19] direct-io: Prevent NULL pointer access in submit_page_section Greg Kroah-Hartman
@ 2017-10-16 16:12 ` Greg Kroah-Hartman
  2017-10-16 16:12 ` [PATCH 3.18 15/19] USB: serial: cp210x: add support for ELV TFD500 Greg Kroah-Hartman
                   ` (8 subsequent siblings)
  21 siblings, 0 replies; 30+ messages in thread
From: Greg Kroah-Hartman @ 2017-10-16 16:12 UTC (permalink / raw)
  To: linux-kernel; +Cc: Greg Kroah-Hartman, stable, Vitaly Mayatskikh, Al Viro

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

------------------

From: Vitaly Mayatskikh <v.mayatskih@gmail.com>

commit 95d78c28b5a85bacbc29b8dba7c04babb9b0d467 upstream.

bio_map_user_iov and bio_unmap_user do unbalanced pages refcounting if
IO vector has small consecutive buffers belonging to the same page.
bio_add_pc_page merges them into one, but the page reference is never
dropped.

Signed-off-by: Vitaly Mayatskikh <v.mayatskih@gmail.com>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 block/bio.c |    8 ++++++++
 1 file changed, 8 insertions(+)

--- a/block/bio.c
+++ b/block/bio.c
@@ -1338,6 +1338,7 @@ static struct bio *__bio_map_user_iov(st
 		offset = uaddr & ~PAGE_MASK;
 		for (j = cur_page; j < page_limit; j++) {
 			unsigned int bytes = PAGE_SIZE - offset;
+			unsigned short prev_bi_vcnt = bio->bi_vcnt;
 
 			if (len <= 0)
 				break;
@@ -1352,6 +1353,13 @@ static struct bio *__bio_map_user_iov(st
 					    bytes)
 				break;
 
+			/*
+			 * check if vector was merged with previous
+			 * drop page reference if needed
+			 */
+			if (bio->bi_vcnt == prev_bi_vcnt)
+				put_page(pages[j]);
+
 			len -= bytes;
 			offset = 0;
 		}

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

* [PATCH 3.18 15/19] USB: serial: cp210x: add support for ELV TFD500
  2017-10-16 16:11 [PATCH 3.18 00/19] 3.18.76-stable review Greg Kroah-Hartman
                   ` (12 preceding siblings ...)
  2017-10-16 16:12 ` [PATCH 3.18 14/19] fix unbalanced page refcounting in bio_map_user_iov Greg Kroah-Hartman
@ 2017-10-16 16:12 ` Greg Kroah-Hartman
  2017-10-16 16:12 ` [PATCH 3.18 16/19] USB: serial: option: add support for TP-Link LTE module Greg Kroah-Hartman
                   ` (7 subsequent siblings)
  21 siblings, 0 replies; 30+ messages in thread
From: Greg Kroah-Hartman @ 2017-10-16 16:12 UTC (permalink / raw)
  To: linux-kernel; +Cc: Greg Kroah-Hartman, stable, Andreas Engel, Johan Hovold

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

------------------

From: Andreas Engel <anen-nospam@gmx.net>

commit c496ad835c31ad639b6865714270b3003df031f6 upstream.

Add the USB device id for the ELV TFD500 data logger.

Signed-off-by: Andreas Engel <anen-nospam@gmx.net>
Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/usb/serial/cp210x.c |    1 +
 1 file changed, 1 insertion(+)

--- a/drivers/usb/serial/cp210x.c
+++ b/drivers/usb/serial/cp210x.c
@@ -168,6 +168,7 @@ static const struct usb_device_id id_tab
 	{ USB_DEVICE(0x1843, 0x0200) }, /* Vaisala USB Instrument Cable */
 	{ USB_DEVICE(0x18EF, 0xE00F) }, /* ELV USB-I2C-Interface */
 	{ USB_DEVICE(0x18EF, 0xE025) }, /* ELV Marble Sound Board 1 */
+	{ USB_DEVICE(0x18EF, 0xE032) }, /* ELV TFD500 Data Logger */
 	{ USB_DEVICE(0x1901, 0x0190) }, /* GE B850 CP2105 Recorder interface */
 	{ USB_DEVICE(0x1901, 0x0193) }, /* GE B650 CP2104 PMC interface */
 	{ USB_DEVICE(0x1901, 0x0194) },	/* GE Healthcare Remote Alarm Box */

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

* [PATCH 3.18 16/19] USB: serial: option: add support for TP-Link LTE module
  2017-10-16 16:11 [PATCH 3.18 00/19] 3.18.76-stable review Greg Kroah-Hartman
                   ` (13 preceding siblings ...)
  2017-10-16 16:12 ` [PATCH 3.18 15/19] USB: serial: cp210x: add support for ELV TFD500 Greg Kroah-Hartman
@ 2017-10-16 16:12 ` Greg Kroah-Hartman
  2017-10-16 16:12 ` [PATCH 3.18 17/19] USB: serial: qcserial: add Dell DW5818, DW5819 Greg Kroah-Hartman
                   ` (6 subsequent siblings)
  21 siblings, 0 replies; 30+ messages in thread
From: Greg Kroah-Hartman @ 2017-10-16 16:12 UTC (permalink / raw)
  To: linux-kernel; +Cc: Greg Kroah-Hartman, stable, Henryk Heisig, Johan Hovold

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

------------------

From: Henryk Heisig <hyniu@o2.pl>

commit 837ddc4793a69b256ac5e781a5e729b448a8d983 upstream.

This commit adds support for TP-Link LTE mPCIe module is used
in in TP-Link MR200v1, MR6400v1 and v2 routers.

Signed-off-by: Henryk Heisig <hyniu@o2.pl>
Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/usb/serial/option.c |    2 ++
 1 file changed, 2 insertions(+)

--- a/drivers/usb/serial/option.c
+++ b/drivers/usb/serial/option.c
@@ -515,6 +515,7 @@ static void option_instat_callback(struc
 
 /* TP-LINK Incorporated products */
 #define TPLINK_VENDOR_ID			0x2357
+#define TPLINK_PRODUCT_LTE			0x000D
 #define TPLINK_PRODUCT_MA180			0x0201
 
 /* Changhong products */
@@ -2006,6 +2007,7 @@ static const struct usb_device_id option
 	{ USB_DEVICE(CELLIENT_VENDOR_ID, CELLIENT_PRODUCT_MEN200) },
 	{ USB_DEVICE(PETATEL_VENDOR_ID, PETATEL_PRODUCT_NP10T_600A) },
 	{ USB_DEVICE(PETATEL_VENDOR_ID, PETATEL_PRODUCT_NP10T_600E) },
+	{ USB_DEVICE_AND_INTERFACE_INFO(TPLINK_VENDOR_ID, TPLINK_PRODUCT_LTE, 0xff, 0x00, 0x00) },	/* TP-Link LTE Module */
 	{ USB_DEVICE(TPLINK_VENDOR_ID, TPLINK_PRODUCT_MA180),
 	  .driver_info = (kernel_ulong_t)&net_intf4_blacklist },
 	{ USB_DEVICE(TPLINK_VENDOR_ID, 0x9000),					/* TP-Link MA260 */

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

* [PATCH 3.18 17/19] USB: serial: qcserial: add Dell DW5818, DW5819
  2017-10-16 16:11 [PATCH 3.18 00/19] 3.18.76-stable review Greg Kroah-Hartman
                   ` (14 preceding siblings ...)
  2017-10-16 16:12 ` [PATCH 3.18 16/19] USB: serial: option: add support for TP-Link LTE module Greg Kroah-Hartman
@ 2017-10-16 16:12 ` Greg Kroah-Hartman
  2017-10-16 16:12 ` [PATCH 3.18 18/19] USB: serial: console: fix use-after-free after failed setup Greg Kroah-Hartman
                   ` (5 subsequent siblings)
  21 siblings, 0 replies; 30+ messages in thread
From: Greg Kroah-Hartman @ 2017-10-16 16:12 UTC (permalink / raw)
  To: linux-kernel; +Cc: Greg Kroah-Hartman, stable, Shrirang Bagul, Johan Hovold

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

------------------

From: Shrirang Bagul <shrirang.bagul@canonical.com>

commit f5d9644c5fca7d8e8972268598bb516a7eae17f9 upstream.

Dell Wireless 5819/5818 devices are re-branded Sierra Wireless MC74
series which will by default boot with vid 0x413c and pid's 0x81cf,
0x81d0, 0x81d1, 0x81d2.

Signed-off-by: Shrirang Bagul <shrirang.bagul@canonical.com>
Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/usb/serial/qcserial.c |    4 ++++
 1 file changed, 4 insertions(+)

--- a/drivers/usb/serial/qcserial.c
+++ b/drivers/usb/serial/qcserial.c
@@ -168,6 +168,10 @@ static const struct usb_device_id id_tab
 	{DEVICE_SWI(0x413c, 0x81b3)},	/* Dell Wireless 5809e Gobi(TM) 4G LTE Mobile Broadband Card (rev3) */
 	{DEVICE_SWI(0x413c, 0x81b5)},	/* Dell Wireless 5811e QDL */
 	{DEVICE_SWI(0x413c, 0x81b6)},	/* Dell Wireless 5811e QDL */
+	{DEVICE_SWI(0x413c, 0x81cf)},   /* Dell Wireless 5819 */
+	{DEVICE_SWI(0x413c, 0x81d0)},   /* Dell Wireless 5819 */
+	{DEVICE_SWI(0x413c, 0x81d1)},   /* Dell Wireless 5818 */
+	{DEVICE_SWI(0x413c, 0x81d2)},   /* Dell Wireless 5818 */
 
 	/* Huawei devices */
 	{DEVICE_HWI(0x03f0, 0x581d)},	/* HP lt4112 LTE/HSPA+ Gobi 4G Modem (Huawei me906e) */

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

* [PATCH 3.18 18/19] USB: serial: console: fix use-after-free after failed setup
  2017-10-16 16:11 [PATCH 3.18 00/19] 3.18.76-stable review Greg Kroah-Hartman
                   ` (15 preceding siblings ...)
  2017-10-16 16:12 ` [PATCH 3.18 17/19] USB: serial: qcserial: add Dell DW5818, DW5819 Greg Kroah-Hartman
@ 2017-10-16 16:12 ` Greg Kroah-Hartman
  2017-10-16 16:12 ` [PATCH 3.18 19/19] ALSA: seq: Fix missing NULL check at remove_events ioctl Greg Kroah-Hartman
                   ` (4 subsequent siblings)
  21 siblings, 0 replies; 30+ messages in thread
From: Greg Kroah-Hartman @ 2017-10-16 16:12 UTC (permalink / raw)
  To: linux-kernel; +Cc: Greg Kroah-Hartman, stable, Johan Hovold

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

------------------

From: Johan Hovold <johan@kernel.org>

commit 299d7572e46f98534033a9e65973f13ad1ce9047 upstream.

Make sure to reset the USB-console port pointer when console setup fails
in order to avoid having the struct usb_serial be prematurely freed by
the console code when the device is later disconnected.

Fixes: 73e487fdb75f ("[PATCH] USB console: fix disconnection issues")
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/usb/serial/console.c |    1 +
 1 file changed, 1 insertion(+)

--- a/drivers/usb/serial/console.c
+++ b/drivers/usb/serial/console.c
@@ -187,6 +187,7 @@ static int usb_console_setup(struct cons
 	tty_kref_put(tty);
  reset_open_count:
 	port->port.count = 0;
+	info->port = NULL;
 	usb_autopm_put_interface(serial->interface);
  error_get_interface:
 	usb_serial_put(serial);

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

* [PATCH 3.18 19/19] ALSA: seq: Fix missing NULL check at remove_events ioctl
  2017-10-16 16:11 [PATCH 3.18 00/19] 3.18.76-stable review Greg Kroah-Hartman
                   ` (16 preceding siblings ...)
  2017-10-16 16:12 ` [PATCH 3.18 18/19] USB: serial: console: fix use-after-free after failed setup Greg Kroah-Hartman
@ 2017-10-16 16:12 ` Greg Kroah-Hartman
  2017-10-16 23:42 ` [PATCH 3.18 00/19] 3.18.76-stable review Shuah Khan
                   ` (3 subsequent siblings)
  21 siblings, 0 replies; 30+ messages in thread
From: Greg Kroah-Hartman @ 2017-10-16 16:12 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, stable, Dmitry Vyukov, Takashi Iwai, Mark Salyzyn

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

------------------

From: Takashi Iwai <tiwai@suse.de>

commit 030e2c78d3a91dd0d27fef37e91950dde333eba1 upstream.

snd_seq_ioctl_remove_events() calls snd_seq_fifo_clear()
unconditionally even if there is no FIFO assigned, and this leads to
an Oops due to NULL dereference.  The fix is just to add a proper NULL
check.

Reported-by: Dmitry Vyukov <dvyukov@google.com>
Tested-by: Dmitry Vyukov <dvyukov@google.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Cc: Mark Salyzyn <salyzyn@google.com>
Cc: Dmitry Vyukov <dvyukov@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 sound/core/seq/seq_clientmgr.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/sound/core/seq/seq_clientmgr.c
+++ b/sound/core/seq/seq_clientmgr.c
@@ -1970,7 +1970,7 @@ static int snd_seq_ioctl_remove_events(s
 		 * No restrictions so for a user client we can clear
 		 * the whole fifo
 		 */
-		if (client->type == USER_CLIENT)
+		if (client->type == USER_CLIENT && client->data.user.fifo)
 			snd_seq_fifo_clear(client->data.user.fifo);
 	}
 

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

* Re: [PATCH 3.18 08/19] ALSA: usb-audio: Kill stray URB at exiting
  2017-10-16 16:11 ` [PATCH 3.18 08/19] ALSA: usb-audio: Kill stray URB at exiting Greg Kroah-Hartman
@ 2017-10-16 18:50   ` Takashi Iwai
  2017-10-17 14:07     ` Greg Kroah-Hartman
  0 siblings, 1 reply; 30+ messages in thread
From: Takashi Iwai @ 2017-10-16 18:50 UTC (permalink / raw)
  To: Greg Kroah-Hartman; +Cc: linux-kernel, stable, Andrey Konovalov

On Mon, 16 Oct 2017 18:11:59 +0200,
Greg Kroah-Hartman wrote:
> 
> 3.18-stable review patch.  If anyone has any objections, please let me know.
> 
> ------------------
> 
> From: Takashi Iwai <tiwai@suse.de>
> 
> commit 124751d5e63c823092060074bd0abaae61aaa9c4 upstream.
> 
> USB-audio driver may leave a stray URB for the mixer interrupt when it
> exits by some error during probe.  This leads to a use-after-free
> error as spotted by syzkaller like:
>   ==================================================================
>   BUG: KASAN: use-after-free in snd_usb_mixer_interrupt+0x604/0x6f0
>   Call Trace:
>    <IRQ>
>    __dump_stack lib/dump_stack.c:16
>    dump_stack+0x292/0x395 lib/dump_stack.c:52
>    print_address_description+0x78/0x280 mm/kasan/report.c:252
>    kasan_report_error mm/kasan/report.c:351
>    kasan_report+0x23d/0x350 mm/kasan/report.c:409
>    __asan_report_load8_noabort+0x19/0x20 mm/kasan/report.c:430
>    snd_usb_mixer_interrupt+0x604/0x6f0 sound/usb/mixer.c:2490
>    __usb_hcd_giveback_urb+0x2e0/0x650 drivers/usb/core/hcd.c:1779
>    ....
> 
>   Allocated by task 1484:
>    save_stack_trace+0x1b/0x20 arch/x86/kernel/stacktrace.c:59
>    save_stack+0x43/0xd0 mm/kasan/kasan.c:447
>    set_track mm/kasan/kasan.c:459
>    kasan_kmalloc+0xad/0xe0 mm/kasan/kasan.c:551
>    kmem_cache_alloc_trace+0x11e/0x2d0 mm/slub.c:2772
>    kmalloc ./include/linux/slab.h:493
>    kzalloc ./include/linux/slab.h:666
>    snd_usb_create_mixer+0x145/0x1010 sound/usb/mixer.c:2540
>    create_standard_mixer_quirk+0x58/0x80 sound/usb/quirks.c:516
>    snd_usb_create_quirk+0x92/0x100 sound/usb/quirks.c:560
>    create_composite_quirk+0x1c4/0x3e0 sound/usb/quirks.c:59
>    snd_usb_create_quirk+0x92/0x100 sound/usb/quirks.c:560
>    usb_audio_probe+0x1040/0x2c10 sound/usb/card.c:618
>    ....
> 
>   Freed by task 1484:
>    save_stack_trace+0x1b/0x20 arch/x86/kernel/stacktrace.c:59
>    save_stack+0x43/0xd0 mm/kasan/kasan.c:447
>    set_track mm/kasan/kasan.c:459
>    kasan_slab_free+0x72/0xc0 mm/kasan/kasan.c:524
>    slab_free_hook mm/slub.c:1390
>    slab_free_freelist_hook mm/slub.c:1412
>    slab_free mm/slub.c:2988
>    kfree+0xf6/0x2f0 mm/slub.c:3919
>    snd_usb_mixer_free+0x11a/0x160 sound/usb/mixer.c:2244
>    snd_usb_mixer_dev_free+0x36/0x50 sound/usb/mixer.c:2250
>    __snd_device_free+0x1ff/0x380 sound/core/device.c:91
>    snd_device_free_all+0x8f/0xe0 sound/core/device.c:244
>    snd_card_do_free sound/core/init.c:461
>    release_card_device+0x47/0x170 sound/core/init.c:181
>    device_release+0x13f/0x210 drivers/base/core.c:814
>    ....
> 
> Actually such a URB is killed properly at disconnection when the
> device gets probed successfully, and what we need is to apply it for
> the error-path, too.
> 
> In this patch, we apply snd_usb_mixer_disconnect() at releasing.
> Also introduce a new flag, disconnected, to struct usb_mixer_interface
> for not performing the disconnection procedure twice.
> 
> Reported-by: Andrey Konovalov <andreyknvl@google.com>
> Tested-by: Andrey Konovalov <andreyknvl@google.com>
> Signed-off-by: Takashi Iwai <tiwai@suse.de>
> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> 
> ---
>  sound/usb/mixer.c |   12 ++++++++++--
>  sound/usb/mixer.h |    2 ++
>  2 files changed, 12 insertions(+), 2 deletions(-)
> 
> --- a/sound/usb/mixer.c
> +++ b/sound/usb/mixer.c
> @@ -2157,6 +2157,9 @@ static int parse_audio_unit(struct mixer
>  
>  static void snd_usb_mixer_free(struct usb_mixer_interface *mixer)
>  {
> +	/* kill pending URBs */
> +	snd_usb_mixer_disconnect(mixer);
> +
>  	kfree(mixer->id_elems);
>  	if (mixer->urb) {
>  		kfree(mixer->urb->transfer_buffer);
> @@ -2501,8 +2504,13 @@ void snd_usb_mixer_disconnect(struct lis
>  /* stop any bus activity of a mixer */
>  static void snd_usb_mixer_inactivate(struct usb_mixer_interface *mixer)
>  {
> -	usb_kill_urb(mixer->urb);
> -	usb_kill_urb(mixer->rc_urb);
> +	if (mixer->disconnected)
> +		return;
> +	if (mixer->urb)
> +		usb_kill_urb(mixer->urb);
> +	if (mixer->rc_urb)
> +		usb_kill_urb(mixer->rc_urb);
> +	mixer->disconnected = true;

This looks applied wrongly, as already caught by kbuild bot.
The snd_usb_mixer_disconnect() argument changed in the later kernel,
thus the patch couldn't be applied cleanly as is.

Below is the revised patch (but only compile-tested).


thanks,

Takashi

-- 8< --
From: Takashi Iwai <tiwai@suse.de>
Subject: [PATCH 3.18.y] ALSA: usb-audio: Kill stray URB at exiting

commit 124751d5e63c823092060074bd0abaae61aaa9c4 upstream.

USB-audio driver may leave a stray URB for the mixer interrupt when it
exits by some error during probe.  This leads to a use-after-free
error as spotted by syzkaller like:
  ==================================================================
  BUG: KASAN: use-after-free in snd_usb_mixer_interrupt+0x604/0x6f0
  Call Trace:
   <IRQ>
   __dump_stack lib/dump_stack.c:16
   dump_stack+0x292/0x395 lib/dump_stack.c:52
   print_address_description+0x78/0x280 mm/kasan/report.c:252
   kasan_report_error mm/kasan/report.c:351
   kasan_report+0x23d/0x350 mm/kasan/report.c:409
   __asan_report_load8_noabort+0x19/0x20 mm/kasan/report.c:430
   snd_usb_mixer_interrupt+0x604/0x6f0 sound/usb/mixer.c:2490
   __usb_hcd_giveback_urb+0x2e0/0x650 drivers/usb/core/hcd.c:1779
   ....

  Allocated by task 1484:
   save_stack_trace+0x1b/0x20 arch/x86/kernel/stacktrace.c:59
   save_stack+0x43/0xd0 mm/kasan/kasan.c:447
   set_track mm/kasan/kasan.c:459
   kasan_kmalloc+0xad/0xe0 mm/kasan/kasan.c:551
   kmem_cache_alloc_trace+0x11e/0x2d0 mm/slub.c:2772
   kmalloc ./include/linux/slab.h:493
   kzalloc ./include/linux/slab.h:666
   snd_usb_create_mixer+0x145/0x1010 sound/usb/mixer.c:2540
   create_standard_mixer_quirk+0x58/0x80 sound/usb/quirks.c:516
   snd_usb_create_quirk+0x92/0x100 sound/usb/quirks.c:560
   create_composite_quirk+0x1c4/0x3e0 sound/usb/quirks.c:59
   snd_usb_create_quirk+0x92/0x100 sound/usb/quirks.c:560
   usb_audio_probe+0x1040/0x2c10 sound/usb/card.c:618
   ....

  Freed by task 1484:
   save_stack_trace+0x1b/0x20 arch/x86/kernel/stacktrace.c:59
   save_stack+0x43/0xd0 mm/kasan/kasan.c:447
   set_track mm/kasan/kasan.c:459
   kasan_slab_free+0x72/0xc0 mm/kasan/kasan.c:524
   slab_free_hook mm/slub.c:1390
   slab_free_freelist_hook mm/slub.c:1412
   slab_free mm/slub.c:2988
   kfree+0xf6/0x2f0 mm/slub.c:3919
   snd_usb_mixer_free+0x11a/0x160 sound/usb/mixer.c:2244
   snd_usb_mixer_dev_free+0x36/0x50 sound/usb/mixer.c:2250
   __snd_device_free+0x1ff/0x380 sound/core/device.c:91
   snd_device_free_all+0x8f/0xe0 sound/core/device.c:244
   snd_card_do_free sound/core/init.c:461
   release_card_device+0x47/0x170 sound/core/init.c:181
   device_release+0x13f/0x210 drivers/base/core.c:814
   ....

Actually such a URB is killed properly at disconnection when the
device gets probed successfully, and what we need is to apply it for
the error-path, too.

In this patch, we apply snd_usb_mixer_disconnect() at releasing.
Also introduce a new flag, disconnected, to struct usb_mixer_interface
for not performing the disconnection procedure twice.

Reported-by: Andrey Konovalov <andreyknvl@google.com>
Tested-by: Andrey Konovalov <andreyknvl@google.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
---
 sound/usb/mixer.c | 12 ++++++++++--
 sound/usb/mixer.h |  1 +
 2 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/sound/usb/mixer.c b/sound/usb/mixer.c
index 1ceeb9e875a4..d0bbc7b32190 100644
--- a/sound/usb/mixer.c
+++ b/sound/usb/mixer.c
@@ -2157,6 +2157,9 @@ static int parse_audio_unit(struct mixer_build *state, int unitid)
 
 static void snd_usb_mixer_free(struct usb_mixer_interface *mixer)
 {
+	/* kill pending URBs */
+	snd_usb_mixer_disconnect(&mixer->list);
+
 	kfree(mixer->id_elems);
 	if (mixer->urb) {
 		kfree(mixer->urb->transfer_buffer);
@@ -2493,8 +2496,13 @@ void snd_usb_mixer_disconnect(struct list_head *p)
 	struct usb_mixer_interface *mixer;
 
 	mixer = list_entry(p, struct usb_mixer_interface, list);
-	usb_kill_urb(mixer->urb);
-	usb_kill_urb(mixer->rc_urb);
+	if (mixer->disconnected)
+		return;
+	if (mixer->urb)
+		usb_kill_urb(mixer->urb);
+	if (mixer->rc_urb)
+		usb_kill_urb(mixer->rc_urb);
+	mixer->disconnected = true;
 }
 
 #ifdef CONFIG_PM
diff --git a/sound/usb/mixer.h b/sound/usb/mixer.h
index 73b1f649447b..cdff31de12d4 100644
--- a/sound/usb/mixer.h
+++ b/sound/usb/mixer.h
@@ -23,6 +23,7 @@ struct usb_mixer_interface {
 
 	u8 audigy2nx_leds[3];
 	u8 xonar_u1_status;
+	bool disconnected;
 };
 
 #define MAX_CHANNELS	16	/* max logical channels */
-- 
2.14.2

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

* Re: [PATCH 3.18 00/19] 3.18.76-stable review
  2017-10-16 16:11 [PATCH 3.18 00/19] 3.18.76-stable review Greg Kroah-Hartman
                   ` (17 preceding siblings ...)
  2017-10-16 16:12 ` [PATCH 3.18 19/19] ALSA: seq: Fix missing NULL check at remove_events ioctl Greg Kroah-Hartman
@ 2017-10-16 23:42 ` Shuah Khan
  2017-10-17  0:23 ` Guenter Roeck
                   ` (2 subsequent siblings)
  21 siblings, 0 replies; 30+ messages in thread
From: Shuah Khan @ 2017-10-16 23:42 UTC (permalink / raw)
  To: Greg Kroah-Hartman, linux-kernel
  Cc: torvalds, akpm, linux, patches, ben.hutchings, stable, Shuah Khan

On 10/16/2017 10:11 AM, Greg Kroah-Hartman wrote:
> This is the start of the stable review cycle for the 3.18.76 release.
> There are 19 patches in this series, all will be posted as a response
> to this one.  If anyone has any issues with these being applied, please
> let me know.
> 
> Responses should be made by Wed Oct 18 16:09:03 UTC 2017.
> Anything received after that time might be too late.
> 
> The whole patch series can be found in one patch at:
> 	kernel.org/pub/linux/kernel/v3.x/stable-review/patch-3.18.76-rc1.gz
> or in the git tree and branch at:
>   git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-3.18.y
> and the diffstat can be found below.
> 
> thanks,
> 
> greg k-h
> 

Compiled and booted on my test system. No dmesg and kselftest regressions.

thanks,
-- Shuah

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

* Re: [PATCH 3.18 00/19] 3.18.76-stable review
  2017-10-16 16:11 [PATCH 3.18 00/19] 3.18.76-stable review Greg Kroah-Hartman
                   ` (18 preceding siblings ...)
  2017-10-16 23:42 ` [PATCH 3.18 00/19] 3.18.76-stable review Shuah Khan
@ 2017-10-17  0:23 ` Guenter Roeck
       [not found] ` <59e53ebe.532f1c0a.7d93d.9f31@mx.google.com>
  2017-10-17 14:40 ` Greg Kroah-Hartman
  21 siblings, 0 replies; 30+ messages in thread
From: Guenter Roeck @ 2017-10-17  0:23 UTC (permalink / raw)
  To: Greg Kroah-Hartman, linux-kernel
  Cc: torvalds, akpm, shuahkh, patches, ben.hutchings, stable

On 10/16/2017 09:11 AM, Greg Kroah-Hartman wrote:
> This is the start of the stable review cycle for the 3.18.76 release.
> There are 19 patches in this series, all will be posted as a response
> to this one.  If anyone has any issues with these being applied, please
> let me know.
> 
> Responses should be made by Wed Oct 18 16:09:03 UTC 2017.
> Anything received after that time might be too late.
> 

Build results:
	total: 136 pass: 136 fail: 0
Qemu test results:
	total: 112 pass: 112 fail: 0

Details are available at http://kerneltests.org/builders.

Guenter

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

* Re: [PATCH 3.18 00/19] 3.18.76-stable review
       [not found] ` <59e53ebe.532f1c0a.7d93d.9f31@mx.google.com>
@ 2017-10-17 13:22   ` Greg Kroah-Hartman
  2017-10-19 12:21     ` Kevin Hilman
  0 siblings, 1 reply; 30+ messages in thread
From: Greg Kroah-Hartman @ 2017-10-17 13:22 UTC (permalink / raw)
  To: kernelci.org bot
  Cc: linux-kernel, torvalds, akpm, linux, shuahkh, patches,
	ben.hutchings, stable

On Mon, Oct 16, 2017 at 04:20:30PM -0700, kernelci.org bot wrote:
> stable-rc/linux-3.18.y boot: 39 boots: 3 failed, 36 passed (v3.18.75-20-g4ffe55402429)
> 
> Full Boot Summary: https://kernelci.org/boot/all/job/stable-rc/branch/linux-3.18.y/kernel/v3.18.75-20-g4ffe55402429/
> Full Build Summary: https://kernelci.org/build/stable-rc/branch/linux-3.18.y/kernel/v3.18.75-20-g4ffe55402429/
> 
> Tree: stable-rc
> Branch: linux-3.18.y
> Git Describe: v3.18.75-20-g4ffe55402429
> Git Commit: 4ffe55402429b1be08b48d02b7be9371148c68b6
> Git URL: http://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git
> Tested: 12 unique boards, 6 SoC families, 10 builds out of 182
> 
> Boot Failures Detected:
> 
> arm:
> 
>     omap2plus_defconfig
>         am335x-boneblack: 1 failed lab
> 
>     exynos_defconfig
>         exynos5800-peach-pi: 1 failed lab
> 
>     multi_v7_defconfig
>         imx6q-sabrelite: 1 failed lab

Thanks for all of the reports.  They all look good except this for 3.18.
Is this to be expected?

thanks,

greg k-h

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

* Re: [PATCH 3.18 08/19] ALSA: usb-audio: Kill stray URB at exiting
  2017-10-16 18:50   ` Takashi Iwai
@ 2017-10-17 14:07     ` Greg Kroah-Hartman
  0 siblings, 0 replies; 30+ messages in thread
From: Greg Kroah-Hartman @ 2017-10-17 14:07 UTC (permalink / raw)
  To: Takashi Iwai; +Cc: linux-kernel, stable, Andrey Konovalov

On Mon, Oct 16, 2017 at 08:50:02PM +0200, Takashi Iwai wrote:
> On Mon, 16 Oct 2017 18:11:59 +0200,
> Greg Kroah-Hartman wrote:
> > 
> > 3.18-stable review patch.  If anyone has any objections, please let me know.
> > 
> > ------------------
> > 
> > From: Takashi Iwai <tiwai@suse.de>
> > 
> > commit 124751d5e63c823092060074bd0abaae61aaa9c4 upstream.
> > 
> > USB-audio driver may leave a stray URB for the mixer interrupt when it
> > exits by some error during probe.  This leads to a use-after-free
> > error as spotted by syzkaller like:
> >   ==================================================================
> >   BUG: KASAN: use-after-free in snd_usb_mixer_interrupt+0x604/0x6f0
> >   Call Trace:
> >    <IRQ>
> >    __dump_stack lib/dump_stack.c:16
> >    dump_stack+0x292/0x395 lib/dump_stack.c:52
> >    print_address_description+0x78/0x280 mm/kasan/report.c:252
> >    kasan_report_error mm/kasan/report.c:351
> >    kasan_report+0x23d/0x350 mm/kasan/report.c:409
> >    __asan_report_load8_noabort+0x19/0x20 mm/kasan/report.c:430
> >    snd_usb_mixer_interrupt+0x604/0x6f0 sound/usb/mixer.c:2490
> >    __usb_hcd_giveback_urb+0x2e0/0x650 drivers/usb/core/hcd.c:1779
> >    ....
> > 
> >   Allocated by task 1484:
> >    save_stack_trace+0x1b/0x20 arch/x86/kernel/stacktrace.c:59
> >    save_stack+0x43/0xd0 mm/kasan/kasan.c:447
> >    set_track mm/kasan/kasan.c:459
> >    kasan_kmalloc+0xad/0xe0 mm/kasan/kasan.c:551
> >    kmem_cache_alloc_trace+0x11e/0x2d0 mm/slub.c:2772
> >    kmalloc ./include/linux/slab.h:493
> >    kzalloc ./include/linux/slab.h:666
> >    snd_usb_create_mixer+0x145/0x1010 sound/usb/mixer.c:2540
> >    create_standard_mixer_quirk+0x58/0x80 sound/usb/quirks.c:516
> >    snd_usb_create_quirk+0x92/0x100 sound/usb/quirks.c:560
> >    create_composite_quirk+0x1c4/0x3e0 sound/usb/quirks.c:59
> >    snd_usb_create_quirk+0x92/0x100 sound/usb/quirks.c:560
> >    usb_audio_probe+0x1040/0x2c10 sound/usb/card.c:618
> >    ....
> > 
> >   Freed by task 1484:
> >    save_stack_trace+0x1b/0x20 arch/x86/kernel/stacktrace.c:59
> >    save_stack+0x43/0xd0 mm/kasan/kasan.c:447
> >    set_track mm/kasan/kasan.c:459
> >    kasan_slab_free+0x72/0xc0 mm/kasan/kasan.c:524
> >    slab_free_hook mm/slub.c:1390
> >    slab_free_freelist_hook mm/slub.c:1412
> >    slab_free mm/slub.c:2988
> >    kfree+0xf6/0x2f0 mm/slub.c:3919
> >    snd_usb_mixer_free+0x11a/0x160 sound/usb/mixer.c:2244
> >    snd_usb_mixer_dev_free+0x36/0x50 sound/usb/mixer.c:2250
> >    __snd_device_free+0x1ff/0x380 sound/core/device.c:91
> >    snd_device_free_all+0x8f/0xe0 sound/core/device.c:244
> >    snd_card_do_free sound/core/init.c:461
> >    release_card_device+0x47/0x170 sound/core/init.c:181
> >    device_release+0x13f/0x210 drivers/base/core.c:814
> >    ....
> > 
> > Actually such a URB is killed properly at disconnection when the
> > device gets probed successfully, and what we need is to apply it for
> > the error-path, too.
> > 
> > In this patch, we apply snd_usb_mixer_disconnect() at releasing.
> > Also introduce a new flag, disconnected, to struct usb_mixer_interface
> > for not performing the disconnection procedure twice.
> > 
> > Reported-by: Andrey Konovalov <andreyknvl@google.com>
> > Tested-by: Andrey Konovalov <andreyknvl@google.com>
> > Signed-off-by: Takashi Iwai <tiwai@suse.de>
> > Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> > 
> > ---
> >  sound/usb/mixer.c |   12 ++++++++++--
> >  sound/usb/mixer.h |    2 ++
> >  2 files changed, 12 insertions(+), 2 deletions(-)
> > 
> > --- a/sound/usb/mixer.c
> > +++ b/sound/usb/mixer.c
> > @@ -2157,6 +2157,9 @@ static int parse_audio_unit(struct mixer
> >  
> >  static void snd_usb_mixer_free(struct usb_mixer_interface *mixer)
> >  {
> > +	/* kill pending URBs */
> > +	snd_usb_mixer_disconnect(mixer);
> > +
> >  	kfree(mixer->id_elems);
> >  	if (mixer->urb) {
> >  		kfree(mixer->urb->transfer_buffer);
> > @@ -2501,8 +2504,13 @@ void snd_usb_mixer_disconnect(struct lis
> >  /* stop any bus activity of a mixer */
> >  static void snd_usb_mixer_inactivate(struct usb_mixer_interface *mixer)
> >  {
> > -	usb_kill_urb(mixer->urb);
> > -	usb_kill_urb(mixer->rc_urb);
> > +	if (mixer->disconnected)
> > +		return;
> > +	if (mixer->urb)
> > +		usb_kill_urb(mixer->urb);
> > +	if (mixer->rc_urb)
> > +		usb_kill_urb(mixer->rc_urb);
> > +	mixer->disconnected = true;
> 
> This looks applied wrongly, as already caught by kbuild bot.
> The snd_usb_mixer_disconnect() argument changed in the later kernel,
> thus the patch couldn't be applied cleanly as is.
> 
> Below is the revised patch (but only compile-tested).

Ah, my fault for missing the build warning, thanks for the update, now
applied and pushed out.

greg k-h

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

* Re: [PATCH 3.18 00/19] 3.18.76-stable review
  2017-10-16 16:11 [PATCH 3.18 00/19] 3.18.76-stable review Greg Kroah-Hartman
                   ` (20 preceding siblings ...)
       [not found] ` <59e53ebe.532f1c0a.7d93d.9f31@mx.google.com>
@ 2017-10-17 14:40 ` Greg Kroah-Hartman
  2017-10-17 18:12   ` Shuah Khan
       [not found]   ` <CALpmF+Fgzn6mzp_ReEfcQ7t=LvSTK5uDP_jftV_Cf1dBf1h0wQ@mail.gmail.com>
  21 siblings, 2 replies; 30+ messages in thread
From: Greg Kroah-Hartman @ 2017-10-17 14:40 UTC (permalink / raw)
  To: linux-kernel
  Cc: torvalds, akpm, linux, shuahkh, patches, ben.hutchings, stable

On Mon, Oct 16, 2017 at 06:11:51PM +0200, Greg Kroah-Hartman wrote:
> This is the start of the stable review cycle for the 3.18.76 release.
> There are 19 patches in this series, all will be posted as a response
> to this one.  If anyone has any issues with these being applied, please
> let me know.
> 
> Responses should be made by Wed Oct 18 16:09:03 UTC 2017.
> Anything received after that time might be too late.
> 
> The whole patch series can be found in one patch at:
> 	kernel.org/pub/linux/kernel/v3.x/stable-review/patch-3.18.76-rc1.gz
> or in the git tree and branch at:
>   git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-3.18.y
> and the diffstat can be found below.

Due to some minor issues found in review, there is now a -rc2 out:
	kernel.org/pub/linux/kernel/v3.x/stable-review/patch-3.18.76-rc2.gz

thanks,

greg k-h

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

* Re: [PATCH 3.18 00/19] 3.18.76-stable review
  2017-10-17 14:40 ` Greg Kroah-Hartman
@ 2017-10-17 18:12   ` Shuah Khan
  2017-10-18  7:09     ` Greg Kroah-Hartman
       [not found]   ` <CALpmF+Fgzn6mzp_ReEfcQ7t=LvSTK5uDP_jftV_Cf1dBf1h0wQ@mail.gmail.com>
  1 sibling, 1 reply; 30+ messages in thread
From: Shuah Khan @ 2017-10-17 18:12 UTC (permalink / raw)
  To: Greg Kroah-Hartman, linux-kernel
  Cc: torvalds, akpm, linux, patches, ben.hutchings, stable, Shuah Khan

On 10/17/2017 08:40 AM, Greg Kroah-Hartman wrote:
> On Mon, Oct 16, 2017 at 06:11:51PM +0200, Greg Kroah-Hartman wrote:
>> This is the start of the stable review cycle for the 3.18.76 release.
>> There are 19 patches in this series, all will be posted as a response
>> to this one.  If anyone has any issues with these being applied, please
>> let me know.
>>
>> Responses should be made by Wed Oct 18 16:09:03 UTC 2017.
>> Anything received after that time might be too late.
>>
>> The whole patch series can be found in one patch at:
>> 	kernel.org/pub/linux/kernel/v3.x/stable-review/patch-3.18.76-rc1.gz
>> or in the git tree and branch at:
>>   git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-3.18.y
>> and the diffstat can be found below.
> 
> Due to some minor issues found in review, there is now a -rc2 out:
> 	kernel.org/pub/linux/kernel/v3.x/stable-review/patch-3.18.76-rc2.gz
> 
> thanks,
> 
> greg k-h
> 

Looks good. Compiled and booted  - no dmesg and kselftest regressions.

thanks,
-- Shuah

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

* Re: [PATCH 3.18 00/19] 3.18.76-stable review
  2017-10-17 18:12   ` Shuah Khan
@ 2017-10-18  7:09     ` Greg Kroah-Hartman
  0 siblings, 0 replies; 30+ messages in thread
From: Greg Kroah-Hartman @ 2017-10-18  7:09 UTC (permalink / raw)
  To: Shuah Khan
  Cc: linux-kernel, torvalds, akpm, linux, patches, ben.hutchings, stable

On Tue, Oct 17, 2017 at 12:12:51PM -0600, Shuah Khan wrote:
> On 10/17/2017 08:40 AM, Greg Kroah-Hartman wrote:
> > On Mon, Oct 16, 2017 at 06:11:51PM +0200, Greg Kroah-Hartman wrote:
> >> This is the start of the stable review cycle for the 3.18.76 release.
> >> There are 19 patches in this series, all will be posted as a response
> >> to this one.  If anyone has any issues with these being applied, please
> >> let me know.
> >>
> >> Responses should be made by Wed Oct 18 16:09:03 UTC 2017.
> >> Anything received after that time might be too late.
> >>
> >> The whole patch series can be found in one patch at:
> >> 	kernel.org/pub/linux/kernel/v3.x/stable-review/patch-3.18.76-rc1.gz
> >> or in the git tree and branch at:
> >>   git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-3.18.y
> >> and the diffstat can be found below.
> > 
> > Due to some minor issues found in review, there is now a -rc2 out:
> > 	kernel.org/pub/linux/kernel/v3.x/stable-review/patch-3.18.76-rc2.gz
> > 
> > thanks,
> > 
> > greg k-h
> > 
> 
> Looks good. Compiled and booted  - no dmesg and kselftest regressions.

Great, thanks for testing.

greg k-h

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

* Re: [PATCH 3.18 00/19] 3.18.76-stable review
       [not found]   ` <CALpmF+Fgzn6mzp_ReEfcQ7t=LvSTK5uDP_jftV_Cf1dBf1h0wQ@mail.gmail.com>
@ 2017-10-18  7:09     ` Greg Kroah-Hartman
  0 siblings, 0 replies; 30+ messages in thread
From: Greg Kroah-Hartman @ 2017-10-18  7:09 UTC (permalink / raw)
  To: Harsh Shandilya
  Cc: linux-kernel, torvalds, akpm, linux, shuahkh, patches,
	ben.hutchings, stable

On Wed, Oct 18, 2017 at 05:22:08AM +0000, Harsh Shandilya wrote:
> rc2 compiled and booted on msm8996pro Snapdragon platform, no dmesg
> regressions. Build time warning from the alsa patch from rc1 is also
> resolved.

Ah, thanks for confirming that, and that this release works properly for
you.

greg k-h

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

* Re: [PATCH 3.18 00/19] 3.18.76-stable review
  2017-10-17 13:22   ` Greg Kroah-Hartman
@ 2017-10-19 12:21     ` Kevin Hilman
  2017-10-19 13:45       ` Guillaume Tucker
  0 siblings, 1 reply; 30+ messages in thread
From: Kevin Hilman @ 2017-10-19 12:21 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: kernelci.org bot, linux-kernel, torvalds, akpm, linux, shuahkh,
	patches, ben.hutchings, stable, Guillaume Tucker

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

> On Mon, Oct 16, 2017 at 04:20:30PM -0700, kernelci.org bot wrote:
>> stable-rc/linux-3.18.y boot: 39 boots: 3 failed, 36 passed (v3.18.75-20-g4ffe55402429)
>> 
>> Full Boot Summary: https://kernelci.org/boot/all/job/stable-rc/branch/linux-3.18.y/kernel/v3.18.75-20-g4ffe55402429/
>> Full Build Summary: https://kernelci.org/build/stable-rc/branch/linux-3.18.y/kernel/v3.18.75-20-g4ffe55402429/
>> 
>> Tree: stable-rc
>> Branch: linux-3.18.y
>> Git Describe: v3.18.75-20-g4ffe55402429
>> Git Commit: 4ffe55402429b1be08b48d02b7be9371148c68b6
>> Git URL: http://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git
>> Tested: 12 unique boards, 6 SoC families, 10 builds out of 182
>> 
>> Boot Failures Detected:
>> 
>> arm:
>> 
>>     omap2plus_defconfig
>>         am335x-boneblack: 1 failed lab
>> 
>>     exynos_defconfig
>>         exynos5800-peach-pi: 1 failed lab
>> 
>>     multi_v7_defconfig
>>         imx6q-sabrelite: 1 failed lab
>
> Thanks for all of the reports.  They all look good except this for 3.18.
> Is this to be expected?

TL;DR; all 3 are lab infrastructure issues, nothing related to the kernel.

Cc'd Guillaume from Collabora to have a look.

@Guillaume: 2 of the 3 boards failed to get a DHCP address from u-boot.
The 3rd one failed to power cycle.

Kevin

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

* Re: [PATCH 3.18 00/19] 3.18.76-stable review
  2017-10-19 12:21     ` Kevin Hilman
@ 2017-10-19 13:45       ` Guillaume Tucker
  0 siblings, 0 replies; 30+ messages in thread
From: Guillaume Tucker @ 2017-10-19 13:45 UTC (permalink / raw)
  To: Kevin Hilman, Greg Kroah-Hartman
  Cc: kernelci.org bot, linux-kernel, torvalds, akpm, linux, shuahkh,
	patches, ben.hutchings, stable

On 19/10/17 13:21, Kevin Hilman wrote:
> Greg Kroah-Hartman <gregkh@linuxfoundation.org> writes:
>
>> On Mon, Oct 16, 2017 at 04:20:30PM -0700, kernelci.org bot wrote:
>>> stable-rc/linux-3.18.y boot: 39 boots: 3 failed, 36 passed (v3.18.75-20-g4ffe55402429)
>>>
>>> Full Boot Summary: https://kernelci.org/boot/all/job/stable-rc/branch/linux-3.18.y/kernel/v3.18.75-20-g4ffe55402429/
>>> Full Build Summary: https://kernelci.org/build/stable-rc/branch/linux-3.18.y/kernel/v3.18.75-20-g4ffe55402429/
>>>
>>> Tree: stable-rc
>>> Branch: linux-3.18.y
>>> Git Describe: v3.18.75-20-g4ffe55402429
>>> Git Commit: 4ffe55402429b1be08b48d02b7be9371148c68b6
>>> Git URL: http://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git
>>> Tested: 12 unique boards, 6 SoC families, 10 builds out of 182
>>>
>>> Boot Failures Detected:
>>>
>>> arm:
>>>
>>>     omap2plus_defconfig
>>>         am335x-boneblack: 1 failed lab
>>>
>>>     exynos_defconfig
>>>         exynos5800-peach-pi: 1 failed lab
>>>
>>>     multi_v7_defconfig
>>>         imx6q-sabrelite: 1 failed lab
>>
>> Thanks for all of the reports.  They all look good except this for 3.18.
>> Is this to be expected?
>
> TL;DR; all 3 are lab infrastructure issues, nothing related to the kernel.
>
> Cc'd Guillaume from Collabora to have a look.
>
> @Guillaume: 2 of the 3 boards failed to get a DHCP address from u-boot.
> The 3rd one failed to power cycle.

These were lab issues indeed, I've resubmitted the 3 failing jobs
and they all passed.  It looks like there was a glitch in the lab
network, we'll investigate and try to prevent this from occurring
again.

Also it would be nice if infrastructure failures could be
detected, clearly if the "power on" command returns an error or
if the bootloader fails to get an IP address we know it's not
because of a kernel problem.  Something to discuss or add to the
backlog I guess.

Guillaume

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

end of thread, other threads:[~2017-10-19 13:46 UTC | newest]

Thread overview: 30+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-10-16 16:11 [PATCH 3.18 00/19] 3.18.76-stable review Greg Kroah-Hartman
2017-10-16 16:11 ` [PATCH 3.18 01/19] ext4: in ext4_seek_{hole,data}, return -ENXIO for negative offsets Greg Kroah-Hartman
2017-10-16 16:11 ` [PATCH 3.18 02/19] CIFS: Reconnect expired SMB sessions Greg Kroah-Hartman
2017-10-16 16:11 ` [PATCH 3.18 03/19] HID: usbhid: fix out-of-bounds bug Greg Kroah-Hartman
2017-10-16 16:11 ` [PATCH 3.18 05/19] KVM: nVMX: fix guest CR4 loading when emulating L2 to L1 exit Greg Kroah-Hartman
2017-10-16 16:11 ` [PATCH 3.18 06/19] usb: renesas_usbhs: Fix DMAC sequence for receiving zero-length packet Greg Kroah-Hartman
2017-10-16 16:11 ` [PATCH 3.18 07/19] iommu/amd: Finish TLB flush in amd_iommu_unmap() Greg Kroah-Hartman
2017-10-16 16:11 ` [PATCH 3.18 08/19] ALSA: usb-audio: Kill stray URB at exiting Greg Kroah-Hartman
2017-10-16 18:50   ` Takashi Iwai
2017-10-17 14:07     ` Greg Kroah-Hartman
2017-10-16 16:12 ` [PATCH 3.18 09/19] ALSA: seq: Fix use-after-free at creating a port Greg Kroah-Hartman
2017-10-16 16:12 ` [PATCH 3.18 10/19] ALSA: seq: Fix copy_from_user() call inside lock Greg Kroah-Hartman
2017-10-16 16:12 ` [PATCH 3.18 11/19] ALSA: caiaq: Fix stray URB at probe error path Greg Kroah-Hartman
2017-10-16 16:12 ` [PATCH 3.18 12/19] usb: gadget: composite: Fix use-after-free in usb_composite_overwrite_options Greg Kroah-Hartman
2017-10-16 16:12 ` [PATCH 3.18 13/19] direct-io: Prevent NULL pointer access in submit_page_section Greg Kroah-Hartman
2017-10-16 16:12 ` [PATCH 3.18 14/19] fix unbalanced page refcounting in bio_map_user_iov Greg Kroah-Hartman
2017-10-16 16:12 ` [PATCH 3.18 15/19] USB: serial: cp210x: add support for ELV TFD500 Greg Kroah-Hartman
2017-10-16 16:12 ` [PATCH 3.18 16/19] USB: serial: option: add support for TP-Link LTE module Greg Kroah-Hartman
2017-10-16 16:12 ` [PATCH 3.18 17/19] USB: serial: qcserial: add Dell DW5818, DW5819 Greg Kroah-Hartman
2017-10-16 16:12 ` [PATCH 3.18 18/19] USB: serial: console: fix use-after-free after failed setup Greg Kroah-Hartman
2017-10-16 16:12 ` [PATCH 3.18 19/19] ALSA: seq: Fix missing NULL check at remove_events ioctl Greg Kroah-Hartman
2017-10-16 23:42 ` [PATCH 3.18 00/19] 3.18.76-stable review Shuah Khan
2017-10-17  0:23 ` Guenter Roeck
     [not found] ` <59e53ebe.532f1c0a.7d93d.9f31@mx.google.com>
2017-10-17 13:22   ` Greg Kroah-Hartman
2017-10-19 12:21     ` Kevin Hilman
2017-10-19 13:45       ` Guillaume Tucker
2017-10-17 14:40 ` Greg Kroah-Hartman
2017-10-17 18:12   ` Shuah Khan
2017-10-18  7:09     ` Greg Kroah-Hartman
     [not found]   ` <CALpmF+Fgzn6mzp_ReEfcQ7t=LvSTK5uDP_jftV_Cf1dBf1h0wQ@mail.gmail.com>
2017-10-18  7:09     ` Greg Kroah-Hartman

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.