Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp4641250ybl; Wed, 22 Jan 2020 01:52:00 -0800 (PST) X-Google-Smtp-Source: APXvYqyWKUM5dcFy1B39ghb8jBmJtejrzdZ+Pkmd8yiSDyd+rJh0f2I03JRY1HiC4zd6wXGKliiq X-Received: by 2002:aca:c646:: with SMTP id w67mr6040850oif.171.1579686720160; Wed, 22 Jan 2020 01:52:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579686720; cv=none; d=google.com; s=arc-20160816; b=EZiO4hNpB2j8E2p2tGxqO6sbAkVsCtPqcS/ov5Wihmyes7s7a512+SAxdb3NVAxwbK /3PeYSRAPpSZelKhpVQYEuDx0N2+owCT9PQMZ5mxAOUIOFc3nW7mn1Hk2Q7Mf9S+/cKT EBEjum9Zt4+4eaW8zMfl8EsfJC0SzFwtqdtS9Po2dwZJ+eP4Mw/r6fnCIPviXKVwo7nN gK+OCLsBGvnrSTsS5PQT3I2altk0Gaiak0afxCPijiMU3JYlhPYlqYhxgf5Su8VBGIpH zURStvifVvHYjaAIPqQqpHxBRKV28cOibxQVQ0xk7wOqIODqdfvORQxAn4njX66zFTTf LL3Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=G10ZWLT3xTcuttQRHtTSGz9vzpGwbdbxKAtHC/H0DLE=; b=CCwkOtkAoy0Ot7XUMnTZ3v8jrFytZAlZ0K91YGMktVyypRfzPQaBGRwEc8Gu8YsfnQ Sjgr8mowJ1yeyF06hJzKt291u7EwvPZQAyZctssFRN+fEyTJkRRWyP8ltbkCXwHJHzEn AzcsqC//iREtjLWh2Z9UTIjuEiBfUJxoHBmIarrT7p2ZSY3ZvoWd33Wf5PU5eW/xSLg9 +eTRCdDHDeHYHUqe0FVYJ6xTbGgEQvvTPL7jFy37Pv2k3hEGYwmwvbDSMblG28zo0hhi oTgXo2Z0NLg3oDDm2ee/WjnxBcpZH/auh8EQoHcrQZaoFNmjaX/IwD/WudZ1mX3fI8nY mVXw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=gzW3kcMd; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k2si4748603otp.155.2020.01.22.01.51.47; Wed, 22 Jan 2020 01:52:00 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=gzW3kcMd; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730373AbgAVJhq (ORCPT + 99 others); Wed, 22 Jan 2020 04:37:46 -0500 Received: from mail.kernel.org ([198.145.29.99]:53910 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732610AbgAVJhn (ORCPT ); Wed, 22 Jan 2020 04:37:43 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 5E3F22467E; Wed, 22 Jan 2020 09:37:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1579685862; bh=bnpbIvLTPk/7zt5bHlqHrnuZHwU6GnzDXPVWoM27I0s=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=gzW3kcMdtzZRji1GkzbuEmwz1ZEYqVY5mNWVJHZO8FEP9Tmrfao1XMyxbM6GCshvL SvBzlB4KVSQR3dD5XwRklMuZ84eWoEVtqqzcKb1AkuG8MbgoEGGW0jNYpQT6/bTd9t AdRm0ivqwe+wlZtF1507whliR/BhqpuvLKZGNsqQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Johan Hovold Subject: [PATCH 4.14 13/65] USB: serial: suppress driver bind attributes Date: Wed, 22 Jan 2020 10:28:58 +0100 Message-Id: <20200122092753.045753046@linuxfoundation.org> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200122092750.976732974@linuxfoundation.org> References: <20200122092750.976732974@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Johan Hovold commit fdb838efa31e1ed9a13ae6ad0b64e30fdbd00570 upstream. USB-serial drivers must not be unbound from their ports before the corresponding USB driver is unbound from the parent interface so suppress the bind and unbind attributes. Unbinding a serial driver while it's port is open is a sure way to trigger a crash as any driver state is released on unbind while port hangup is handled on the parent USB interface level. Drivers for multiport devices where ports share a resource such as an interrupt endpoint also generally cannot handle individual ports going away. Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Cc: stable Reviewed-by: Greg Kroah-Hartman Signed-off-by: Johan Hovold Signed-off-by: Greg Kroah-Hartman --- drivers/usb/serial/usb-serial.c | 3 +++ 1 file changed, 3 insertions(+) --- a/drivers/usb/serial/usb-serial.c +++ b/drivers/usb/serial/usb-serial.c @@ -1332,6 +1332,9 @@ static int usb_serial_register(struct us return -EINVAL; } + /* Prevent individual ports from being unbound. */ + driver->driver.suppress_bind_attrs = true; + usb_serial_operations_init(driver); /* Add this device to our list of devices */