Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp4642390ybl; Wed, 22 Jan 2020 01:53:49 -0800 (PST) X-Google-Smtp-Source: APXvYqw0fBQVxricXRP+hlWIkouYM6Yl965A35i7gK6vC3sWR1yKwnU0oHu8vKxd3DJdpObZfJyD X-Received: by 2002:aca:4d58:: with SMTP id a85mr5969788oib.35.1579686829485; Wed, 22 Jan 2020 01:53:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579686829; cv=none; d=google.com; s=arc-20160816; b=jQltrTXL+w4oZeFKLhDwqSgswwwdQEl5n7LWpMXZUtRyB/lK50b7mtMCfGSEz5PkGu R0LIt/NB/kERLHG0bzsTIwYicH+ET7s+2cRbZAqGBDEAnJ6Kr/IlKJd2zMvtDuXi5xmJ 26NMNCyWicy8qMGLGiZGNTtLEJktDBG+/wzSw1vcdL8kGoC+UQqN0mbnrq0zG2+lNhKt wxIUDd4XMczO4Eu55+nPC7hwIuE9TppYw4qnZ5BKBVS7ZyIMhdXjaNBWxvsVgGrI468J iO4D62azP5/2NzC2emyvEEKMsDoHvKwVJKAQBTAsEfjgfS7aWpAe91SGvUPCTlRAKPcT m/7w== 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=LagvGzszgIsqzwEsyD8CCshGepiiOssw81yuGFS2BQg=; b=p1iNG6P/JLWR+4b0xDBAyYJUqLuxETpjcC7S0pY9GrxQprR+5AUwWs1wvvJS5VOXZO u0ei/eR0G18YDu3E3bkWAilBdnarEl10cvfpO0mwurr5UDYb8/+jXP9TIwuy2ns8hQF1 7o+DZkBIl+HySrjqTt8nUI7nQNY5VTAVLUm2WTDuY2bEOkuH36FlAv79vMn0NVU33E+4 +fxDP2/9XOk8TWt6lgSrDfLTNIvPfyYzmcx2g35WY28eN1QNnvHp9uv2M6JIO9EXUkUf MJkJGM3tebKcKWl8eJQoRMHMnNCwVCDJyV3K2s9aY5Ou0FfLf4Y1et6lO2C8jV5dwVDF //yA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=2JTWW9wE; 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 g16si23849639otj.79.2020.01.22.01.53.37; Wed, 22 Jan 2020 01:53:49 -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=2JTWW9wE; 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 S1732972AbgAVJvn (ORCPT + 99 others); Wed, 22 Jan 2020 04:51:43 -0500 Received: from mail.kernel.org ([198.145.29.99]:52970 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732387AbgAVJhG (ORCPT ); Wed, 22 Jan 2020 04:37:06 -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 A46052467E; Wed, 22 Jan 2020 09:37:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1579685826; bh=VduW93Y0Qt9OjW9JLQTSDDgaDytptO9GJJ+sjcxCw08=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=2JTWW9wEv2YediYJURlmiN+Of+57kcB0nIi/uvy8zZvfIJA55I7GABMh9vM5EiO+p uWuCGnCBRM+UERqt+4pNzelUixONhP9iBHrTMhm3uTNxkk7+Y6BwFWLsrBjLaiQxIX COVugq82lNx/dXD7GlV3eL+BxV3P1YVBc6IiJHVc= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Johan Hovold Subject: [PATCH 4.9 59/97] USB: serial: suppress driver bind attributes Date: Wed, 22 Jan 2020 10:29:03 +0100 Message-Id: <20200122092805.915683644@linuxfoundation.org> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200122092755.678349497@linuxfoundation.org> References: <20200122092755.678349497@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 @@ -1351,6 +1351,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 */