Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp2335204ybz; Thu, 23 Apr 2020 16:14:40 -0700 (PDT) X-Google-Smtp-Source: APiQypIlZcaPGXeE0hbALNEeGH93J86duYpJDpH+pHYlLTwObx/zzNe8HvDYV2iRQsx7HWdufMKl X-Received: by 2002:aa7:cb43:: with SMTP id w3mr4726785edt.95.1587683679870; Thu, 23 Apr 2020 16:14:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587683679; cv=none; d=google.com; s=arc-20160816; b=sFJ1RuMkh1g0R7VAE7j8/uxBTGfJQ1JcdUNzL8dI/hUr28liB9Rn+AQTXmDabfxiBC NdWnTlkohVuz3JbvLKN8Ch4P4TQ66h7zvhjaJBWBnAEF/0r3OpG6Egv9p6BYe1oZ8VQ3 5mqSwuHjzaytU0CEhnguaDqbT8y5h4dZ3++inrEed8rRxRieN939gBS+kENdatstuodc sj3rnEXZGUvUHUMXbnSPebd8jpqC3ivBwLax7urMV9UsuxW+dCG3oYEd/xUspmKaPvy1 tmZ5k4qvomUYiWVVE6Tp2rOX2lZ7CBSyS8LK6heRLJWWxib3mVLQgGXbwGMYgu3OQ36/ ceKg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:subject:message-id:date:cc:to :from:mime-version:content-transfer-encoding:content-disposition; bh=31+y1Wb61ZMyMqz1Rjg9yCGcnrLns2IienXoxO/4glw=; b=wVMZxRluknWyxLpDcUZ32DLX249xTxT9mr1m9Rq330lsv9DcqC2xLC9nRD/azbzAt+ pk0GR7DxXpyeO+NpAGiUyZNN7Cy/j9ALkrKUVUw/cqBhEq0ObOrk8iRt9icR/X8sY3Rh 5WdyTYrCKZDT8WQyA8L51pEkvfoSkpzZUQE/eR9TDISaG/JIq+E0QnWLrIr8rMjXdwbD 5gqdwHpInqy2oRj1WfmVsN960ZVx9PtK1P5bzWuuQbB4tJ64iu+3v1e7zUR2ej3eELYw NCoeRV5JS/a4AIyNAQlvcZuoYJssMTtkI5RMroAm4xTM6B9OP6befKWlKg8hB01e9hZ3 bj1A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id fi25si2132678ejb.25.2020.04.23.16.14.16; Thu, 23 Apr 2020 16:14:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729256AbgDWXLh (ORCPT + 99 others); Thu, 23 Apr 2020 19:11:37 -0400 Received: from shadbolt.e.decadent.org.uk ([88.96.1.126]:50204 "EHLO shadbolt.e.decadent.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728545AbgDWXGw (ORCPT ); Thu, 23 Apr 2020 19:06:52 -0400 Received: from [192.168.4.242] (helo=deadeye) by shadbolt.decadent.org.uk with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1jRkva-0004mS-J5; Fri, 24 Apr 2020 00:06:42 +0100 Received: from ben by deadeye with local (Exim 4.93) (envelope-from ) id 1jRkvX-00E6xI-61; Fri, 24 Apr 2020 00:06:39 +0100 Content-Type: text/plain; charset="UTF-8" Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 From: Ben Hutchings To: linux-kernel@vger.kernel.org, stable@vger.kernel.org CC: akpm@linux-foundation.org, Denis Kirjanov , "Greg Kroah-Hartman" , "Johan Hovold" Date: Fri, 24 Apr 2020 00:06:59 +0100 Message-ID: X-Mailer: LinuxStableQueue (scripts by bwh) X-Patchwork-Hint: ignore Subject: [PATCH 3.16 192/245] USB: serial: suppress driver bind attributes In-Reply-To: X-SA-Exim-Connect-IP: 192.168.4.242 X-SA-Exim-Mail-From: ben@decadent.org.uk X-SA-Exim-Scanned: No (on shadbolt.decadent.org.uk); SAEximRunCond expanded to false Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 3.16.83-rc1 review patch. If anyone has any objections, please let me know. ------------------ 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") Reviewed-by: Greg Kroah-Hartman Signed-off-by: Johan Hovold Signed-off-by: Ben Hutchings --- 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 @@ -1337,6 +1337,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 */