Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757242AbbESPmU (ORCPT ); Tue, 19 May 2015 11:42:20 -0400 Received: from rrw.me.uk ([93.93.129.10]:49412 "EHLO rrw.me.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757217AbbESPmO (ORCPT ); Tue, 19 May 2015 11:42:14 -0400 Message-ID: <555B5100.8010708@kynesim.co.uk> Date: Tue, 19 May 2015 16:04:32 +0100 From: Richard Watts User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 MIME-Version: 1.0 To: linux-kernel@vger.kernel.org, gregkh@linuxfoundation.org Subject: [PATCH 0/1] Avoid usb reset crashes by making tty_io cdevs truly dynamic Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1339 Lines: 32 Sometimes, usb buses on which CDC ACM devices sit encounter a usb reset. When this happens, particularly when CONFIG_DEBUG_KOBJECT_RELEASE is on, we attempt to destroy the cdev for the associated tty and then rapidly re-initialise it. Since kobject destruction is not immediate, this potentially leaves us with cdev_init() calling kobject_init() on a kobject that is about to be destroyed. This turns out not to be such a good thing and this patch solves the problem by making the cdevs tty_operations->cdevs dynamically allocated. This may not be a problem in the wild (though I have some circumstantial evidence that it is), but I submit that we might want to think about fixing it anyway, since it makes debugging on systems with CONFIG_DEBUG_KOBJECT_RELEASE=y and USB resets rather difficult (guess what I have been doing lately .. ). Patch is against e26081808edadfd257c6c9d81014e3b25e9a6118 (head of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty.git ). (in fact, you will still get an oops - which is the subject of another, more controversial, patchset ..) Richard. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/