Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp1913867imm; Thu, 24 May 2018 02:50:43 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqatWFxoeEYMPPDIgB3onwuwy3vmEz6/bYB+WySFMI592/q17gZ5guQUnu0nhjZTQ6Hv9qb X-Received: by 2002:a62:6756:: with SMTP id b83-v6mr6570883pfc.76.1527155443864; Thu, 24 May 2018 02:50:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527155443; cv=none; d=google.com; s=arc-20160816; b=yU2NGy9wExzH7ZiVkge53N7edltkMX6LkzponfIods+aRzi589dqzHj7urt1L8NXWX LDdYzSzu6Eg97SHEdm+ZT3DRXbU9D1eQ/ILvjP2ANt9p2YI04BD+Ih7PqszetTGiwuxM ZcgL4fWNJEtkfKzu1Byg205Otm0qR6iiz4HmYAx0DzcSpXxbj3qS/Xg5tqosb40RaujA xwkbfNs8wHw8u80ooldjC+tfVkW0iWzCkP1lXwQstkPOx/wgs3T24JGrZqvyMZMdQjXD eTaQeAqgbMWQoBGszINY95hJN/VOBie62cqPR4MPQnBiE3XCzO78Ry2DlzABVlY/JYXO WPgQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=xW0AZYo5g93NS8dimkiEgCa8+OQ8xLueQ2pEOapk6qc=; b=Mhnh9ECm320+PIE/V2O7qc00JuZcfSV5iFJDdz9hTN3TBhQWZ5PEEOm2cd9dKJ52+p aM/ca9RU9QrPcK46eYuxJylBWnAj6vloynYTplK0a2Qq/q4DKceSQzqVDlg7W5+mWYAT PIb0TZc3jcC3AeOkuazF0j76gfpS4wWdejW2+8NY4MaDfP2ztQAwxcTcxB2t5kjQhCR1 vRr4+83dYnAUbG9CZfHPVitwAjJjUH/osX5DPpWWxxvXv4vB219mCWYAc7PNjdo+Qd2o BZVXMyY+D18q+DPzzbsdj29e9ZRoUiV8kgU8ZStxVTDG0UQlWXyntfX29o0487NuTL78 12DA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=pUwm9Fwt; 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 u133-v6si1039658pgb.357.2018.05.24.02.50.28; Thu, 24 May 2018 02:50:43 -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=pUwm9Fwt; 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 S967416AbeEXJtf (ORCPT + 99 others); Thu, 24 May 2018 05:49:35 -0400 Received: from mail.kernel.org ([198.145.29.99]:38094 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S967093AbeEXJt2 (ORCPT ); Thu, 24 May 2018 05:49:28 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) (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 4560420894; Thu, 24 May 2018 09:49:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1527155367; bh=plFp/wk6qF5vvXTcJbOn2OgqAgr2oH1GEiefQPTECVg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=pUwm9FwtZgRbukZFzzQdk6PjgDXc/Mkz8053wDBOV8uLdVpM0yb0VLNzgqzVAFuKL kED/UOyXuul2wK1XpPNvjQrdpjXvIF/z1fTgx190ENqPr5Gy0tSANCfpdOysh7d0W2 ZhcsnEbx8XAGomUJbNCalyg8nqtzGI/TZDDMj5Z0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Manu Gautam , Felipe Balbi , Sasha Levin Subject: [PATCH 4.9 27/96] usb: gadget: core: Fix use-after-free of usb_request Date: Thu, 24 May 2018 11:38:10 +0200 Message-Id: <20180524093607.124199786@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180524093605.602125311@linuxfoundation.org> References: <20180524093605.602125311@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.9-stable review patch. If anyone has any objections, please let me know. ------------------ From: Manu Gautam [ Upstream commit e74bd4d358e5455233f1dcc3975425905b270b91 ] Driver is tracing usb_request after freeing it. Fix it by changing the order. Signed-off-by: Manu Gautam Signed-off-by: Felipe Balbi Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- drivers/usb/gadget/udc/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/usb/gadget/udc/core.c +++ b/drivers/usb/gadget/udc/core.c @@ -190,8 +190,8 @@ EXPORT_SYMBOL_GPL(usb_ep_alloc_request); void usb_ep_free_request(struct usb_ep *ep, struct usb_request *req) { - ep->ops->free_request(ep, req); trace_usb_ep_free_request(ep, req, 0); + ep->ops->free_request(ep, req); } EXPORT_SYMBOL_GPL(usb_ep_free_request);