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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 46F25C433FE for ; Tue, 19 Apr 2022 20:26:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1357018AbiDSU3Y (ORCPT ); Tue, 19 Apr 2022 16:29:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49764 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236926AbiDSU3V (ORCPT ); Tue, 19 Apr 2022 16:29:21 -0400 Received: from louie.mork.no (louie.mork.no [IPv6:2001:41c8:51:8a:feff:ff:fe00:e5]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ACA65366A7; Tue, 19 Apr 2022 13:26:37 -0700 (PDT) Received: from canardo.dyn.mork.no ([IPv6:2a01:799:c9f:8600:0:0:0:1]) (authenticated bits=0) by louie.mork.no (8.15.2/8.15.2) with ESMTPSA id 23JKPvrg1019330 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=OK); Tue, 19 Apr 2022 21:25:59 +0100 Received: from miraculix.mork.no ([IPv6:2a01:799:c9f:8602:8cd5:a7b0:d07:d516]) (authenticated bits=0) by canardo.dyn.mork.no (8.15.2/8.15.2) with ESMTPSA id 23JKPsx11417014 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=OK); Tue, 19 Apr 2022 22:25:54 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mork.no; s=b; t=1650399957; bh=GL1yC0TQSRHkqmV/DSr+k6th0pBM0w7r0/8fvjcp1gQ=; h=From:To:Cc:Subject:References:Date:Message-ID:From; b=N9XJCaG7CkPGlMm9+pIlPrXlHhqrZ26J43Ph+m4WbC7YPXplpV4mz+PSFefJbgrP3 wA5/ElIgfAPeVymYuL0n696i2vaJWOy0YQamWajOMi6L/UOPOCg6fAcx5x9U5Blb75 6fum5px+jibp89M1pvOY0iFtyjirVjbBnTpJIsJE= Received: (nullmailer pid 913495 invoked by uid 1000); Tue, 19 Apr 2022 20:25:54 -0000 From: =?utf-8?Q?Bj=C3=B8rn_Mork?= To: Oliver Neukum Cc: Andy Shevchenko , Johan Hovold , Oleksij Rempel , Dongliang Mu , Oliver Neukum , "David S. Miller" , Jakub Kicinski , Paolo Abeni , Dongliang Mu , syzbot+eabbf2aaa999cc507108@syzkaller.appspotmail.com, USB , netdev , Linux Kernel Mailing List Subject: Re: [PATCH] driver: usb: nullify dangling pointer in cdc_ncm_free Organization: m References: <20220409120901.267526-1-dzm91@hust.edu.cn> Date: Tue, 19 Apr 2022 22:25:54 +0200 In-Reply-To: (Oliver Neukum's message of "Tue, 19 Apr 2022 13:47:40 +0200") Message-ID: <871qxsrfal.fsf@miraculix.mork.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Virus-Scanned: clamav-milter 0.103.5 at canardo X-Virus-Status: Clean Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Oliver Neukum writes: > It seems to me that fundamentally the order of actions to handle > a hotunplug must mirror the order in a hotplug. We can add more hooks > if that turns out to be necessary for some drivers, but the basic > reverse mirrored order must be supported and I very much favor > restoring it as default. FWIW, I agree 100% with this. Please go ahead with the revert of commit 2c9d6c2b871d ("usbnet: run unbind() before unregister_netdev()"). AFAICS, your proposed new hook should solve the original problem just fine. Bj=C3=B8rn