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=-6.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable 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 D4A10C3A5A1 for ; Thu, 22 Aug 2019 17:45:09 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id AA19223400 for ; Thu, 22 Aug 2019 17:45:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1566495909; bh=YLrwVatPL9+gX9zHsjW8OKCQyEPKpL14pEZk8waVw5M=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=cj1fomaF8mptsN8Rda1LAp/jHWOmB4sTCUbVm9ToYqucJj0J0KYU/3EiKIpvaiDo7 NBXV8XXq4iIXvZqsi+u+fdlHL18xTV1da3SXCZMePO0afnUayGhjNDuq/b2ULyGx66 AywC2u1aX+k+hazBsuBQbShYaMVtfSZXj1iO8kgE= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2392894AbfHVRpE (ORCPT ); Thu, 22 Aug 2019 13:45:04 -0400 Received: from mail.kernel.org ([198.145.29.99]:42604 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2403826AbfHVRXL (ORCPT ); Thu, 22 Aug 2019 13:23:11 -0400 Received: from localhost (wsip-184-188-36-2.sd.sd.cox.net [184.188.36.2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 25D5C23407; Thu, 22 Aug 2019 17:23:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1566494590; bh=YLrwVatPL9+gX9zHsjW8OKCQyEPKpL14pEZk8waVw5M=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=UhEqwaxF4V96I/z4Vc3aH174YxrYcp47HatTiWMXM/ZOMN8YU4b/ayv39t8c8aK4s gjb3qZM9zGz0l0T8kObep7B1urzlvBGwNB0yq2RmAuvNv2wT43ph9arEuyYCduKBUI rCcW44gEsVYMWFKozROL9XNbNeTaySmDdx14k4M0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Gavin Li , Alan Stern Subject: [PATCH 4.9 001/103] usb: usbfs: fix double-free of usb memory upon submiturb error Date: Thu, 22 Aug 2019 10:17:49 -0700 Message-Id: <20190822171728.499909862@linuxfoundation.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20190822171728.445189830@linuxfoundation.org> References: <20190822171728.445189830@linuxfoundation.org> User-Agent: quilt/0.66 X-stable: review X-Patchwork-Hint: ignore MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Gavin Li commit c43f28dfdc4654e738aa6d3fd08a105b2bee758d upstream. Upon an error within proc_do_submiturb(), dec_usb_memory_use_count() gets called once by the error handling tail and again by free_async(). Remove the first call. Signed-off-by: Gavin Li Acked-by: Alan Stern Cc: stable Link: https://lore.kernel.org/r/20190804235044.22327-1-gavinli@thegavinli.com Signed-off-by: Greg Kroah-Hartman --- drivers/usb/core/devio.c | 2 -- 1 file changed, 2 deletions(-) --- a/drivers/usb/core/devio.c +++ b/drivers/usb/core/devio.c @@ -1810,8 +1810,6 @@ static int proc_do_submiturb(struct usb_ return 0; error: - if (as && as->usbm) - dec_usb_memory_use_count(as->usbm, &as->usbm->urb_use_count); kfree(isopkt); kfree(dr); if (as)