Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp5342735rwb; Sun, 11 Dec 2022 04:35:49 -0800 (PST) X-Google-Smtp-Source: AA0mqf4YE2k3ZlLnfJXByvD/5RMn/nvs3yKY3wnCE6pldPBfycCtBUhmFqW+EUSJ7KZ1Rhpxdumt X-Received: by 2002:a17:906:7d8b:b0:7ae:ff04:c5f1 with SMTP id v11-20020a1709067d8b00b007aeff04c5f1mr10538708ejo.51.1670762149288; Sun, 11 Dec 2022 04:35:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670762149; cv=none; d=google.com; s=arc-20160816; b=zPp6nDRAz7FQC+4GK9VzGWqrQNm//oXfLnT3geb8+p2moiDzQCcxaN63V9nHwDuzKf 4elZP4W3pa7ssVirshb2+5/QtWiHUpf7XNlTFkw3i4jl03so0dawON1T+3t8Ky2f2qnL SFHN1jLJ+ZLmt7kSdKh6CdvNVCll+6ddJT3o1x7msWhvEs63w3c3MphT5eOuWwChk2sC ro5zwUaIptPj10+GUfVZoO7tg4HWWgi8BkW7Qc2eM9husaYvthUp21osqyoGjrf86Z+v nScHvtAHVbDZhmDuVUyOxoT4/IP5BTW9KHBRsVGue7lthoz2cvwsxDluRxWyZGdEyWPx vQwQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version; bh=Z/17ByY+2p8xT6JQAju4Hci6IFGZgS7AqqVRcijhKFI=; b=gviQb+og042et/CafIfhdvKmcjCX+gjZyuTnUBi+r+TJEPMUCkTpAH2dv7+T6F5sgR yLhUG+1WDOCPTNvHjUkyLAg6k+6GSBC/d4fu0wnA8gjovO5ZAH/SrZ0p4CXqZ4uWLoFZ c4Xlt2LYO814B1Mw9VRB5JRV8omtR7mCU4vfR37HQGp6Q6HEWCLsnbXiG8Hwnh36fatz aSSpqgn1cSQIm70P70N5Kk+YKqhgfVWoy/rE2Nw8wLNm+Gvmn07XVQupw81aYcJABkvf e9ohfwQbKcYjAeAT888wr9lykYAGMO/IDGYw56HpY5QKWQgiOeoZD08XnWL4Eld1jval zCAw== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ho37-20020a1709070ea500b007be4d8bf6d5si4381267ejc.714.2022.12.11.04.35.30; Sun, 11 Dec 2022 04:35:49 -0800 (PST) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229969AbiLKLYr convert rfc822-to-8bit (ORCPT + 75 others); Sun, 11 Dec 2022 06:24:47 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56852 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229960AbiLKLYp (ORCPT ); Sun, 11 Dec 2022 06:24:45 -0500 Received: from mail-pj1-f54.google.com (mail-pj1-f54.google.com [209.85.216.54]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9AAD711440; Sun, 11 Dec 2022 03:24:41 -0800 (PST) Received: by mail-pj1-f54.google.com with SMTP id v13-20020a17090a6b0d00b00219c3be9830so9370360pjj.4; Sun, 11 Dec 2022 03:24:41 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=9Xx+VWxVfF6d2N/d4R2hoVV6iriRHfZEzJeKkWHHuls=; b=j8LO1ajlYhPsMrZDgDq6NS51jOxg3v6HmV0XVXRAhYaUhoSC3CfzsjJxV+LIq7mjvs pIMTgObYyIIw8Bcd38cJ6HvEAE3Bz8A1Coc1ASqAxyb3kzU/20gpe4v4Y3cl1tvS9+/8 XPstrZokH84bL80zf+ShgyLJR70K0l65L1nVpAzb1FTrnBVoO6xs7ckZII24L17du90q nNF5ysOfpunm2LNNcWW5T8lOl6aercakaEcfrgYWqxbc/3yG/Aj1aV18rfsSKglvR6bq NnE4Ns3cyYxiZfHFC7LPKZXI7wefz5euwebEXC+YNKmTMbr+y2dFaQ9pA7KQN5PJdnZd dbtA== X-Gm-Message-State: ANoB5pmcV+P3Zfxesi/QakW3W8GqYkmhd5/ktgoSSyDgA85tWDrdfa4T LcP1YCPqv9BC9eVDwoouy+HoBQojOi708lew4Cc= X-Received: by 2002:a17:90b:3c4d:b0:221:4b1c:3b29 with SMTP id pm13-20020a17090b3c4d00b002214b1c3b29mr126610pjb.92.1670757880938; Sun, 11 Dec 2022 03:24:40 -0800 (PST) MIME-Version: 1.0 References: <20221203133159.94414-1-mailhol.vincent@wanadoo.fr> <20221210090157.793547-1-mailhol.vincent@wanadoo.fr> <20221210090157.793547-2-mailhol.vincent@wanadoo.fr> In-Reply-To: From: Vincent MAILHOL Date: Sun, 11 Dec 2022 20:24:29 +0900 Message-ID: Subject: Re: [PATCH v2 1/9] can: ems_usb: ems_usb_disconnect(): fix NULL pointer dereference To: Johan Hovold Cc: Marc Kleine-Budde , linux-can@vger.kernel.org, Oliver Neukum , Wolfgang Grandegger , "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Frank Jungclaus , socketcan@esd.eu, Yasushi SHOJI , =?UTF-8?Q?Stefan_M=C3=A4tje?= , Hangyu Hua , Oliver Hartkopp , Peter Fink , Jeroen Hofstee , =?UTF-8?Q?Christoph_M=C3=B6hring?= , John Whittington , Vasanth Sadhasivan , Jimmy Assarsson , Anssi Hannula , Pavel Skripkin , Stephane Grosjean , Wolfram Sang , "Gustavo A . R . Silva" , Julia Lawall , Dongliang Mu , Sebastian Haas , Maximilian Schneider , Daniel Berglund , Olivier Sobrie , =?UTF-8?B?UmVtaWdpdXN6IEtvxYLFgsSFdGFq?= , Jakob Unterwurzacher , Martin Elshuber , Bernd Krumboeck , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Alan Stern , linux-usb@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8BIT X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE, SPF_PASS autolearn=no 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 On Tue. 10 déc. 2022 à 20:02, Johan Hovold wrote: > On Sat, Dec 10, 2022 at 06:01:49PM +0900, Vincent Mailhol wrote: > > ems_usb sets the driver's priv data to NULL before waiting for the > > completion of outsdanding urbs. This can results in NULL pointer > > dereference, c.f. [1] and [2]. > > Please stop making hand-wavy claims like this. There is no risk for a > NULL-pointer deference here, and if you think otherwise you need to > explain how that can happen in detail for each driver. Understood. *My* mistake comes from this message from Alan [1]: | But if a driver does make the call, it should be careful to | ensure that the call happens _after_ the driver is finished | using the interface-data pointer. For example, after all | outstanding URBs have completed, if the completion handlers | will need to call usb_get_intfdata(). I did not pay enough attention to the "if the completion handlers will need to call usb_get_intfdata()" part and jumped into the incorrect conclusion that any use of usb_set_intfdata(intf, NULL) before URB completion was erroneous. My deep apologies for all the noise. Please forget this series and one more time, thank you for your patience. [1] https://lore.kernel.org/linux-usb/Y4OD70GD4KnoRk0k@rowland.harvard.edu/