Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp4817861ybl; Wed, 22 Jan 2020 05:20:17 -0800 (PST) X-Google-Smtp-Source: APXvYqzZPUt0ICl7Z+Cc5Ef+79EXCr+bXXj4LeBXxCTyyMvqZEPbYj2eH9SBuLGd+xCo/Vae/pAX X-Received: by 2002:aca:c415:: with SMTP id u21mr6760508oif.49.1579699216546; Wed, 22 Jan 2020 05:20:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579699216; cv=none; d=google.com; s=arc-20160816; b=Tor2M6s19a+0iSCuSaLXf1+8Ym/r/QEQMYUIYwa9OFKFAaUOchuDOwBTsqKjADBe21 IzM3JJUA+SOu+CiCTe4ROMzcgOQFOx71/H6xWwZutjwcbRVWeJLKB6rVHtqxNUbLpxAG lO5a/9LItisTds2T8XBUQOWVE0i9ELgA4KmDHnURU8vgeo/cYDcFfkTwdfsCcICssxm5 T1dR/HWA1wrPxqcED5Q8QY5Q40iUBF1yx5r/+lkdgF7jeI08FEKokvFVHxGHOsf5sj3+ 826C7bVL8BsDB1FTASZdezt0+Ch8tPyYRW4F0daqjegm9i98w8LvkFQIpC3yFVYpc+O6 LfXA== 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=Jw1osrVvxp6p6QTJm7xxArys0X/VvgTvRWHSWT76Rnw=; b=vDn1IsR46+8j5i0I8Q1h7Wl+G4iN7T0aM0cjTJUJ7erolWHf2msGX+FoZaXaB9qNLp s1f6ArDzw+12sGwxYaxB+lKIflCcucZItkbIMjww8rODhzqxRU1MjuD0gpsd0PdZZv9p yguTeLFFy5CoUtQrd7/vu2tRNhphRdW9yX/XFF22VWfDgfzvlN72i+7JM7rCdsYr7x/G Vkpc2N5rFoX7W3Y/uf0OnhBecM5BlVkpa/QTsXzBdJttYwPdo/sSdz/eCOrFh3mQdFWW NDM5XNxOCC8WtGmr1ALPIvkde8R9+OFZGxu0t5xjW1qPq+FuI6HJfcxGDbEY932to5TK IZ2Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=LXLqvioA; 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 f21si23477931otp.56.2020.01.22.05.20.04; Wed, 22 Jan 2020 05:20:16 -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=LXLqvioA; 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 S1729413AbgAVNSn (ORCPT + 99 others); Wed, 22 Jan 2020 08:18:43 -0500 Received: from mail.kernel.org ([198.145.29.99]:34440 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726118AbgAVNSk (ORCPT ); Wed, 22 Jan 2020 08:18:40 -0500 Received: from localhost (unknown [84.241.205.26]) (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 800AE205F4; Wed, 22 Jan 2020 13:18:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1579699120; bh=Ls98ESpj0DwyIvLS4M43smNf7hixH9DKqSv2IWNWpdM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=LXLqvioAnWGNvNHpiu3mst/vjLgJ272R12VyrjWkzEo/E1Wgh7urKb92ygLY002qk SifN/7wQKYOG5TC3BCffUipyk3PBSHuw37bS76HlWkZ2djE3JrQImypKbXNXGy0LVM rUX7b6SLDW4y+lwqB7edUJgWdDtMWmBxSik0MbI0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Johan Hovold Subject: [PATCH 5.4 047/222] USB: serial: suppress driver bind attributes Date: Wed, 22 Jan 2020 10:27:13 +0100 Message-Id: <20200122092836.952451015@linuxfoundation.org> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200122092833.339495161@linuxfoundation.org> References: <20200122092833.339495161@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 @@ -1317,6 +1317,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 */