Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp4624183pxb; Wed, 20 Apr 2022 07:07:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwUGI0nyP4nkTb9TJdrbkZEuOVrVtiknaGmUwQ+stdpfGx/lYPwcE4o20MdyvhuYAeBcOIi X-Received: by 2002:a17:903:284:b0:158:8e21:2108 with SMTP id j4-20020a170903028400b001588e212108mr20089346plr.37.1650463657114; Wed, 20 Apr 2022 07:07:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650463657; cv=none; d=google.com; s=arc-20160816; b=vr0JtJ5cNsYJzFGMnTVUdAFvF8rJ4w7UWjyYITw52cJJSwkBK3Z4w0uSMTL5khrpj9 2qalqUyXFA1XzhLqDXVqc38wFCpUDpM7a1mFk+Q8IEhKMzVssFJ5cEJMlKn24EJfNIwx gJw+M8ccDjWAPIJEHgBWigTlFqNQB+71WU3C/4OOkIJoh21MScjmG1HRppiD4rF73aMG Xb+cPtpO5+ilelhKzCgSnZ85xThzr4mczA9OUxbqmPM4vHhF4BVSaNGyEbQ/9q6wmLGy ffJGIOZ4WOCu2WdRQ4AObwaZ6WMZj3tf60qz2yGu5WpsewHIUFdhQzIqASachDNasck4 BCKA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:message-id:in-reply-to:date:references:organization :subject:cc:to:from:dkim-signature; bh=GL1yC0TQSRHkqmV/DSr+k6th0pBM0w7r0/8fvjcp1gQ=; b=l7wKKTh7fTSMn/qDJg6D2QUwvhb8nGpbPBx4x4LP/DpenhXB5NsAMqctsDXX9pDt0n JUo56k8jrjpP0xbeOL63DBPRMsWP1Q444Zukir/QgcDxcD3E3k7lGUINVLeRcrB764jP Pv2oYBT5t3ZQrfo8Z+z4XMnuCbvA6TB00uOjekOcGgbEAHME/OymJlBdxi93DUHZ+9hk YUwz6GVJn0YjiBN7w+30rW8/bD9xTNaorMoYhkMZVrJNBOXjOay1gjNY/91Qlke33h5L UN5GkxqBC2q3aY5KxnI4R/W5qCBgDVglPonl/lfRjvKKt4dgpL1O9fTItcAzGkSD2+rs GuBw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mork.no header.s=b header.b=N9XJCaG7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=mork.no Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id m38-20020a634c66000000b00398df5b29a7si2441684pgl.878.2022.04.20.07.07.20; Wed, 20 Apr 2022 07:07:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@mork.no header.s=b header.b=N9XJCaG7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=mork.no Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1356989AbiDSU3Y (ORCPT + 99 others); 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 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_PASS,SPF_NONE, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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