Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp1060926ybl; Wed, 14 Aug 2019 10:05:26 -0700 (PDT) X-Google-Smtp-Source: APXvYqx05A0lVQuO9HbiJXClnvyTt3FB4obM4dcJ1lTK1mRUomN1uphCaPVVnGPWzXTPOryRvVpG X-Received: by 2002:a63:221f:: with SMTP id i31mr153901pgi.251.1565802326015; Wed, 14 Aug 2019 10:05:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565802326; cv=none; d=google.com; s=arc-20160816; b=ysV64YFM4NcbHbEmeOCuDPdZhEqOLbzojSloMWkut/X/W7hiD688QZLVClp9NMl4QR 1WEv/2oH00UrrIaorC8gxTipN8TINW4KSsjDH82W0uR01chwvCY0U7d3k4w6Wl+HrE+g lkH/mb3nNXaqI0yAOZu4H7ueeG3tIuNp63wCZJM89pwAc1p4o/mvp5TSWmzGIpruP8gj g8JEzJ7+d5NC/PB+BTPSHpvNQoKu39iiMWNXiKe2m9cnxBoU2RnuJiMHzCqPjYJQfvlq FYCF/9qillNWS3+BG5cnn67KA4hhPW16sJfMev3eV+45pzkbsyALXUj+FZ6i46tJrHzw +upA== 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=mj/IZ2jm2noDl12stDHuZSY7Z6dh5SeOZpeJ2vprEqE=; b=cq/uSZsYfy+2Lgx1K7smiwC8HczLvKpPyRiCnzaAnK6jlcRvTy4XQPMoUGGGxe0xbc RTBStKJVWzcEd2apol/2JQ9K11xiR+AAq8TD13QAGGdFFAO/bhp0QsYdgwLAtuw0yP17 alqb5r5tbbznOcbtWzb5ukcaN4KZJtVBGwgvNVi8HcbMoP4K/ez8nlRgVdN/LT0yfsVa RIfCxD+ksneNAZcXcfJolHY72zBe1Vt8qBFaLdWjjWyXwJ3UlKOFnglBqtrcQfT2+EVv mu4EloJxuscXPyjoP7yC7pfioxu3mSo7DjoMFz8oAkW1n4dZeB+qPHs1YMOMZDURUyyA lEUQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="w0Lt7H/1"; 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 h11si161070pgr.555.2019.08.14.10.05.09; Wed, 14 Aug 2019 10:05:26 -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="w0Lt7H/1"; 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 S1728685AbfHNRCj (ORCPT + 99 others); Wed, 14 Aug 2019 13:02:39 -0400 Received: from mail.kernel.org ([198.145.29.99]:51078 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728674AbfHNRCg (ORCPT ); Wed, 14 Aug 2019 13:02:36 -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 2EE97214DA; Wed, 14 Aug 2019 17:02:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1565802155; bh=Tt2EqeaocrgyBp4xquR/jMgpydrdFvFboGMgsd9PDgM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=w0Lt7H/1vL9vPipNyWw933GAqnsgb2PZxN8vBN5nf36SB0KJ+TjajArKO4GBSlk9t +0evR3Np0HIv2+h2elxjrYmeuPaArtnG8DydSHY2DbFyM2p2XOZZsxgF1hjKU6XnFB 4wPojqtq1URapxWCFENCPprQ6gjhzsrNZT4JTp5Y= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Gavin Li , Alan Stern Subject: [PATCH 5.2 016/144] usb: usbfs: fix double-free of usb memory upon submiturb error Date: Wed, 14 Aug 2019 18:59:32 +0200 Message-Id: <20190814165800.583805711@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190814165759.466811854@linuxfoundation.org> References: <20190814165759.466811854@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 @@ -1788,8 +1788,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)