Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp1072014ybl; Wed, 14 Aug 2019 10:14:35 -0700 (PDT) X-Google-Smtp-Source: APXvYqyJbpHTxXQWxb8FzYCQ5Idjz4sea9t7LrtqI2X+ZuxzM288i5EoD0OQ8V4n/ySov+rUzQ7W X-Received: by 2002:aa7:9a52:: with SMTP id x18mr1068934pfj.8.1565802875403; Wed, 14 Aug 2019 10:14:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565802875; cv=none; d=google.com; s=arc-20160816; b=dz4N8GhzkpE62l+Qdpsde8/mexpB+qzlgU6QfiHEb4ZXG/+UBoqdry3AsZaIMmcPH6 A/wYt8hXSsI6VNQPxBS+1pP/Z53sNHZbr8TMZkRWYfa1vZk/C0QGXVrCC+k79Axg2ReR lXQjNYuTiqeW1eJYpNAoxNGhEA7o5SD7ZfMAnevkBMPnEGcmhpvZVG1n60SO+EDdWCH1 hvOMWa8I1rbZ/hEiZhxrrQHFp+CRhPybh0Hqu0FocFDRK5yWPUKPtXcoSlZjN4SPxLwb QPpQ8jON4Yk6lY+Vu+EoxzphZYpRL/+72aelXLIGZvhmoGLrUpkYRlbyE+5Znb5dknOT oUug== 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=kcLkPqUZfo5hRXBForaKi2rfu6Jy4lFOZ5H8Z4Itcu0=; b=rWliR2obCnQvBjppFgPnX3rIJEGLzAmz2CF1+yEYEvIa02OtLJSTD6UtEyydX/6CeO 1nC4uXzDSPwth1Y/OjhwXkEmivgj3tJxXNd25wEeyfqEy72fXO4eY4Fb/uJrBUpDJeCc g/VkUbAnh7y0z7TeK1BMJLZECkMwEexEudkPfGntmki2kpiZ8YCvHJXa3HMkUHDLOJJy U6UUh1+VmJuP6l2IJj7nlEb5VqyOmDLM7p84hgyPcm3kqXnz3AotWRTRAtj8YGrQgmop /8mSAtDAiGOrUo01kMQMJdTnD6DCgEIAwZloklQCGLF5/0mJV2SeGX9Kf9pa7Ulp530S /9NA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=hqzI+14+; 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 g11si65385pfi.282.2019.08.14.10.14.19; Wed, 14 Aug 2019 10:14:35 -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=hqzI+14+; 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 S1729678AbfHNRMi (ORCPT + 99 others); Wed, 14 Aug 2019 13:12:38 -0400 Received: from mail.kernel.org ([198.145.29.99]:36546 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730768AbfHNRMh (ORCPT ); Wed, 14 Aug 2019 13:12:37 -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 237C82173B; Wed, 14 Aug 2019 17:12:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1565802756; bh=kUVj6UrNq06OL/GersIVARiPx7oZmvAuMKtZBYZEIBM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=hqzI+14+t4O9Mq130jlPaalGGwomc3ZsuyFiAik0fSpenC6hMnLI5WwOXDo42d1R7 VY5ibiJ/iHyg2U/qjaiqs+ND2PzkOc84qyp+tsn2y6WVFqj9qQ9X8utexRkVaulNrF zMAGSnHXSOT25nNDFxEcRehimZtVL8FRbyAvYw/I= 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.14 04/69] usb: usbfs: fix double-free of usb memory upon submiturb error Date: Wed, 14 Aug 2019 19:01:02 +0200 Message-Id: <20190814165745.488335120@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190814165744.822314328@linuxfoundation.org> References: <20190814165744.822314328@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 @@ -1811,8 +1811,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)