Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp2604032ybh; Mon, 9 Mar 2020 09:11:59 -0700 (PDT) X-Google-Smtp-Source: ADFU+vuUCIUnW4mafF53h+cqZv6BrkFW/DSvNx6eR36vnG77V5/Dkr+mcykC1RqIsiBgx+3TcLAN X-Received: by 2002:a9d:6ad1:: with SMTP id m17mr14325413otq.198.1583770319408; Mon, 09 Mar 2020 09:11:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1583770319; cv=none; d=google.com; s=arc-20160816; b=ZHLfAxB4A8XncCLQc8CjHKQ3BCUZ7PcqmhN888tL4qo9QENLYfX3VZKKExP8CMsQ9X t2J2+aJbwYQGjzOZZ6HofwWi8gOnmXUPxjK3iTNZC6FGg4Xd+kMvfh7KVX8wuB2mmCG4 RijMdxjpe4ckikVlFEXa49D2cc+E9nPQZYpyNCCjNezOV3+152edIYGBHnrqb8tQb1e5 qUX6XO+MSipMEBWHvD1p9tru9VSEaZ40gV0q7+pFwlY6hCGplUKeH8dsyr2fRODWCFu5 OazuumP3UleK7n4B6cK318GC3ejfXqezHuLl7Bz5/Ip4vbw1cd7ZNURF2L0iv+/GDHku 6Bww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:mail-followup-to :message-id:subject:cc:to:from:date:dkim-signature; bh=BoPPFSIyv/x3zMoh4vQgW2YRQN7431G4sFt8c/J7vYc=; b=e+1/KT9Aq4siuZ0kUZo96iyVlOchRmfipRSmC9BOwT8l38vVOztWwrqFqK5oaI4zh5 AbPm+/WJopL6dKG68GWXBXhVxGizdl0aVnv6ebduJCLp2QWfEQjs/OrfwEP1PeRRnVZF dOvNJgTi8dTjan9YPnNky/lO/4iSK4FvH+IK11PxbbAGGeRyNWmJjlXMJUY1dkNZklxl 6OL3SIvSlsFVIcieAxCI56V21fExSm7x/Wumfqq4mXOyw81CdXNapDA6WxWeuOi/2He+ WcxQMlDKQz4lKTrn08NZyF3sLKm1asYEyB2d0aCIY2AdMNJdfffl4anyd0xBFl/EOit6 A1Gg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=EqYwQhUb; 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; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z15si6620770oto.191.2020.03.09.09.11.39; Mon, 09 Mar 2020 09:11:59 -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=@ti.com header.s=ti-com-17Q1 header.b=EqYwQhUb; 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; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727076AbgCIQLH (ORCPT + 99 others); Mon, 9 Mar 2020 12:11:07 -0400 Received: from lelv0142.ext.ti.com ([198.47.23.249]:51184 "EHLO lelv0142.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726990AbgCIQLG (ORCPT ); Mon, 9 Mar 2020 12:11:06 -0400 Received: from lelv0266.itg.ti.com ([10.180.67.225]) by lelv0142.ext.ti.com (8.15.2/8.15.2) with ESMTP id 029GB1Ti064923; Mon, 9 Mar 2020 11:11:01 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1583770261; bh=BoPPFSIyv/x3zMoh4vQgW2YRQN7431G4sFt8c/J7vYc=; h=Date:From:To:CC:Subject:References:In-Reply-To; b=EqYwQhUbuF3q890fCxM+d4REL/Eqtuv8qr6Tm0fiXm95JwcuTHhOGJRTzO0BoE1Wq gVwXxl9d1JMJh/vBAzjXSbcSwrJRnlPLPsrn18c6ts/CmvNwMzAS57E+u3Wojlo5GS LBXjoIWQJ8Ms0rR8pue03bKCCoxB+s6wBDcHqxl8= Received: from DLEE100.ent.ti.com (dlee100.ent.ti.com [157.170.170.30]) by lelv0266.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 029GB1gI071804 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Mon, 9 Mar 2020 11:11:01 -0500 Received: from DLEE101.ent.ti.com (157.170.170.31) by DLEE100.ent.ti.com (157.170.170.30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1847.3; Mon, 9 Mar 2020 11:10:23 -0500 Received: from fllv0040.itg.ti.com (10.64.41.20) by DLEE101.ent.ti.com (157.170.170.31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1847.3 via Frontend Transport; Mon, 9 Mar 2020 11:10:23 -0500 Received: from localhost (ileax41-snat.itg.ti.com [10.172.224.153]) by fllv0040.itg.ti.com (8.15.2/8.15.2) with ESMTP id 029GAM4O038113; Mon, 9 Mar 2020 11:10:22 -0500 Date: Mon, 9 Mar 2020 11:16:11 -0500 From: Bin Liu To: Mans Rullgard CC: Greg Kroah-Hartman , , Subject: Re: [PATCH v2] usb: musb: fix crash with highmen PIO and usbmon Message-ID: <20200309161611.GC31115@iaqt7> Mail-Followup-To: Bin Liu , Mans Rullgard , Greg Kroah-Hartman , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org References: <20200309152653.29161-1-mans@mansr.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <20200309152653.29161-1-mans@mansr.com> User-Agent: Mutt/1.9.4 (2018-02-28) X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Mar 09, 2020 at 03:26:53PM +0000, Mans Rullgard wrote: > When handling a PIO bulk transfer with highmem buffer, a temporary > mapping is assigned to urb->transfer_buffer. After the transfer is > complete, an invalid address is left behind in this pointer. This is > not ordinarily a problem since nothing touches that buffer before the > urb is released. However, when usbmon is active, usbmon_urb_complete() > calls (indirectly) mon_bin_get_data() which does access the transfer > buffer if it is set. To prevent an invalid memory access here, reset > urb->tranfer_buffer to NULL when finished (musb_host_rx()), or do not WARNING: 'tranfer' may be misspelled I have fixed it locally. > set it at all (musb_host_tx()). > > Fixes: 8e8a55165469 ("usb: musb: host: Handle highmem in PIO mode") > Signed-off-by: Mans Rullgard Applied. Thanks. -Bin.