From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.7 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7CB05C3A5A7 for ; Wed, 4 Sep 2019 15:17:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 6087422CE3 for ; Wed, 4 Sep 2019 15:17:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730737AbfIDPRw convert rfc822-to-8bit (ORCPT ); Wed, 4 Sep 2019 11:17:52 -0400 Received: from mx1.redhat.com ([209.132.183.28]:33346 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729635AbfIDPRw (ORCPT ); Wed, 4 Sep 2019 11:17:52 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 67C7710F23EC; Wed, 4 Sep 2019 15:17:51 +0000 (UTC) Received: from warthog.procyon.org.uk (ovpn-120-255.rdu2.redhat.com [10.10.120.255]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2EC6560C44; Wed, 4 Sep 2019 15:17:46 +0000 (UTC) Organization: Red Hat UK Ltd. Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SI4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 3798903 From: David Howells In-Reply-To: References: To: Alan Stern Cc: dhowells@redhat.com, Guenter Roeck , viro@zeniv.linux.org.uk, Casey Schaufler , Stephen Smalley , Greg Kroah-Hartman , nicolas.dichtel@6wind.com, raven@themaw.net, Christian Brauner , keyrings@vger.kernel.org, linux-usb@vger.kernel.org, linux-security-module@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-api@vger.kernel.org, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 08/11] usb: Add USB subsystem notifications [ver #7] MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <1500.1567610266.1@warthog.procyon.org.uk> Content-Transfer-Encoding: 8BIT Date: Wed, 04 Sep 2019 16:17:46 +0100 Message-ID: <1501.1567610266@warthog.procyon.org.uk> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.6.2 (mx1.redhat.com [10.5.110.66]); Wed, 04 Sep 2019 15:17:52 +0000 (UTC) Sender: owner-linux-security-module@vger.kernel.org Precedence: bulk List-ID: Alan Stern wrote: > > > Unfortunately, I don't know how to fix it and don't have much time to > > > investigate it right now - and it's something that can be added back later. > > > > The cause of your problem is quite simple: > > > > static int usbdev_notify(struct notifier_block *self, > > unsigned long action, void *dev) > > { > > switch (action) { > > case USB_DEVICE_ADD: > > + post_usb_device_notification(dev, NOTIFY_USB_DEVICE_ADD, 0); > > break; > > case USB_DEVICE_REMOVE: > > + post_usb_device_notification(dev, NOTIFY_USB_DEVICE_REMOVE, 0); > > + usbdev_remove(dev); > > + break; > > + case USB_BUS_ADD: > > + post_usb_bus_notification(dev, NOTIFY_USB_BUS_ADD, 0); > > + break; > > + case USB_BUS_REMOVE: > > + post_usb_bus_notification(dev, NOTIFY_USB_BUS_REMOVE, 0); > > usbdev_remove(dev); > > break; > > } > > > > The original code had usbdev_remove(dev) under the USB_DEVICE_REMOVE > > case. The patch mistakenly moves it, putting it under the > ------------------------------^^^^^ > > Sorry, I should have said "duplicates" it. Ah, thanks. I'd already removed the USB bus notifications, so I'll leave them out for now. David