Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp1067665ybl; Wed, 14 Aug 2019 10:10:54 -0700 (PDT) X-Google-Smtp-Source: APXvYqx9b4zHvee6tYCfyoqKaoM9P+eYq7aZStp8lAQ7oNIyP34NBTlaF/uBTvXn0d6nnE9/tpPr X-Received: by 2002:a63:f94c:: with SMTP id q12mr225169pgk.10.1565802654591; Wed, 14 Aug 2019 10:10:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565802654; cv=none; d=google.com; s=arc-20160816; b=HpJOARyFfTRBNo4ef7FmL/RXHvTDsD03mNnS2tpOltBD5icE06/i23u7qdeUccNbKm aC87eBUMH97vuzQ+C72TGycgtILqTd/Al3uoIlCbpQu6bmcdS5XuWM0zzEYmle5JRw7j XlspG40zZmC71RY8hJmklf3zWYpq+1N8hDM8Hir1W102RqvC5wvdoUpHKlFep/VqZ423 0naCJsIRClxWIPM2kAhWFit9zV3hnk8WUpxID03gE8VHYIBhhnV0PB/661WsjROu0Yms zCygxYyArNTY3lFXoM545ogoIDshxSIYjYYe9+uC43THbrIdBKapuDc4+uKJk0QcjgsR jLyg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=zbSELepKpgVJdWuIvpuu+/HY3zvEOUadDaNMAOiDXQE=; b=Cw0LTn9Hyh0NIhHBCfQcdtygjFaqM6A3YgmxBm17wGuC6RuTHhEQE+igsw5xAN8em1 O9+t+Y1iQgBVKleLY/lURJ02ZrJBCBUC6+X9iRY4G1f1QweRPAHrZGCmFepuqzG5CQoi O8ZUORuxuvckpO43+WAe1g7cNCa5R8gq1iNq5dqcyJ6SbiKNROEcQH7DKMLA8tu9uqPj Du1AyS8g4NMWSh4JiW+MuCBDFteMkJCz1glo7xNg2TSJCntnSUCiMnnkacAgSoFx04yL WARxR5J7DSIv6itL8/xgLTsl0CcbSOSHCNV6WwsZf1JGBT6Rn8vHfqZcUUpGwjQIJ1+f iBKA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=SBPorsrP; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q18si184241pgk.31.2019.08.14.10.10.38; Wed, 14 Aug 2019 10:10:54 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=SBPorsrP; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730385AbfHNRJo (ORCPT + 99 others); Wed, 14 Aug 2019 13:09:44 -0400 Received: from mail.kernel.org ([198.145.29.99]:60246 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730372AbfHNRJm (ORCPT ); Wed, 14 Aug 2019 13:09:42 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (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 0F9B6214DA; Wed, 14 Aug 2019 17:09:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1565802582; bh=uZx/YxYl0pu1bln3sAog1+mlRjc9Q0jlUpMBSFc9XU8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=SBPorsrP0zt/cKa4Npe/v0hUT8GdHQkXkXX3Vl1eRY2gDatggSX3gsbRCtym4ZCra nU4fLQfAWScNd5V8D0U2VTOno/tg9P+F8mZWnVS+cQzfaTkXjqVscTRoB1WG4m41kC FT9YHmlTBx4fmP/lJ8jaKP0gIlCpokdwh15IvVPo= 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.19 08/91] usb: usbfs: fix double-free of usb memory upon submiturb error Date: Wed, 14 Aug 2019 19:00:31 +0200 Message-Id: <20190814165749.494054788@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190814165748.991235624@linuxfoundation.org> References: <20190814165748.991235624@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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 @@ -1792,8 +1792,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)