Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp773992pxb; Tue, 12 Apr 2022 13:06:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzH9Paas8BAyHrpy7gROcYMLUuujURmVTgymIg9FK3h33FNA87ARJeRgQHHdB2uC5jZAw8R X-Received: by 2002:a65:41cc:0:b0:380:6f53:a550 with SMTP id b12-20020a6541cc000000b003806f53a550mr31504970pgq.471.1649793974898; Tue, 12 Apr 2022 13:06:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649793974; cv=none; d=google.com; s=arc-20160816; b=eStdDO6Mdp9piVeQCPS+6m/ZytCSKoqjUMdIXsaiMYWH1mpVXX/LOabxr5gjLz5etf a9+2tp0VJBeVYxICQKyjLWBhjihpdq4G/+UMDvAku4xS1Ap9KYpX7JcRvcoeJUBuJi+U OV4/bki0+ee9bKPupDO8IkLulQ9FY4sCrhSczpplFxzjwz1ss69dkEy1fcuh2FAKBDIR imyd7DUAVnA8kgstWquKxuQV3jiOfY4kF03qD+E1HuBkKdJBaSlqM8/ENrcyk+suRv3Q d+94XrjXfH4eSbdbItr29mxmKjru8M9LRwSxOoSC+zlmtw6DTIpgcB4vjMYThcqXOVwy xjBQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=rY6b4Cha+4+tNB8Pe5EB9gbUIN/2B2C73pXkmyewtts=; b=HRW7xPqM+PUIzagTYHGxYmKCb7MIrWt5fsGgJuGVPmqOGRs/GG1C8mMquZj64tz/DP RZB3McPeP2H3+70zSrx68j/kgzlMs3aRax2sr7cX9cuOIfWxsM+sL6tTFeWzj59gNsJT mzDX5k5Obknr2U1qVBfoUIV+MDKQl6fYvatZrlwi6ZYg0LP61M0gyXoaOPKYomF6ArjN HU7d0ffub4d3E1smXzeEG+eKtFqGQyu5h1OBYP8I8rcTTbKwQiiI4PIiEMPZ0tY+A8mb pPPtXuC5t96nqkdIHdbHnjWR7psy4ui1c+rbur/F1DOOKoF0T4anumdRjXBFrqeU0WzG iojA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=google header.b=h52PHqsV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id q8-20020a17090311c800b00153b2d16571si13278978plh.377.2022.04.12.13.06.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Apr 2022 13:06:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=google header.b=h52PHqsV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 28164240B0; Tue, 12 Apr 2022 12:54:38 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1356728AbiDLOq5 (ORCPT + 99 others); Tue, 12 Apr 2022 10:46:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35638 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239759AbiDLOqz (ORCPT ); Tue, 12 Apr 2022 10:46:55 -0400 Received: from mail-oa1-x34.google.com (mail-oa1-x34.google.com [IPv6:2001:4860:4864:20::34]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C9F6BA183 for ; Tue, 12 Apr 2022 07:44:36 -0700 (PDT) Received: by mail-oa1-x34.google.com with SMTP id 586e51a60fabf-e2a00f2cc8so11525836fac.4 for ; Tue, 12 Apr 2022 07:44:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=google; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=rY6b4Cha+4+tNB8Pe5EB9gbUIN/2B2C73pXkmyewtts=; b=h52PHqsVBf6x5MwcgRmqywyRnHupk7jLRhBbSS3EiExbZLToXqg8TsoZFRyY3acwjn 0guxxFmbhbRecywCbpVLvlbUzlf9oUvl8N0Ww5B4wVJCr0HX/FU0/VvHTQObkC3o/tHV wZPWtPc70D+JeGBUNbAE2Ph8zJg9+oH/n8q+I= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=rY6b4Cha+4+tNB8Pe5EB9gbUIN/2B2C73pXkmyewtts=; b=xKgdAXHDpPlvUodc51D8GMEAOIEmXfdTjawKB0qhKkUvBX2rdmrT1jkk9P4ZbOaCuU GU3Xz5JOkknqkxIwg4fah01TWYVnlrKyP2QNQbFj8Yq85FT/prCBzq6aITxlSNMOdhw1 hnZD2HA1EpCb6OgxUtur3owY/ePn0K1GCkvMw9e4VUrZewvSOi2oTMiEVtpvtY0h9AWN pa9tayqvq01MeZDk+iFR8xzpVQihsc7SkfdYWkBxXEM027uU+ursLhn9OjBPUVnwLnmF QvjPkEMUBbkMH8wNsXvex4khIgv0SGEjU2wT+rBZNPOHuXamc/TssEHWXFO5jFAGCyOi X/9Q== X-Gm-Message-State: AOAM5303p1Iybu/Swgup6SVOJNDLlIHEDxe5+QDTJFxrJugRvwiEawrY CMNce3KvblJHFmSqVANll41XCQ== X-Received: by 2002:a05:6870:8907:b0:e2:a4fd:7539 with SMTP id i7-20020a056870890700b000e2a4fd7539mr2271798oao.56.1649774676113; Tue, 12 Apr 2022 07:44:36 -0700 (PDT) Received: from [192.168.1.128] ([71.205.29.0]) by smtp.gmail.com with ESMTPSA id b188-20020aca34c5000000b002da579c994dsm12364497oia.31.2022.04.12.07.44.35 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 12 Apr 2022 07:44:35 -0700 (PDT) Subject: Re: [PATCH v3] usb: usbip: fix a refcount leak in stub_probe() To: Hangyu Hua , valentina.manea.m@gmail.com, shuah@kernel.org, gregkh@linuxfoundation.org, khoroshilov@ispras.ru Cc: linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, Shuah Khan References: <20220412020257.9767-1-hbh25y@gmail.com> From: Shuah Khan Message-ID: <7d8a7ae5-9553-bcf3-55d8-57d5df6375f4@linuxfoundation.org> Date: Tue, 12 Apr 2022 08:44:34 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.1 MIME-Version: 1.0 In-Reply-To: <20220412020257.9767-1-hbh25y@gmail.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-3.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,NICE_REPLY_A,RDNS_NONE,SPF_HELO_NONE, T_SCC_BODY_TEXT_LINE autolearn=unavailable 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 4/11/22 8:02 PM, Hangyu Hua wrote: > usb_get_dev() is called in stub_device_alloc(). When stub_probe() fails > after that, usb_put_dev() needs to be called to release the reference. > > Fix this by moving usb_put_dev() to sdev_free error path handling. > > Find this by code review. > > Fixes: 3ff67445750a ("usbip: fix error handling in stub_probe()") > Signed-off-by: Hangyu Hua > Reviewed-by: Shuah Khan > --- > > v2: add more description of this patch. > > v3: add how to find the problem. > Thank you. Greg, Please pick this patch up. thanks, -- Shuah