Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp1998984imm; Thu, 24 May 2018 04:16:31 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqlsTFuoJWxx+xjnrF2S5pfDH1fY39CJL39YPvzlAnu5gdYkBVOzN6xvVGOvfWkejQzLaYt X-Received: by 2002:a63:6ec6:: with SMTP id j189-v6mr5413697pgc.71.1527160591378; Thu, 24 May 2018 04:16:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527160591; cv=none; d=google.com; s=arc-20160816; b=zReqIE51bjZLttFtG6pbkzkBj72zQIVfEvthLSBoyllFqsPKfW3Iw7qzOLCyQAmlAi dJXzDxWvFLTo/k5CDZbI1pjMytbfFH06RwBgv+A+fCw4AC1vUbEFl9+qOMOlc1R5uwzS tq3n1GhuLGwmOnhbcmMjc3dGW5/8qlmgX76FfmvTytlkN/yAEoNtJY4kn8lDyi1dSDZq TIUn/0CHoRxWJMEtT7co+CAQ3ouy2pX5vDUPs7+1lZarqABb+D1F0C12zWSQZ5Y5SiWy V/3YL0BOvvb2BUZjaL8g5BLsJlLVdvuaKN9Qwh4+BSkt9kGVlJ/0E4ry5/PNRQKg+UIu /yQA== 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=DsvT2rukNL7Nulxd55ws0aT1p9Or1Kwc+K4DpeJVpl0=; b=IneSJeRDA23vH3EXJBUgFL+kl3dFE7sCVNhKlamc7aXz8ZwVpx2m7K/fePU1qg9NyG wH1qUYWqvvPjbT3RQJQJZ89tSOVNUf7HVY3iXOhs5oXV6bVCJvdr8e2AlXhA8V+wxyXT 84NjXyctm06VdBfrBnDUtwKnklrY6VPe+hLcpIqZuS+6U36QAdnxmulS6T9/nCHi5DLY gsn5t1SRgi2CMWGLL6r7X2XT9QcZQt6XfSVwNQpWWD1jYKpW0FaV6tjkJjxe9q1lWOPc YmAfrgupiwtkYY4GPHgqRcGjZTMxtFWcdPXGtRTJrcDa3GHXVCkmixJuyZjZYSFtoigM Pufw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=szYXSsV0; 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 ay12-v6si20970261plb.139.2018.05.24.04.16.16; Thu, 24 May 2018 04:16:31 -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=szYXSsV0; 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 S968649AbeEXLPi (ORCPT + 99 others); Thu, 24 May 2018 07:15:38 -0400 Received: from mail.kernel.org ([198.145.29.99]:60518 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S968074AbeEXJxn (ORCPT ); Thu, 24 May 2018 05:53:43 -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 2113D208A5; Thu, 24 May 2018 09:53:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1527155622; bh=/Jw0vRYwQEQ6PuSYwbMVApAef2jfcLd0riWahjG5kN0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=szYXSsV0ysMUj8IAyxMOkelxU5zpOglMf+jCjxvtqtofZB7n4K7RMnn/ZZ3y794dr s3pyf3lutv3S0nW1OAK9Lrjx5nwclmJwtzBetdtvs0NNcOcwfjSAl1njk3o7q9JIGs IhdTxqJgQAccJNQ+ShZ5JIXv7tBk0kOKWCO2Z9xI= 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.14 057/165] usb: gadget: core: Fix use-after-free of usb_request Date: Thu, 24 May 2018 11:37:43 +0200 Message-Id: <20180524093624.325409354@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180524093621.979359379@linuxfoundation.org> References: <20180524093621.979359379@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.14-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 @@ -191,8 +191,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);